| 1 |
connect prevent_purge,localhost,root,,; |
| 2 |
START TRANSACTION WITH CONSISTENT SNAPSHOT; |
| 3 |
connection default; |
| 4 |
SET GLOBAL innodb_monitor_disable='lock_row_lock_time_avg'; |
| 5 |
CREATE TABLE `t` (a INT PRIMARY KEY) engine=InnoDB STATS_PERSISTENT=0; |
| 6 |
INSERT INTO t VALUES (5); |
| 7 |
SELECT name, count FROM information_schema.innodb_metrics |
| 8 |
WHERE name ='lock_row_lock_current_waits'; |
| 9 |
name count |
| 10 |
lock_row_lock_current_waits 0 |
| 11 |
connect con1,localhost,root,,; |
| 12 |
BEGIN; |
| 13 |
SELECT * FROM t FOR UPDATE; |
| 14 |
a |
| 15 |
5 |
| 16 |
connect con2,localhost,root,,; |
| 17 |
SET DEBUG_SYNC="lock_wait_before_suspend SIGNAL blocked WAIT_FOR cont"; |
| 18 |
BEGIN; |
| 19 |
SELECT * FROM t FOR UPDATE; |
| 20 |
connection default; |
| 21 |
SET DEBUG_SYNC="now WAIT_FOR blocked"; |
| 22 |
SELECT name, count FROM information_schema.innodb_metrics |
| 23 |
WHERE name ='lock_row_lock_current_waits'; |
| 24 |
name count |
| 25 |
lock_row_lock_current_waits 1 |
| 26 |
SET GLOBAL innodb_monitor_disable='lock_row_lock_current_waits'; |
| 27 |
SET GLOBAL innodb_monitor_reset_all='lock_row_lock_current_waits'; |
| 28 |
SET GLOBAL innodb_monitor_enable='lock_row_lock_current_waits'; |
| 29 |
SELECT name, count FROM information_schema.innodb_metrics |
| 30 |
WHERE name ='lock_row_lock_current_waits'; |
| 31 |
name count |
| 32 |
lock_row_lock_current_waits 1 |
| 33 |
SET DEBUG_SYNC="now SIGNAL cont"; |
| 34 |
disconnect con1; |
| 35 |
connection con2; |
| 36 |
a |
| 37 |
5 |
| 38 |
COMMIT; |
| 39 |
disconnect con2; |
| 40 |
connection default; |
| 41 |
SET DEBUG_SYNC="reset"; |
| 42 |
SELECT name, count FROM information_schema.innodb_metrics |
| 43 |
WHERE name ='lock_row_lock_current_waits'; |
| 44 |
name count |
| 45 |
lock_row_lock_current_waits 0 |
| 46 |
DROP TABLE `t`; |
| 47 |
SET GLOBAL innodb_monitor_disable='lock_row_lock_current_waits'; |
| 48 |
SET GLOBAL innodb_monitor_reset_all='lock_row_lock_current_waits'; |
| 49 |
SET GLOBAL innodb_monitor_enable='lock_row_lock_current_waits'; |
| 50 |
SET GLOBAL innodb_monitor_enable='lock_row_lock_time_avg'; |
| 51 |
SET GLOBAL innodb_monitor_disable=default; |
| 52 |
SET GLOBAL innodb_monitor_reset_all=default; |
| 53 |
SET GLOBAL innodb_monitor_enable=default; |
| 54 |
disconnect prevent_purge; |