1
-- source include/have_innodb.inc
4
drop table if exists t1;
7
SET @orig_lock_wait_timeout= @@innodb_lock_wait_timeout;
8
SET GLOBAL innodb_lock_wait_timeout=2;
10
# basic tests of semi-consistent reads
11
connect (a,localhost,root,,);
12
connect (b,localhost,root,,);
14
set session transaction isolation level read committed;
15
create table t1(a int not null) engine=innodb;
16
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
18
# we have locks_unsafe_for_binlog on by default. this should work.
19
select * from t1 where a=3 lock in share mode;
21
set session transaction isolation level read committed;
23
update t1 set a=10 where a=5;
27
update t1 set a=10 where a=5;
29
-- error ER_LOCK_WAIT_TIMEOUT
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
update t1 set a=11 where a=6;
35
-- error ER_LOCK_WAIT_TIMEOUT
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;
51
SET GLOBAL innodb_lock_wait_timeout=@orig_lock_wait_timeout ;