Debian Codegraph @

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

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