mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / innodb_plugin / t / innodb_bug14007649.test
blobe1d27ecd74261ceb62025176631aa8481363b558
1 --source include/have_innodb_plugin.inc
2 --source include/have_debug.inc
4 create table t1 (
5   rowid int,
6   f1    int,
7   f2    int,
8   key i1 (f1, f2),
9   key i2 (f2)) engine=innodb;
11 show create table t1;
12 insert into `t1` (rowid, f1, f2) values (1, 1, 10), (2, 1, NULL);
14 connect (a,localhost,root,,);
15 connect (b,localhost,root,,);
17 connection a;
18 start transaction with consistent snapshot;
20 connection b;
21 start transaction;
22 update t1 set f2 = 4  where f1 = 1 and f2 is null;
24 -- echo (b) Number of rows updated:
25 select row_count();
27 insert into t1 values (3, 1, null);
29 -- echo (b) After update and insert query.
30 select rowid, f1, f2 from t1;
32 commit;
34 connection a;
36 -- echo (a) Before the update statement is executed.
37 select rowid, f1, f2 from t1;
39 SET SESSION debug="+d,bug14007649";
40 update t1 set f2 = 6 where f1 = 1 and f2 is null;
42 -- echo (a) Number of rows updated:
43 select row_count();
45 -- echo (a) After the update statement is executed.
46 select rowid, f1, f2 from t1;
48 commit;
50 --echo "The trx with consistent snapshot ended."
52 select rowid, f1, f2 from t1;
54 connection default;
55 disconnect a;
56 disconnect b;
58 drop table t1;