3
drop table if exists t1;
6
# basic tests of semi-consistent reads
8
connect (a,localhost,root,,);
9
connect (b,localhost,root,,);
11
set binlog_format=mixed;
12
set session transaction isolation level repeatable read;
13
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
14
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
16
# this should lock the entire table
17
select * from t1 where a=3 lock in share mode;
19
set binlog_format=mixed;
20
set session transaction isolation level repeatable read;
22
update t1 set a=10 where a=5;
26
# perform a semi-consisent read (and unlock non-matching rows)
27
set session transaction isolation level read committed;
28
update t1 set a=10 where a=5;
30
select * from t1 where a=2 for update;
31
# this should lock the records (1),(2)
32
select * from t1 where a=2 limit 1 for update;
34
# semi-consistent read will skip non-matching locked rows a=1, a=2
35
update t1 set a=11 where a=6;
36
update t1 set a=12 where a=2;
37
update t1 set a=13 where a=1;
41
update t1 set a=14 where a=1;
52
create table t1 (a int, b int) engine=myisam;
53
create table t2 (c int, d int, key (c)) engine=innodb;
54
insert into t1 values (1,1);
55
insert into t2 values (1,2);
56
connect (a,localhost,root,,);
58
set session transaction isolation level read committed;
59
delete from t1 using t1 join t2 on t1.a = t2.c where t2.d in (1);