Bug #52090 [Com]: mysql_fetch_assoc returns infinite number of records
| From: | gsx1022 at gmail dot com | Date: | Wed, 16 Jun 2010 11:19:25 +0000 |
| Subject: | Bug #52090 [Com]: mysql_fetch_assoc returns infinite number of records | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-151522@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52090&edit=1
ID: 52090
Comment by: gsx1022 at gmail dot com
Reported by: gsx1022 at gmail dot com
Summary: mysql_fetch_assoc returns infinite number of records
Status: Feedback
Type: Bug
Package: MySQL related
Operating System: Linux x86
PHP Version: 5.3.2
New Comment:
I am using the php5 package from the Ubuntu Linux APT repository. It
seems to use
libmysql. And yes, mysqli is also affected.
Previous Comments:
------------------------------------------------------------------------
[2010-06-16 03:51:33] kalle@php.net
Do you use mysqlnd with ext/mysql or libmysql, in either case does it
solve switching the lib?
Is mysqli affected by this issue too on your machine?
------------------------------------------------------------------------
[2010-06-15 21:35:55] gsx1022 at gmail dot com
Description:
------------
A MySQL query that should return 5 records returns an infinite number of
records.
It returns the 5 five records correctly, but then it returns them again,
and
again, and again... Other SELECT statements are fine, this is the only
problematic one. Also, this query works from the MySQL console just
fine. At
first I thought it is an issue with Zend Framework but it turned out it
is
probably not. See this url for (much) more info (also detailed
information to
reproduce): http://framework.zend.com/issues/browse/ZF-9982
Test script:
---------------
$c = mysql_connect('host', 'user', 'pass');
mysql_select_db('db', $c);
$raw = mysql_query('SELECT
name, level, parent FROM
allresources_view ORDER BY level ASC');
while ($r = mysql_fetch_assoc($raw)) {
var_dump($r);
echo '<br /><br />';
}
mysql_close($c);
Expected result:
----------------
5 records should have been returned from the database.
Actual result:
--------------
An infinite number of records are returned from the database.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52090&edit=1