From: wayne dot dean at opticsplanet dot com Operating system: 2.6.24-24-server PHP version: 5.3.1 PHP Bug Type: PDO related Bug description: Zend_Db SQL-Server query leaves results pending
Description: ------------ Zend_Db: When executing stored procedure on SQL Server from loop, subsequent queries in loop return Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 20019 Attempt to initiate a new SQL Server operation with results pending. [20019] Current workaround is to reconnect after each loop iteration, which is expensive. Reproduce code: --------------- $db = $this->getAdapter(); foreach($data as $k => $v){ $sql = "EXECUTE sp_DoSomething {$db->quote($k)}, {$db->quote($v)}"; $result = $db->query($sql)->fetchAll(); } Expected result: ---------------- Successful execution of stored procedure during each loop iteration. Actual result: -------------- First execution in loop succeeds, but subsequent executions return Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 20019 Attempt to initiate a new SQL Server operation with results pending. [20019] -- Edit bug report at http://bugs.php.net/?id=50674&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50674&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50674&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50674&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=50674&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50674&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=50674&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=50674&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=50674&r=needscript Try newer version: http://bugs.php.net/fix.php?id=50674&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=50674&r=support Expected behavior: http://bugs.php.net/fix.php?id=50674&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=50674&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=50674&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=50674&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50674&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=50674&r=dst IIS Stability: http://bugs.php.net/fix.php?id=50674&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=50674&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=50674&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=50674&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=50674&r=mysqlcfg