| 1 |
drop table if exists t1; |
| 2 |
create table t1(a int primary key, b int, c int, unique(b)) engine = ndb; |
| 3 |
insert into t1 values (2,2,2); |
| 4 |
insert into t1 values (3,3,3); |
| 5 |
insert into t1 values (4,4,4); |
| 6 |
begin; |
| 7 |
insert into t1 values (1,1,1); |
| 8 |
begin; |
| 9 |
update t1 set c = 2 where b = 1; |
| 10 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 11 |
rollback; |
| 12 |
rollback; |
| 13 |
drop table t1; |
| 14 |
create table t1(a int primary key, b int, c int, key(b)) engine = ndb; |
| 15 |
insert into t1 values (2,2,2); |
| 16 |
insert into t1 values (3,3,3); |
| 17 |
insert into t1 values (4,4,4); |
| 18 |
begin; |
| 19 |
insert into t1 values (1,1,1); |
| 20 |
begin; |
| 21 |
update t1 set c = 2 where b = 1; |
| 22 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 23 |
rollback; |
| 24 |
rollback; |
| 25 |
drop table t1; |
| 26 |
--con1 |
| 27 |
create table t1(a int primary key, b int, c int, key(b)) engine = ndb; |
| 28 |
insert into t1 values (1,1,1); |
| 29 |
insert into t1 values (2,2,2); |
| 30 |
insert into t1 values (3,3,3); |
| 31 |
insert into t1 values (4,4,4); |
| 32 |
begin; |
| 33 |
update t1 set c = 10 where a = 1; |
| 34 |
update t1 set c = 20 where a = 1; |
| 35 |
update t1 set c = 30 where a = 1; |
| 36 |
--con1 c=30 |
| 37 |
select * from t1 where b >= 1 order by b; |
| 38 |
a b c |
| 39 |
1 1 30 |
| 40 |
2 2 2 |
| 41 |
3 3 3 |
| 42 |
4 4 4 |
| 43 |
--con2 c=1 |
| 44 |
select * from t1 where b >= 1 order by b; |
| 45 |
a b c |
| 46 |
1 1 1 |
| 47 |
2 2 2 |
| 48 |
3 3 3 |
| 49 |
4 4 4 |
| 50 |
--con1 |
| 51 |
delete from t1 where a = 1; |
| 52 |
--con1 c=none |
| 53 |
select * from t1 where b >= 1 order by b; |
| 54 |
a b c |
| 55 |
2 2 2 |
| 56 |
3 3 3 |
| 57 |
4 4 4 |
| 58 |
--con2 c=1 |
| 59 |
select * from t1 where b >= 1 order by b; |
| 60 |
a b c |
| 61 |
1 1 1 |
| 62 |
2 2 2 |
| 63 |
3 3 3 |
| 64 |
4 4 4 |
| 65 |
--con1 |
| 66 |
commit; |
| 67 |
--con1 c=none |
| 68 |
select * from t1 where b >= 1 order by b; |
| 69 |
a b c |
| 70 |
2 2 2 |
| 71 |
3 3 3 |
| 72 |
4 4 4 |
| 73 |
--con2 c=none |
| 74 |
select * from t1 where b >= 1 order by b; |
| 75 |
a b c |
| 76 |
2 2 2 |
| 77 |
3 3 3 |
| 78 |
4 4 4 |
| 79 |
--con1 |
| 80 |
begin; |
| 81 |
insert into t1 values (1,1,1); |
| 82 |
update t1 set c = 10 where a = 1; |
| 83 |
update t1 set c = 20 where a = 1; |
| 84 |
update t1 set c = 30 where a = 1; |
| 85 |
--con1 c=30 |
| 86 |
select * from t1 where b >= 1 order by b; |
| 87 |
a b c |
| 88 |
1 1 30 |
| 89 |
2 2 2 |
| 90 |
3 3 3 |
| 91 |
4 4 4 |
| 92 |
--con2 c=none |
| 93 |
select * from t1 where b >= 1 order by b; |
| 94 |
a b c |
| 95 |
2 2 2 |
| 96 |
3 3 3 |
| 97 |
4 4 4 |
| 98 |
drop table t1; |