Commit fdd4da26 authored by Timothy Smith's avatar Timothy Smith

Apply test case changes for Bug #41671 (innodb-semi-consistent.test) also to

partition_innodb_semi_consistent.test, which was overlooked in the
innodb-5.1-ss3603 snapshot.
parent abd34d96
drop table if exists t1; drop table if exists t1;
set binlog_format=mixed; set binlog_format=mixed;
set session transaction isolation level read committed; set session transaction isolation level repeatable read;
create table t1(a int not null) create table t1(a int not null)
engine=innodb engine=innodb
DEFAULT CHARSET=latin1 DEFAULT CHARSET=latin1
...@@ -13,11 +13,12 @@ select * from t1 where a=3 lock in share mode; ...@@ -13,11 +13,12 @@ select * from t1 where a=3 lock in share mode;
a a
3 3
set binlog_format=mixed; set binlog_format=mixed;
set session transaction isolation level read committed; set session transaction isolation level repeatable read;
set autocommit=0; set autocommit=0;
update t1 set a=10 where a=5; update t1 set a=10 where a=5;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit; commit;
set session transaction isolation level read committed;
update t1 set a=10 where a=5; update t1 set a=10 where a=5;
select * from t1 where a=2 for update; select * from t1 where a=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction ERROR HY000: Lock wait timeout exceeded; try restarting transaction
......
...@@ -14,7 +14,7 @@ connect (a,localhost,root,,); ...@@ -14,7 +14,7 @@ connect (a,localhost,root,,);
connect (b,localhost,root,,); connect (b,localhost,root,,);
connection a; connection a;
set binlog_format=mixed; set binlog_format=mixed;
set session transaction isolation level read committed; set session transaction isolation level repeatable read;
create table t1(a int not null) create table t1(a int not null)
engine=innodb engine=innodb
DEFAULT CHARSET=latin1 DEFAULT CHARSET=latin1
...@@ -27,7 +27,7 @@ set autocommit=0; ...@@ -27,7 +27,7 @@ set autocommit=0;
select * from t1 where a=3 lock in share mode; select * from t1 where a=3 lock in share mode;
connection b; connection b;
set binlog_format=mixed; set binlog_format=mixed;
set session transaction isolation level read committed; set session transaction isolation level repeatable read;
set autocommit=0; set autocommit=0;
-- error ER_LOCK_WAIT_TIMEOUT -- error ER_LOCK_WAIT_TIMEOUT
update t1 set a=10 where a=5; update t1 set a=10 where a=5;
...@@ -35,6 +35,8 @@ connection a; ...@@ -35,6 +35,8 @@ connection a;
#DELETE FROM t1 WHERE a=5; #DELETE FROM t1 WHERE a=5;
commit; commit;
connection b; connection b;
# perform a semi-consisent read (and unlock non-matching rows)
set session transaction isolation level read committed;
update t1 set a=10 where a=5; update t1 set a=10 where a=5;
connection a; connection a;
-- error ER_LOCK_WAIT_TIMEOUT -- error ER_LOCK_WAIT_TIMEOUT
...@@ -42,6 +44,7 @@ select * from t1 where a=2 for update; ...@@ -42,6 +44,7 @@ select * from t1 where a=2 for update;
# this should lock the records (1),(2) # this should lock the records (1),(2)
select * from t1 where a=2 limit 1 for update; select * from t1 where a=2 limit 1 for update;
connection b; connection b;
# semi-consistent read will skip non-matching locked rows a=1, a=2
update t1 set a=11 where a=6; update t1 set a=11 where a=6;
-- error ER_LOCK_WAIT_TIMEOUT -- error ER_LOCK_WAIT_TIMEOUT
update t1 set a=12 where a=2; update t1 set a=12 where a=2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment