#33785 [Opn->Fbk]: pdo-pgsql crashes by PDO_FETCH_LAZY attribute
| From: | iliaa@php.net | Date: | Wed, 20 Jul 2005 19:34:42 +0000 |
| Subject: | #33785 [Opn->Fbk]: pdo-pgsql crashes by PDO_FETCH_LAZY attribute | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-82228@lists.php.net to get a copy of this message | ||
ID: 33785
Updated by: iliaa@php.net
Reported By: bs@php.net
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: gentoo linux
PHP Version: 5.1.0b3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Seems to work fine in CVS and valgrind does not reveal any hidden
memory corruption problems.
Previous Comments:
------------------------------------------------------------------------
[2005-07-20 12:51:16] bs@php.net
the "exit;" was just for debugging, that's not what makes the script
halt ;) sorry for that
------------------------------------------------------------------------
[2005-07-20 12:50:24] bs@php.net
Description:
------------
the code is self-explaining,
i am running mod_php 5.1.0b3 with apache 1.3.33 and postgresql 8.0.1
Reproduce code:
---------------
<pre><?php
$db = new PDO("pgsql:host=localhost dbname=foo user=bar password=''");
// need to select at least 2 rows to make it crash
$query = 'SELECT pcontact_id FROM pcontacts LIMIT 2';
// works fine
$s = $db->query($query);
$s->setFetchMode(PDO_FETCH_ASSOC);
foreach($s AS $row)
var_dump($s);
// segfaults
foreach($db->query($query, PDO_FETCH_LAZY) AS $row)
var_dump($row);
exit;
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33785&edit=1