From:             amex at bucksvsbytes dot com
Operating system: Ubuntu
PHP version:      5.3.19
Package:          PDO related
Bug Type:         Bug
Bug description:No "out of memory" error during ->fetchAll() from PostgreSQL

Description:
------------
In PHP 5.3.10 and PostgreSQL 9.1, when executing PDOStatement::fetchAll(),
if the retrieved data busts the PHP memory limit, the script dies quietly,
without throwing an "out of memory" error.

Test script:
---------------
//ini_set('memory_limit','256M');
$dsn=;//appropriate Data Source Name string
$sql=;//any query that returns slightly more data than the PHP memory limit
allows (default limit is 128 MB on my server)
$db=new PDO($dsn);
$result=$db->query($sql);
$datarray=$result->fetchAll();//fetch all rows into an array


Expected result:
----------------
When fetchAll() retrieves too much data, the script dies quietly, instead
of throwing an "out of memory" error.
When I uncomment the first line, the script runs to completion, thus
proving that the quiet death was due to lack of memory.

The problem seems to relate to the postgresql driver, as the same thing
happens when I use pg_connect/pg_query/pg_fetch_all instead of PDO to get
data from the same query.

This is the only PHP "out of memory" condition I've ever seen where no
error is thrown.



-- 
Edit bug report at https://bugs.php.net/bug.php?id=63642&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63642&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63642&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63642&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63642&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63642&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63642&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63642&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63642&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63642&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63642&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63642&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63642&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63642&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63642&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63642&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63642&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63642&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63642&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63642&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63642&r=mysqlcfg

Reply via email to