Bug #77713 [NEW]: Memory exhausted using mysqli_use_result()
| From: | data dot protection dot gdpr at gmail dot com | Date: | Fri, 08 Mar 2019 19:29:29 +0000 |
| Subject: | Bug #77713 [NEW]: Memory exhausted using mysqli_use_result() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-219891@lists.php.net to get a copy of this message | ||
From: data dot protection dot gdpr at gmail dot com
Operating system: CentOS 6
PHP version: 7.3.3
Package: MySQLi related
Bug Type: Bug
Bug description:Memory exhausted using mysqli_use_result()
Description:
------------
In PHP 7.2, this was running very well.
Since the upgrade to PHP 7.3, very quickly I get a "memory exhausted"
error in the mysqli_fetch_assoc() call, at around result #850000.
Increasing "memory_limit" helps getting more results, but the error is
always on mysqli_fetch_assoc(), so I'm very confident the problem is
there.
The data retrieved by the SELECT is very small (no big blobs), so there
is no bad row that I'm hitting that causes the memory issue.
Isn't the point of "use_result" not putting everything in memory and
being able to go through huge amount of results?
Am I doing something wrong? Is there a way to flush the previous read
results?
Test script:
---------------
mysqli_real_query($conn, 'SELECT id, name FROM big_table WHERE ... ORDER
BY ... LIMIT 1500000);
$result = mysqli_use_result($conn);
<... error handling here ...>
while ($row = mysqli_fetch_assoc($result)) {
<... do stuff ...>
}
mysqli_free_result($result);
--
Edit bug report at https://bugs.php.net/bug.php?id=77713&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77713&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77713&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77713&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77713&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77713&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77713&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77713&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77713&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77713&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77713&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77713&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77713&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77713&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77713&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77713&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77713&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77713&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77713&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77713&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77713&r=mysqlcfg