Bug #74584 [NEW]: Error about active unbuffered queries triggered unexpectedly

From: Date: Fri, 12 May 2017 19:07:45 +0000
Subject: Bug #74584 [NEW]: Error about active unbuffered queries triggered unexpectedly
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209088@lists.php.net to get a copy of this message
From: love at sickpeople dot se Operating system: PHP version: 7.1.5 Package: PDO MySQL Bug Type: Bug Bug description:Error about active unbuffered queries triggered unexpectedly Description: ------------ An exception is thrown in the test case below. - Emulated prepares must be OFF - "LOCK TABLE" triggers the error, eg "set @foo='bar'" does NOT I see no reason why the error occurs in this case. Test script: --------------- // Please fill in $host = ''; $db = ''; $user = ''; $pass = ''; $options = []; $options[PDO::ATTR_EMULATE_PREPARES] = false; /* required */ $options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION; $PDO = new PDO ( "mysql:host=$host;dbname=$db;charset=utf8mb4", $user, $pass, $options ); $PDO->exec ('create temporary table foo (bar int)'); $PDO->query ('lock table foo write'); Expected result: ---------------- No exception thrown. Actual result: -------------- Exception thrown. SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOState ment::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=74584&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74584&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74584&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74584&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74584&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74584&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74584&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74584&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74584&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74584&r=support Expected behavior: https://bugs.php.net/fix.php?id=74584&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74584&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74584&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74584&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74584&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74584&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74584&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74584&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74584&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74584&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74584&r=mysqlcfg

« previous php.bugs (#209088) next »