From: php at seven dot net dot nz Operating system: Linux PHP version: 5.2.5 PHP Bug Type: PDO related Bug description: Selecting large numbers of rows results in OOM
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 bug report at http://bugs.php.net/?id=43561&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43561&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43561&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43561&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43561&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43561&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43561&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43561&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43561&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43561&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43561&r=support Expected behavior: http://bugs.php.net/fix.php?id=43561&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43561&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43561&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43561&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43561&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43561&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43561&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43561&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43561&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43561&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43561&r=mysqlcfg
