Bug #77713 [Opn->Dup]: Memory exhausted using mysqli_use_result()
Edit report at https://bugs.php.net/bug.php?id=77713&edit=1
ID: 77713
Updated by: nikic@php.net
Reported by: data dot protection dot gdpr at gmail dot com
Summary: Memory exhausted using mysqli_use_result()
-Status: Open
+Status: Duplicate
Type: Bug
Package: MySQLi related
Operating System: CentOS 6
PHP Version: 7.3.3
Block user comment: N
Private report: N
New Comment:
Same issue as bug #77773, which should be fixed now.
Previous Comments:
------------------------------------------------------------------------
[2019-03-15 16:50:34] data dot protection dot gdpr at gmail dot com
Just to confirm, I reverted to PHP 7.2 and put "memory_limit" back to default. The process
works fine now.
Then I upgraded again to PHP 7.3, and I get the "memory exhausted" error again.
------------------------------------------------------------------------
[2019-03-08 19:29:28] data dot protection dot gdpr at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=77713&edit=1
Thread (3 messages)