Bug #43561 [Bgs->Csd]: Selecting large numbers of rows results in OOM
Edit report at http://bugs.php.net/bug.php?id=43561&edit=1
ID: 43561
Updated by: ssufficool@php.net
Reported by: php at seven dot net dot nz
Summary: Selecting large numbers of rows results in OOM
-Status: Bogus
+Status: Closed
Type: Bug
Package: PDO related
Operating System: Linux
PHP Version: 5.2.5
-Assigned To:
+Assigned To: ssufficool
New Comment:
Fixed in revision 300002.
Previous Comments:
------------------------------------------------------------------------
[2007-12-11 16:06:19] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
The driver maybe pre-allocating memory at the time of the fetch, hence
the OOM.
------------------------------------------------------------------------
[2007-12-11 07:56:06] php at seven dot net dot nz
Description:
------------
Selecting a large number of rows in a prepared statement results in an
OOM error after execute() is called.
The SQL server is located on a different box. I have not been able to
pinpoint the exact number of rows as it is a moving target. It has
failed on as low as 20k and as high as 50k.
Obviously it would result in OOM if I had selected everything into an
array, but from what I gather results should not be being sent to PHP
until the fetchXYZ functions are called. Or am I wrong?
It worked with 5.2.0 on the same box.
Reproduce code:
---------------
<?php
$database = new PDO (
'dblib:host=10.9.8.213;dbname=realenz',
'sa',
'loo0nieP'
);
$query = "SELECT TOP 50000 * FROM nc_listing_full";
$statement = $database->prepare ($query);
$statement->execute ();
?>
Expected result:
----------------
Query to execute
Actual result:
--------------
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 4 bytes) in
/www/data/realestate-dev/scripts/htdocs/cron/rebuild_listings.php on
line 12
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=43561&edit=1
Thread (3 messages)