Bug #76048 [NEW]: max_execution_time is not respected

From: Date: Mon, 05 Mar 2018 07:37:30 +0000
Subject: Bug #76048 [NEW]: max_execution_time is not respected
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214196@lists.php.net to get a copy of this message
From: rishabh dot pugalia at gmail dot com Operating system: Mac PHP version: 7.0.28 Package: PDO MySQL Bug Type: Bug Bug description:max_execution_time is not respected Description: ------------ PDO does not respect MySQL 5.7's new feature - max_execution_time() The code below will explain further. Sadly the mysqli_* seg faults if the same native prepared statement is executed. Test script: --------------- <?php $connection = new PDO("mysql:host=127.0.0.1;dbname=experiments", 'root', ''); // Setting this to true triggers a query directly but still the result is same (which is also weird) $connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); // The query is supposed to take about 6s to execute $stmt = $connection->prepare("select /*+ max_execution_time(1000) */ * from users where name = ?"); $stmt->execute(['b08588d6-0f12-11e8-9637-7e0088aab9a1']); var_dump($stmt->fetchAll()); var_dump($connection->errorInfo()); Expected result: ---------------- It should throw an error around what Mysql natively does: "ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded" Actual result: -------------- array(0) { } array(3) { [0]=> string(5) "00000" [1]=> NULL [2]=> NULL } -- Edit bug report at https://bugs.php.net/bug.php?id=76048&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76048&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76048&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76048&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76048&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76048&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76048&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76048&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76048&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76048&r=support Expected behavior: https://bugs.php.net/fix.php?id=76048&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76048&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76048&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76048&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76048&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76048&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76048&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76048&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76048&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76048&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76048&r=mysqlcfg

« previous php.bugs (#214196) next »