|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-11-05 08:26 UTC] ngyuki dot jp at gmail dot com
[2020-11-05 08:28 UTC] nikic@php.net
-Status: Open
+Status: Feedback
[2020-11-05 08:28 UTC] nikic@php.net
[2020-11-15 04:22 UTC] php-bugs at lists dot php dot net
[2020-12-03 07:03 UTC] ngyuki dot jp at gmail dot com
-Status: No Feedback
+Status: Closed
[2020-12-03 07:03 UTC] ngyuki dot jp at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 05:00:01 2025 UTC |
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) { } }