# Establish connection conn1 (user = root) SET DEFAULT_STORAGE_ENGINE = 'tokudb'; DROP TABLE IF EXISTS foo; set session transaction isolation level serializable; create table foo ( a double, b double, c double, primary key (a,b)); insert into foo values (4,4,4),(4,5,5),(4,6,6),(5,4,4),(5,5,5),(5,6,6),(6,4,4),(6,5,5),(6,6,6); begin; select * from foo where a > 5; a b c 6 4 4 6 5 5 6 6 6 set session transaction isolation level serializable; insert into foo values (5,10,10); insert into foo values (5.0001,10,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction commit; begin; select * from foo where a >= 5; a b c 5 4 4 5 5 5 5 6 6 5 10 10 6 4 4 6 5 5 6 6 6 insert into foo values (5,1,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (4.999,10,10); commit; begin; select * from foo where a < 5; a b c 4 4 4 4 5 5 4 6 6 4.999 10 10 insert into foo values (5,0.1,10); insert into foo values (4.9999,10,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction commit; begin; select * from foo where a <= 5; a b c 4 4 4 4 5 5 4 6 6 4.999 10 10 5 0.1 10 5 4 4 5 5 5 5 6 6 5 10 10 insert into foo values (5,0.01,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (5.001,10,10); commit; begin; select * from foo where a = 5; a b c 5 0.1 10 5 4 4 5 5 5 5 6 6 5 10 10 insert into foo values (5,0.01,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (5.0001,10,10); insert into foo values (4.99999,1,10); commit; begin; select * from foo where a > 4 and a < 6; a b c 4.999 10 10 4.99999 1 10 5 0.1 10 5 4 4 5 5 5 5 6 6 5 10 10 5.0001 10 10 5.001 10 10 insert into foo values (4.1,0.01,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (5.9,10,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (6,10,10); insert into foo values (4,10,10); commit; begin; select * from foo where a >= 4 and a < 6; a b c 4 4 4 4 5 5 4 6 6 4 10 10 4.999 10 10 4.99999 1 10 5 0.1 10 5 4 4 5 5 5 5 6 6 5 10 10 5.0001 10 10 5.001 10 10 insert into foo values (4,0.01,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (5.9,10,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (6,1.1,10); insert into foo values (3.99,10,10); commit; begin; select * from foo where a > 4 and a <= 6; a b c 4.999 10 10 4.99999 1 10 5 0.1 10 5 4 4 5 5 5 5 6 6 5 10 10 5.0001 10 10 5.001 10 10 6 1.1 10 6 4 4 6 5 5 6 6 6 6 10 10 insert into foo values (4.0001,0.01,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (6,1110,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (6.001,1.1,10); insert into foo values (4,1110,10); commit; begin; select * from foo where a >= 4 and a <= 6; a b c 4 4 4 4 5 5 4 6 6 4 10 10 4 1110 10 4.999 10 10 4.99999 1 10 5 0.1 10 5 4 4 5 5 5 5 6 6 5 10 10 5.0001 10 10 5.001 10 10 6 1.1 10 6 4 4 6 5 5 6 6 6 6 10 10 insert into foo values (4,0.001,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (6,11110,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (6.0001,1.1,10); insert into foo values (3.99,10110,10); commit; delete from foo; insert into foo values (4,4,4),(4,5,5),(4,6,6),(5,4,4),(5,5,5),(5,6,6),(6,4,4),(6,5,5),(6,6,6); begin; select * from foo where a > 5 order by a desc; a b c 6 6 6 6 5 5 6 4 4 insert into foo values (5,10,10); insert into foo values (5.0001,10,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction commit; begin; select * from foo where a >= 5 order by a desc; a b c 6 6 6 6 5 5 6 4 4 5 10 10 5 6 6 5 5 5 5 4 4 insert into foo values (5,1,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (4.999,10,10); commit; begin; select * from foo where a < 5 order by a desc; a b c 4.999 10 10 4 6 6 4 5 5 4 4 4 insert into foo values (5,0.1,10); insert into foo values (4.9999,10,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction commit; begin; select * from foo where a <= 5 order by a desc; a b c 5 10 10 5 6 6 5 5 5 5 4 4 5 0.1 10 4.999 10 10 4 6 6 4 5 5 4 4 4 insert into foo values (5,0.01,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (5.001,10,10); commit; begin; select * from foo where a = 5 order by a desc; a b c 5 0.1 10 5 4 4 5 5 5 5 6 6 5 10 10 insert into foo values (5,0.01,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (5.0001,10,10); insert into foo values (4.99999,1,10); commit; begin; select * from foo where a > 4 and a < 6 order by a desc; a b c 5.001 10 10 5.0001 10 10 5 10 10 5 6 6 5 5 5 5 4 4 5 0.1 10 4.99999 1 10 4.999 10 10 insert into foo values (4.1,0.01,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (5.9,10,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (6,10,10); insert into foo values (4,10,10); commit; begin; select * from foo where a >= 4 and a < 6 order by a desc; a b c 5.001 10 10 5.0001 10 10 5 10 10 5 6 6 5 5 5 5 4 4 5 0.1 10 4.99999 1 10 4.999 10 10 4 10 10 4 6 6 4 5 5 4 4 4 insert into foo values (4,0.01,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (5.9,10,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (6,1.1,10); insert into foo values (3.99,10,10); commit; begin; select * from foo where a > 4 and a <= 6 order by a desc; a b c 6 10 10 6 6 6 6 5 5 6 4 4 6 1.1 10 5.001 10 10 5.0001 10 10 5 10 10 5 6 6 5 5 5 5 4 4 5 0.1 10 4.99999 1 10 4.999 10 10 insert into foo values (4.0001,0.01,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (6,1110,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (6.001,1.1,10); insert into foo values (4,1110,10); commit; begin; select * from foo where a >= 4 and a <= 6 order by a desc; a b c 6 10 10 6 6 6 6 5 5 6 4 4 6 1.1 10 5.001 10 10 5.0001 10 10 5 10 10 5 6 6 5 5 5 5 4 4 5 0.1 10 4.99999 1 10 4.999 10 10 4 1110 10 4 10 10 4 6 6 4 5 5 4 4 4 insert into foo values (4,0.001,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (6,11110,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (6.0001,1.1,10); insert into foo values (3.99,10110,10); commit; begin; select count(*) from foo; count(*) 23 insert into foo values (0,0.001,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (9999999,11110,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction commit; begin; select * from foo order by a desc; a b c 6.001 1.1 10 6.0001 1.1 10 6 10 10 6 6 6 6 5 5 6 4 4 6 1.1 10 5.001 10 10 5.0001 10 10 5 10 10 5 6 6 5 5 5 5 4 4 5 0.1 10 4.99999 1 10 4.999 10 10 4 1110 10 4 10 10 4 6 6 4 5 5 4 4 4 3.99 10110 10 3.99 10 10 insert into foo values (0,0.001,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (9999999,11110,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction commit; alter table foo drop primary key; begin; select * from foo; a b c 3.99 10 10 3.99 10110 10 4 4 4 4 5 5 4 6 6 4 10 10 4 1110 10 4.999 10 10 4.99999 1 10 5 0.1 10 5 4 4 5 5 5 5 6 6 5 10 10 5.0001 10 10 5.001 10 10 6 1.1 10 6 4 4 6 5 5 6 6 6 6 10 10 6.0001 1.1 10 6.001 1.1 10 insert into foo values (0,0.001,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert into foo values (9999999,11110,10); ERROR HY000: Lock wait timeout exceeded; try restarting transaction commit; DROP TABLE foo;