#37725 [Opn->Asn]: PDO's nextRowset() crashes PHP with "Access Violation"
| From: | iliaa@php.net | Date: | Wed, 07 Jun 2006 13:06:50 +0000 |
| Subject: | #37725 [Opn->Asn]: PDO's nextRowset() crashes PHP with "Access Violation" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-98132@lists.php.net to get a copy of this message | ||
ID: 37725
Updated by: iliaa@php.net
Reported By: nicolas at serpe dot org
-Status: Open
+Status: Assigned
Bug Type: PDO related
Operating System: Windows XP
PHP Version: 5CVS-2006-06-07 (snap)
-Assigned To:
+Assigned To: Wez
Previous Comments:
------------------------------------------------------------------------
[2006-06-07 10:23:42] nicolas at serpe dot org
Description:
------------
The nextRowset() function of PDO, when used with a stored procedure
which returns more than 1 result set, crashes PHP with an "Access
Violation" error.
I encountered this bug with the latest CVS snapshot of PHP, on IIS 5
and Windows XP. The Database is MS SQL Server 2000.
Reproduce code:
---------------
<?php
$conn = new PDO("odbc:Driver={SQL
Server};Server=myserver;Database=mydb;Trusted_Connection=yes;");
$sql = 'EXECUTE Test';
$stmt = $conn->query($sql);
$i = 1;
do {
$rowset = $stmt->fetchAll(PDO::FETCH_NUM);
if ($rowset) {
printResultSet($rowset, $i);
}
$i++;
} while ($stmt->nextRowset());
function printResultSet(&$rowset, $i) {
print "<br />Result set $i:<br />";
foreach ($rowset as $row) {
foreach ($row as $col) {
print $col . "\t";
}
print "<br />";
}
print "<br />";
}
?>
Expected result:
----------------
An output of the 3 result sets.
Actual result:
--------------
PHP has encountered an Access Violation at 010ABAEC
Result set 1:
0
1
2
7
8
9
10
11
12
13
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37725&edit=1