Bug #63642 [Opn->Asn]: No "out of memory" error during ->fetchAll() from PostgreSQL
Edit report at https://bugs.php.net/bug.php?id=63642&edit=1
ID: 63642
Updated by: willfitch@php.net
Reported by: amex at bucksvsbytes dot com
Summary: No "out of memory" error during ->fetchAll() from
PostgreSQL
-Status: Open
+Status: Assigned
Type: Bug
Package: PDO related
Operating System: Ubuntu
PHP Version: 5.3.19
-Assigned To:
+Assigned To: willfitch
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2012-12-18 21:17:38] willfitch@php.net
Without looking into this too far, have you verified that
error_reporting/display_errors are set to levels that are sufficient to display or
record this error?
------------------------------------------------------------------------
[2012-11-29 00:25:41] amex at bucksvsbytes dot com
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 this bug report at https://bugs.php.net/bug.php?id=63642&edit=1
Thread (5 messages)