Debian Codegraph @

mysql-test/suite/innodb/r/xa_prepare_lock_release.result

raw
1 #
2 # Bug#27189701 INNODB: EARLY RELEASE OF GAP LOCKS FOR RC
3 # ISOLATION [XA PREPARE]
4 #
5 CREATE TABLE t1 (col1 INT PRIMARY KEY, col2 int);
6 Connection: default
7 SET DEBUG='+d,ib_force_release_gap_lock_prepare';
8 # 1.Test GAP lock only on supremum record
9 XA START 'lock_trx';
10 SELECT * FROM t1;
11 col1 col2
12 # Update empty table acquire GAP lock on supremum
13 UPDATE t1 SET col2 = 100 where col1 = 10;
14 Connection: con1
15 SET DEBUG_SYNC = 'lock_wait_will_wait SIGNAL con1_will_wait';
16 INSERT INTO t1 values(10, 100);
17 SET DEBUG_SYNC = 'now WAIT_FOR con1_will_wait';
18 Connection: default
19 XA END 'lock_trx';
20 XA PREPARE 'lock_trx';
21 Connection: con1
22 INSERT INTO t1 values(20, 200);
23 SELECT * FROM t1 ORDER BY col1;
24 col1 col2
25 10 100
26 20 200
27 Connection: default
28 XA COMMIT 'lock_trx';
29 # 2.Test GAP lock on multiple records
30 XA START 'lock_trx_1';
31 # Update table acquire GAP lock on all rows
32 UPDATE t1 SET col2 = col2 + 1;
33 Connection: con1
34 INSERT INTO t1 values(5, 50);
35 Connection: default
36 XA END 'lock_trx_1';
37 XA PREPARE 'lock_trx_1';
38 Connection: con1
39 INSERT INTO t1 values(15, 150);
40 INSERT INTO t1 values(25, 150);
41 SELECT * FROM t1 ORDER BY col1;
42 col1 col2
43 5 50
44 10 100
45 15 150
46 20 200
47 25 150
48 Connection: default
49 XA COMMIT 'lock_trx_1';
50 SELECT * FROM t1 ORDER BY col1;
51 col1 col2
52 5 50
53 10 101
54 15 150
55 20 201
56 25 150
57 SET DEBUG='-d,ib_force_release_gap_lock_prepare';
58 DROP TABLE t1;