Bug #76048 [Com]: PDO Mysql max_execution_time is not respected
| From: | piotrekkr at o2 dot pl | Date: | Sat, 11 Nov 2023 11:50:34 +0000 |
| Subject: | Bug #76048 [Com]: PDO Mysql max_execution_time is not respected | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-245788@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76048&edit=1
ID: 76048
Comment by: piotrekkr at o2 dot pl
Reported by: rishabh dot pugalia at gmail dot com
Summary: PDO Mysql max_execution_time is not respected
Status: Closed
Type: Bug
Package: PDO MySQL
Operating System: Mac
PHP Version: 7.0.28
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
I can reproduce with 8.2 and MySQL 8.0:
##########
PHP 8.2.12 (cli) (built: Oct 28 2023 01:45:57) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.12, Copyright (c) Zend Technologies
with Zend OPcache v8.2.12, Copyright (c), by Zend Technologies
with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethans
##########
test script:
------------------------
<?php
try {
$dbh = new PDO(
'mysql:host=db;dbname=dbname',
'root',
'root',
[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
]
);
$dbh->exec('SET SESSION MAX_EXECUTION_TIME=1000');
var_dump((new DateTime())->format('Y-m-d H:i:s.u'));
$stmt = $dbh->query('SELECT SLEEP(10), version()');
var_dump((new DateTime())->format('Y-m-d H:i:s.u'));
var_dump($stmt->fetchAll());
var_dump($stmt->errorInfo());
var_dump($dbh->errorInfo());
} catch (\Throwable $e) {
exit(var_dump($e->getMessage()));
}
------------------------
output is
------------------------
string(26) "2023-11-11 11:47:22.527547"
string(26) "2023-11-11 11:47:23.528134"
array(1) {
[0]=>
array(2) {
["SLEEP(10)"]=>
int(1)
["version()"]=>
string(6) "8.0.28"
}
}
array(3) {
[0]=>
string(5) "00000"
[1]=>
NULL
[2]=>
NULL
}
array(3) {
[0]=>
string(5) "00000"
[1]=>
NULL
[2]=>
NULL
}
------------------------
Previous Comments:
------------------------------------------------------------------------
[2021-09-03 12:23:32] thanhtung4948 at gmail dot com
I still face this problem using PHP 7.4
Can you confirm?
------------------------------------------------------------------------
[2020-12-10 11:01:12] nikic@php.net
Can't reproduce this on current 7.4/8.0 any more, can reproduce on 7.3. I believe the fix for
InnoDB lock errors also covered this case. (Please tell me if you still see this issue on current
7.4/8.0.)
------------------------------------------------------------------------
[2020-02-25 12:00:57] thijs at keeping dot nl
Reproduced using PHP 7.4 on both Ubuntu 18.04.4 and macOS 10.15.3.
------------------------------------------------------------------------
[2019-07-01 06:50:08] Fractalizer at yandex dot ru
Is reproducable on PHP 7.2 also. Any chances to have this fixed?
------------------------------------------------------------------------
[2018-06-20 15:56:04] anthony at catsone dot com
I'm also running into this issue. 100% reproducible as per the original reporter.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=76048
--
Edit this bug report at https://bugs.php.net/bug.php?id=76048&edit=1