blob: cd60b1fab22e2e22a62cc16902c81b2272d0e7c4 (
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
|
CREATE TABLE t1(a INT PRIMARY KEY, b VARCHAR(40), c INT, INDEX(b,c))
ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,'1',1),(2,'2',1);
SET @save_locks= @@GLOBAL.innodb_status_output_locks;
SET GLOBAL INNODB_STATUS_OUTPUT_LOCKS = 'ON';
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
BEGIN;
DELETE FROM t1 WHERE b='2' AND c=2;
SHOW ENGINE INNODB STATUS;
Type Name Status
InnoDB 2 lock struct(s), 1 row lock(s)
ROLLBACK;
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
BEGIN;
DELETE FROM t1 WHERE b='2' AND c=2;
SHOW ENGINE INNODB STATUS;
Type Name Status
InnoDB 2 lock struct(s), 1 row lock(s)
ROLLBACK;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN;
DELETE FROM t1 WHERE b='2' AND c=2;
SHOW ENGINE INNODB STATUS;
Type Name Status
InnoDB 1 lock struct(s), 0 row lock(s)
ROLLBACK;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
BEGIN;
DELETE FROM t1 WHERE b='2' AND c=2;
SHOW ENGINE INNODB STATUS;
Type Name Status
InnoDB 1 lock struct(s), 0 row lock(s)
ROLLBACK;
SET GLOBAL INNODB_STATUS_OUTPUT_LOCKS = @save_locks;
DROP TABLE t1;
|