PHP 4.0 Bug #7301: Error in msql_result: reproducible
| From: | afan dot remove_this_spamguard at jeo dot net | Date: | Wed, 18 Oct 2000 03:25:45 +0000 |
| Subject: | PHP 4.0 Bug #7301: Error in msql_result: reproducible | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35353@lists.php.net to get a copy of this message | ||
From: afan.remove_this_spamguard@jeo.net
Operating system: RedHat Linux 6.1
PHP version: 4.0.3pl1
PHP Bug Type: mSQL related
Bug description: Error in msql_result: reproducible
A piece of code worked perfectly with PHP3/Apache1.3.9/msql-2..11
I tried it with PHP4/Apache_1.3.14/msql-2.0.11 and got
sporadic crashes - I found out that:
IF
a) You have an msql database with a value in a row blank,
e.g. ('asdf',1,'',,...)
AND
b) you have a SELECT * statement
$sql="SELECT * from table where ... ORDER BY ..."
$result = msql($DB,$sql)
while ($row = msql_fetch_row($result) ) {
....
}
AND
c) the FIRST row returned contains a value that is blank
THEN
when php hits the msql_fetch_row($result) line,
PHP returns nothing and gives an error in the log
file like:
child pid 9346 exit signal Segmentation Fault
HOWEVER, if the first row returned does not have a
blank element in the row, then it seems to work ok.
----
I tried variations with
msql_result(), msql_connect, and msql_pconnect as well
but all gave me the same problem.
-----
Relevent facts?:
In running "make" I get
gcc .... -I/usr/local/Hughes/include .... -c php_msql.c -fPIC -DPIC -o php_msql.lo
php_msql.c:189 warning: int format, long int (arg 4)
php_msql.c:191 warning: int format, long int (arg 4)
php_msql.c:196 warning: int format, long int (arg 4)
php_msql.c:198 warning: int format, long int (arg 4)
I used the stock php.ini.dist file
Thanks in advance - PHP is great!
Afan Ottenheimer
--
Edit Bug report at: http://bugs.php.net/?id=7301&edit=1