From: Operating system: Ubuntu 11.10 64bits PHP version: 5.3.9 Package: PDO related Bug Type: Bug Bug description:PDO exec
Description: ------------ SQL statement that return or should return a statement could leave an open cursor that cannot be closed. This bug is related to the following previous reports https://bugs.php.net/bug.php?id=36347 https://bugs.php.net/bug.php?id=34499 https://bugs.php.net/bug.php?id=42499 It's been reported that sql statement that do return result could cause this issue in non trivial situations. This report also highlight that statement returning empty result set could also cause the issue. Test script: --------------- $dbh = new PDO("mysql:your connection string", '', ''); echo $dbh->exec("SELECT * FROM cube where false"); echo $dbh->exec("SELECT * FROM cube where false"); print_r($dbh->errorInfo()); Expected result: ---------------- 00 Actual result: -------------- 0Array ( [0] => HY000 [1] => 2014 [2] => Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO:: MYSQL_ATTR_USE_BUFFERED_QUERY attribute. ) -- Edit bug report at https://bugs.php.net/bug.php?id=60930&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60930&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60930&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60930&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60930&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60930&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60930&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60930&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60930&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60930&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60930&r=support Expected behavior: https://bugs.php.net/fix.php?id=60930&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60930&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60930&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60930&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60930&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60930&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60930&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60930&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60930&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60930&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60930&r=mysqlcfg