blob: 0fcb8bd5aa894287186ebe81f926b7b90bd4327f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
connect stop_purge, localhost, root,,;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connect delete, localhost, root,,;
connection default;
CREATE TABLE t1(a INT PRIMARY KEY, b INT UNIQUE) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1,1);
DELETE FROM t1;
SET DEBUG_SYNC='row_ins_sec_index_unique SIGNAL inserted WAIT_FOR locked';
BEGIN;
INSERT INTO t1 VALUES(1,1);
connection delete;
SET DEBUG_SYNC='now WAIT_FOR inserted';
SET DEBUG_SYNC='innodb_row_search_for_mysql_exit SIGNAL locked';
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN;
DELETE FROM t1 WHERE b=1;
connection default;
connection delete;
COMMIT;
connection default;
SET DEBUG_SYNC='RESET';
ROLLBACK;
SET DEBUG_SYNC='row_ins_sec_index_unique SIGNAL inserted WAIT_FOR locked';
BEGIN;
INSERT INTO t1 VALUES(1,1);
connection delete;
SET DEBUG_SYNC='now WAIT_FOR inserted';
SET DEBUG_SYNC='innodb_row_search_for_mysql_exit SIGNAL locked';
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
BEGIN;
DELETE FROM t1 WHERE b=1;
connection default;
connection delete;
COMMIT;
connection default;
SET DEBUG_SYNC='RESET';
ROLLBACK;
SET DEBUG_SYNC='row_ins_sec_index_unique SIGNAL inserted WAIT_FOR locked';
BEGIN;
SET innodb_lock_wait_timeout=1;
INSERT INTO t1 VALUES(1,1);
connection delete;
SET DEBUG_SYNC='now WAIT_FOR inserted';
SET DEBUG_SYNC='innodb_row_search_for_mysql_exit SIGNAL locked';
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
BEGIN;
DELETE FROM t1 WHERE b=1;
connection default;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
COMMIT;
SET DEBUG_SYNC='RESET';
connection delete;
COMMIT;
disconnect delete;
disconnect stop_purge;
connection default;
DROP TABLE t1;
|