Bug #63642 [Com]: No "out of memory" error during ->fetchAll() from PostgreSQL

From: Date: Tue, 18 Dec 2012 21:17:38 +0000
Subject: Bug #63642 [Com]: No "out of memory" error during ->fetchAll() from PostgreSQL
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-175436@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63642&edit=1

 ID:                 63642
 Comment by:         willfitch@php.net
 Reported by:        amex at bucksvsbytes dot com
 Summary:            No "out of memory" error during ->fetchAll() from
                     PostgreSQL
 Status:             Open
 Type:               Bug
 Package:            PDO related
 Operating System:   Ubuntu
 PHP Version:        5.3.19
 Block user comment: N
 Private report:     N

 New Comment:

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?


Previous Comments:
------------------------------------------------------------------------
[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)

« previous php.bugs (#175436) next »