From: nicolas at serpe dot org Operating system: Windows XP PHP version: 5CVS-2006-06-07 (snap) PHP Bug Type: PDO related Bug description: PDO's nextRowset() crashes PHP with "Access Violation"
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 bug report at http://bugs.php.net/?id=37725&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37725&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37725&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37725&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37725&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37725&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37725&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37725&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37725&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37725&r=support Expected behavior: http://bugs.php.net/fix.php?id=37725&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37725&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37725&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37725&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37725&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37725&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37725&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37725&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37725&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37725&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37725&r=mysqlcfg