Bug #80319 [Fbk->NoF]: No error if the lock time exceeds innodb_lock_wait_timeout

From: Date: Sun, 15 Nov 2020 04:22:14 +0000
Subject: Bug #80319 [Fbk->NoF]: No error if the lock time exceeds innodb_lock_wait_timeout
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230361@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80319&edit=1 ID: 80319 Updated by: php-bugs@lists.php.net Reported by: ngyuki dot jp at gmail dot com Summary: No error if the lock time exceeds innodb_lock_wait_timeout -Status: Feedback +Status: No Feedback Type: Bug Package: PDO MySQL Operating System: Alpine Linux v3.12 PHP Version: 7.4.12 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2020-11-05 08:28:13] nikic@php.net Please try the upcoming PHP 7.4.13 release. A lot of bugs relating to this issue will be fixed in this release. ------------------------------------------------------------------------ [2020-11-05 08:26:13] ngyuki dot jp at gmail dot com This test specifies innodb_lock_wait_timeout=1 in MySQL. ------------------------------------------------------------------------ [2020-11-05 08:22:46] ngyuki dot jp at gmail dot com Description: ------------ If the following conditions are met, No error if the lock time exceeds innodb_lock_wait_timeout. - ATTR_EMULATE_PREPARES = false - WHERE is not specified MySQL(8.0.22) contains the following data. create table t ( id int not null primary key auto_increment ); insert into t values (1); Run the test script as follows. (php test.php >/dev/null) & (sleep 1 && php test.php) Setting ATTR_EMULATE_PREPARES = true or WHERE id = 1 results in an error, as expected. Test script: --------------- <?php $pdo = new PDO('mysql:host=mysql;port=3306;dbname=test', 'test', 'pass', [ PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, ]); $pdo->beginTransaction(); $stmt = $pdo->query('SELECT id FROM t FOR UPDATE'); $rows = $stmt->fetchAll(); var_dump([$stmt->errorCode(), $stmt->errorInfo(), $rows]); sleep(5); Expected result: ---------------- SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction Actual result: -------------- array(3) { [0]=> string(5) "00000" [1]=> array(3) { [0]=> string(5) "00000" [1]=> NULL [2]=> NULL } [2]=> array(0) { } } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80319&edit=1

« previous php.bugs (#230361) next »