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