#31818 [Opn->Fbk]: crash with batches on zero row queries
| From: | derick@php.net | Date: | Wed, 02 Feb 2005 16:55:15 +0000 |
| Subject: | #31818 [Opn->Fbk]: crash with batches on zero row queries | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-73287@lists.php.net to get a copy of this message | ||
ID: 31818
Updated by: derick@php.net
Reported By: xs0 at xs0 dot com
-Status: Open
+Status: Feedback
Bug Type: MSSQL related
Operating System: Windows Server 2003
PHP Version: 5.0.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-02-02 17:23:15] xs0 at xs0 dot com
Description:
------------
I executed mssql_query("...", $db, 50). The result was empty (no rows
returned), and there was a read from 0x00000000 when (I think)
mssql_fetch_assoc() executed.
Reproduce code:
---------------
I had no time to record the exact code, but it was something like
this:
$q=mssql_query("select * from table", $db, 50);
do {
while ($row=mssql_fetch_assoc($q)) {
...
}
} while (mssql_fetch_batch($q)>0);
the table was empty. I then prepended
if (mssql_num_rows($q)>0)
and everything was fine.
Expected result:
----------------
nothing, the table was empty :)
Actual result:
--------------
a crash because of reading 0x00000000
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31818&edit=1