Debian Codegraph @

mysql-test/suite/innodb/t/innodb_bug14007649.test

raw
1 --source include/have_debug.inc
2
3 create table t1 (
4 rowid int,
5 f1 int,
6 f2 int,
7 key i1 (f1, f2),
8 key i2 (f2)) engine=innodb;
9
10 show create table t1;
11 insert into `t1` (rowid, f1, f2) values (1, 1, 10), (2, 1, NULL);
12
13 connect (a,localhost,root,,);
14 connect (b,localhost,root,,);
15
16 connection a;
17 start transaction with consistent snapshot;
18
19 connection b;
20 start transaction;
21 update t1 set f2 = 4 where f1 = 1 and f2 is null;
22
23 -- echo (b) Number of rows updated:
24 select row_count();
25
26 insert into t1 values (3, 1, null);
27
28 -- echo (b) After update and insert query.
29 select rowid, f1, f2 from t1;
30
31 commit;
32
33 connection a;
34
35 -- echo (a) Before the update statement is executed.
36 select rowid, f1, f2 from t1;
37
38 SET SESSION debug="+d,bug14007649";
39 update t1 set f2 = 6 where f1 = 1 and f2 is null;
40
41 -- echo (a) Number of rows updated:
42 select row_count();
43
44 -- echo (a) After the update statement is executed.
45 select rowid, f1, f2 from t1;
46
47 commit;
48
49 --echo "The trx with consistent snapshot ended."
50
51 select rowid, f1, f2 from t1;
52
53 connection default;
54 disconnect a;
55 disconnect b;
56
57 drop table t1;