File: innodb_print_all_deadlocks_basic.result

package info (click to toggle)
mysql-5.5 5.5.42-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 201,212 kB
  • sloc: cpp: 646,036; ansic: 551,342; perl: 53,243; pascal: 25,099; yacc: 13,059; sh: 10,248; cs: 4,647; xml: 4,178; sql: 3,193; makefile: 1,368; lex: 639; awk: 54
file content (22 lines) | stat: -rw-r--r-- 584 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
SELECT @@innodb_print_all_deadlocks;
@@innodb_print_all_deadlocks
0
SET GLOBAL innodb_print_all_deadlocks=1;
CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB;
INSERT INTO t1 VALUES (123);
CREATE TABLE t2 (c2 INT, PRIMARY KEY (c2)) ENGINE=INNODB;
INSERT INTO t2 VALUES (456);
BEGIN;
SELECT * FROM t1 FOR UPDATE;
c1
123
BEGIN;
SELECT * FROM t2 FOR UPDATE;
c2
456
SELECT * FROM t2 FOR UPDATE;
SELECT * FROM t1 FOR UPDATE;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t2;
DROP TABLE t1;
SET GLOBAL innodb_print_all_deadlocks=default;