1
drop table if exists t1;
2
set binlog_format=mixed;
3
set session transaction isolation level repeatable read;
4
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
5
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
7
select * from t1 where a=3 lock in share mode;
10
set binlog_format=mixed;
11
set session transaction isolation level repeatable read;
13
update t1 set a=10 where a=5;
14
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
16
set session transaction isolation level read committed;
17
update t1 set a=10 where a=5;
18
select * from t1 where a=2 for update;
19
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
20
select * from t1 where a=2 limit 1 for update;
23
update t1 set a=11 where a=6;
24
update t1 set a=12 where a=2;
25
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
26
update t1 set a=13 where a=1;
27
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
29
update t1 set a=14 where a=1;