#37889 [Asn->Fbk]: Segfault using IteratorIterator on PDO statements
| From: | iliaa@php.net | Date: | Fri, 23 Jun 2006 07:49:23 +0000 |
| Subject: | #37889 [Asn->Fbk]: Segfault using IteratorIterator on PDO statements | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-98700@lists.php.net to get a copy of this message | ||
ID: 37889
Updated by: iliaa@php.net
Reported By: kevin at littletrader dot net
-Status: Assigned
+Status: Feedback
Bug Type: SPL related
Operating System: *
PHP Version: 5.1.5
Assigned To: helly
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php
for Win32
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2006-06-22 16:18:01] kevin at littletrader dot net
Description:
------------
Segfault:
[Thu Jun 22 18:34:02 2006] [notice] child pid 6222 exit signal
Segmentation fault (11)
Reproduce code:
---------------
<?php
$sql = "SELECT * FROM news ORDER BY nid DESC LIMIT 1";
try{
$dbh = new PDO("mysql:host=$dbhost;dbname=$dbname", $username,
$password);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $dbh->prepare($sql);
$stmt->execute();
$result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
$it = new IteratorIterator($stmt);
foreach($it as $resultSet)
{
echo $resultSet->key();
}
}
catch(PDOException $e)
{
echo 'Unable to select latest record'.$e->getMessage();
}
?>
Actual result:
--------------
[Thu Jun 22 18:34:02 2006] [notice] child pid 6222 exit signal
Segmentation fault (11)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37889&edit=1