EVOLUTION-MANAGER
Edit File: locks-blocking-row-locks.result
connect conn1, localhost, root; set session transaction isolation level serializable; connect conn2, localhost, root; set session transaction isolation level serializable; connection conn1; drop table if exists t; create table t (a int primary key, b int) engine=tokudb; insert ignore t values(1, 1); insert ignore t values(2, 4); insert ignore t values(3, 9); insert ignore t values(4, 16); insert ignore t values(5, 25); insert ignore t values(6, 36); connection conn1; set session tokudb_lock_timeout=0; connection conn2; set session tokudb_lock_timeout=0; connection conn1; begin; select * from t where a=1 for update; a b 1 1 connection conn2; select * from t where a=1 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2 for update; a b 2 4 select * from t where a=3 for update; a b 3 9 select * from t where a=4 for update; a b 4 16 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 4 3 9 4 16 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a=1 for update; a b 1 1 begin; select * from t; a b 1 1 2 4 3 9 4 16 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a=1 for update; a b 1 1 connection conn2; update t set b=b where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a=2; update t set b=b where a=3; update t set b=b where a=4; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 4 3 9 4 16 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a=1; begin; select * from t; a b 1 1 2 4 3 9 4 16 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a=1 for update; a b 1 1 connection conn2; insert ignore t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert ignore t values(2, 100); insert ignore t values(3, 100); insert ignore t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 4 3 9 4 16 5 25 6 36 commit; connection conn1; commit; connection conn2; insert ignore t values(1, 100); begin; select * from t; a b 1 1 2 4 3 9 4 16 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a=1 for update; a b 1 1 connection conn2; replace t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction replace t values(2, 100); replace t values(3, 100); replace t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; replace t values(1, 100); begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a=1 for update; a b 1 100 connection conn2; select * from t where a<=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=0 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>2 for update; a b 3 100 4 100 5 25 6 36 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a<=2 for update; a b 1 100 2 100 select * from t where a>=0 for update; a b 1 100 2 100 3 100 4 100 5 25 6 36 begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a=1 for update; a b 1 100 connection conn2; update t set b=b where a<=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=0; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>2; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a<=2; update t set b=b where a>=0; begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a=1; connection conn2; select * from t where a=1 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2 for update; a b 2 100 select * from t where a=3 for update; a b 3 100 select * from t where a=4 for update; a b 4 100 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a=1 for update; a b 1 100 begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a=1; connection conn2; update t set b=b where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a=2; update t set b=b where a=3; update t set b=b where a=4; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a=1; begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a=1; connection conn2; insert ignore t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert ignore t values(2, 100); insert ignore t values(3, 100); insert ignore t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; insert ignore t values(1, 100); begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a=1; connection conn2; replace t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction replace t values(2, 100); replace t values(3, 100); replace t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; replace t values(1, 100); begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a=1; connection conn2; select * from t where a<=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=0 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>2 for update; a b 3 100 4 100 5 25 6 36 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a<=2 for update; a b 1 100 2 100 select * from t where a>=0 for update; a b 1 100 2 100 3 100 4 100 5 25 6 36 begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a=1; connection conn2; update t set b=b where a<=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=0; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>2; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a<=2; update t set b=b where a>=0; begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; insert ignore t values(1, 100); connection conn2; select * from t where a=1 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2 for update; a b 2 100 select * from t where a=3 for update; a b 3 100 select * from t where a=4 for update; a b 4 100 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a=1 for update; a b 1 100 begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; insert ignore t values(1, 100); connection conn2; update t set b=b where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a=2; update t set b=b where a=3; update t set b=b where a=4; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a=1; begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; insert ignore t values(1, 100); connection conn2; insert ignore t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert ignore t values(2, 100); insert ignore t values(3, 100); insert ignore t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; insert ignore t values(1, 100); begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; insert ignore t values(1, 100); connection conn2; replace t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction replace t values(2, 100); replace t values(3, 100); replace t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; replace t values(1, 100); begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; insert ignore t values(1, 100); connection conn2; select * from t where a<=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=0 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>2 for update; a b 3 100 4 100 5 25 6 36 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a<=2 for update; a b 1 100 2 100 select * from t where a>=0 for update; a b 1 100 2 100 3 100 4 100 5 25 6 36 begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; insert ignore t values(1, 100); connection conn2; update t set b=b where a<=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=0; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>2; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a<=2; update t set b=b where a>=0; begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; replace t values(1, 100); connection conn2; select * from t where a=1 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2 for update; a b 2 100 select * from t where a=3 for update; a b 3 100 select * from t where a=4 for update; a b 4 100 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a=1 for update; a b 1 100 begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; replace t values(1, 100); connection conn2; update t set b=b where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a=2; update t set b=b where a=3; update t set b=b where a=4; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a=1; begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; replace t values(1, 100); connection conn2; insert ignore t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert ignore t values(2, 100); insert ignore t values(3, 100); insert ignore t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; insert ignore t values(1, 100); begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; replace t values(1, 100); connection conn2; replace t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction replace t values(2, 100); replace t values(3, 100); replace t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; replace t values(1, 100); begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; replace t values(1, 100); connection conn2; select * from t where a<=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=0 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>2 for update; a b 3 100 4 100 5 25 6 36 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a<=2 for update; a b 1 100 2 100 select * from t where a>=0 for update; a b 1 100 2 100 3 100 4 100 5 25 6 36 begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; replace t values(1, 100); connection conn2; update t set b=b where a<=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=0; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>2; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a<=2; update t set b=b where a>=0; begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a>=2 and a<=4 for update; a b 2 100 3 100 4 100 connection conn2; select * from t where a>=0 and a<=3 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=3 and a<=6 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a<=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=5 for update; a b 5 25 6 36 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=3 and a<=5; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=5; a b 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a>=0 and a<=3 for update; a b 1 100 2 100 3 100 select * from t where a>=3 and a<=6 for update; a b 3 100 4 100 5 25 6 36 select * from t where a<=2 for update; a b 1 100 2 100 begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a>=2 and a<=4 for update; a b 2 100 3 100 4 100 connection conn2; update t set b=b where a>=0 and a<=3; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=3 and a<=6; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a<=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=5; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=3 and a<=5; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=5; a b 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a>=0 and a<=3; update t set b=b where a>=3 and a<=6; update t set b=b where a<=2; begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a>=2 and a<=4; connection conn2; select * from t where a>=0 and a<=3 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=3 and a<=6 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a<=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=5 for update; a b 5 25 6 36 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=3 and a<=5; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=5; a b 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a>=0 and a<=3 for update; a b 1 100 2 100 3 100 select * from t where a>=3 and a<=6 for update; a b 3 100 4 100 5 25 6 36 select * from t where a<=2 for update; a b 1 100 2 100 begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a>=2 and a<=4; connection conn2; update t set b=b where a>=0 and a<=3; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=3 and a<=6; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a<=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=5; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=3 and a<=5; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=5; a b 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a>=0 and a<=3; update t set b=b where a>=3 and a<=6; update t set b=b where a<=2; begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; set session tokudb_lock_timeout=500; connection conn2; set session tokudb_lock_timeout=500; connection conn1; begin; select * from t where a=1 for update; a b 1 100 connection conn2; select * from t where a=1 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2 for update; a b 2 100 select * from t where a=3 for update; a b 3 100 select * from t where a=4 for update; a b 4 100 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a=1 for update; a b 1 100 begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a=1 for update; a b 1 100 connection conn2; select * from t where a=1 for update; connection conn1; commit; connection conn2; a b 1 100 connection conn1; begin; select * from t where a=1 for update; a b 1 100 connection conn2; update t set b=b where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a=2; update t set b=b where a=3; update t set b=b where a=4; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a=1; begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a=1 for update; a b 1 100 connection conn2; update t set b=b where a=1; connection conn1; commit; connection conn2; connection conn1; begin; select * from t where a=1 for update; a b 1 100 connection conn2; insert ignore t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert ignore t values(2, 100); insert ignore t values(3, 100); insert ignore t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; insert ignore t values(1, 100); begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a=1 for update; a b 1 100 connection conn2; insert ignore t values(1, 175); connection conn1; commit; connection conn2; connection conn1; begin; select * from t where a=1 for update; a b 1 100 connection conn2; replace t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction replace t values(2, 100); replace t values(3, 100); replace t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; replace t values(1, 100); begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a=1 for update; a b 1 100 connection conn2; replace t values(1, 175); connection conn1; commit; connection conn2; connection conn1; begin; select * from t where a=1 for update; a b 1 175 connection conn2; select * from t where a<=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=0 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>2 for update; a b 3 100 4 100 5 25 6 36 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a<=2 for update; a b 1 175 2 100 select * from t where a>=0 for update; a b 1 175 2 100 3 100 4 100 5 25 6 36 begin; select * from t; a b 1 175 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a=1 for update; a b 1 175 connection conn2; select * from t where a<=2 for update; connection conn1; commit; connection conn2; a b 1 175 2 100 connection conn1; begin; select * from t where a=1 for update; a b 1 175 connection conn2; update t set b=b where a<=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=0; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>2; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a<=2; update t set b=b where a>=0; begin; select * from t; a b 1 175 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a=1 for update; a b 1 175 connection conn2; update t set b=b where a<=2; connection conn1; commit; connection conn2; connection conn1; begin; update t set b=b where a=1; connection conn2; select * from t where a=1 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2 for update; a b 2 100 select * from t where a=3 for update; a b 3 100 select * from t where a=4 for update; a b 4 100 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a=1 for update; a b 1 175 begin; select * from t; a b 1 175 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a=1; connection conn2; select * from t where a=1 for update; connection conn1; commit; connection conn2; a b 1 175 connection conn1; begin; update t set b=b where a=1; connection conn2; update t set b=b where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a=2; update t set b=b where a=3; update t set b=b where a=4; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a=1; begin; select * from t; a b 1 175 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a=1; connection conn2; update t set b=b where a=1; connection conn1; commit; connection conn2; connection conn1; begin; update t set b=b where a=1; connection conn2; insert ignore t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert ignore t values(2, 100); insert ignore t values(3, 100); insert ignore t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; insert ignore t values(1, 100); begin; select * from t; a b 1 175 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a=1; connection conn2; insert ignore t values(1, 175); connection conn1; commit; connection conn2; connection conn1; begin; update t set b=b where a=1; connection conn2; replace t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction replace t values(2, 100); replace t values(3, 100); replace t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; replace t values(1, 100); begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a=1; connection conn2; replace t values(1, 175); connection conn1; commit; connection conn2; connection conn1; begin; update t set b=b where a=1; connection conn2; select * from t where a<=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=0 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>2 for update; a b 3 100 4 100 5 25 6 36 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a<=2 for update; a b 1 175 2 100 select * from t where a>=0 for update; a b 1 175 2 100 3 100 4 100 5 25 6 36 begin; select * from t; a b 1 175 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a=1; connection conn2; select * from t where a<=2 for update; connection conn1; commit; connection conn2; a b 1 175 2 100 connection conn1; begin; update t set b=b where a=1; connection conn2; update t set b=b where a<=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=0; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>2; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a<=2; update t set b=b where a>=0; begin; select * from t; a b 1 175 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a=1; connection conn2; update t set b=b where a<=2; connection conn1; commit; connection conn2; connection conn1; begin; insert ignore t values(1, 100); connection conn2; select * from t where a=1 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2 for update; a b 2 100 select * from t where a=3 for update; a b 3 100 select * from t where a=4 for update; a b 4 100 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a=1 for update; a b 1 175 begin; select * from t; a b 1 175 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; insert ignore t values(1, 150); connection conn2; select * from t where a=1 for update; connection conn1; commit; connection conn2; a b 1 175 connection conn1; begin; insert ignore t values(1, 100); connection conn2; update t set b=b where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a=2; update t set b=b where a=3; update t set b=b where a=4; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a=1; begin; select * from t; a b 1 175 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; insert ignore t values(1, 150); connection conn2; update t set b=b where a=1; connection conn1; commit; connection conn2; connection conn1; begin; insert ignore t values(1, 100); connection conn2; insert ignore t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert ignore t values(2, 100); insert ignore t values(3, 100); insert ignore t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; insert ignore t values(1, 100); begin; select * from t; a b 1 175 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; insert ignore t values(1, 150); connection conn2; insert ignore t values(1, 175); connection conn1; commit; connection conn2; connection conn1; begin; insert ignore t values(1, 100); connection conn2; replace t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction replace t values(2, 100); replace t values(3, 100); replace t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; replace t values(1, 100); begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; insert ignore t values(1, 150); connection conn2; replace t values(1, 175); connection conn1; commit; connection conn2; connection conn1; begin; insert ignore t values(1, 100); connection conn2; select * from t where a<=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=0 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>2 for update; a b 3 100 4 100 5 25 6 36 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a<=2 for update; a b 1 175 2 100 select * from t where a>=0 for update; a b 1 175 2 100 3 100 4 100 5 25 6 36 begin; select * from t; a b 1 175 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; insert ignore t values(1, 150); connection conn2; select * from t where a<=2 for update; connection conn1; commit; connection conn2; a b 1 175 2 100 connection conn1; begin; insert ignore t values(1, 100); connection conn2; update t set b=b where a<=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=0; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>2; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a<=2; update t set b=b where a>=0; begin; select * from t; a b 1 175 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; insert ignore t values(1, 150); connection conn2; update t set b=b where a<=2; connection conn1; commit; connection conn2; connection conn1; begin; replace t values(1, 100); connection conn2; select * from t where a=1 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2 for update; a b 2 100 select * from t where a=3 for update; a b 3 100 select * from t where a=4 for update; a b 4 100 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a=1 for update; a b 1 100 begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; replace t values(1, 150); connection conn2; select * from t where a=1 for update; connection conn1; commit; connection conn2; a b 1 150 connection conn1; begin; replace t values(1, 100); connection conn2; update t set b=b where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a=2; update t set b=b where a=3; update t set b=b where a=4; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a=1; begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; replace t values(1, 150); connection conn2; update t set b=b where a=1; connection conn1; commit; connection conn2; connection conn1; begin; replace t values(1, 100); connection conn2; insert ignore t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction insert ignore t values(2, 100); insert ignore t values(3, 100); insert ignore t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; insert ignore t values(1, 100); begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; replace t values(1, 150); connection conn2; insert ignore t values(1, 175); connection conn1; commit; connection conn2; connection conn1; begin; replace t values(1, 100); connection conn2; replace t values(1, 100); ERROR HY000: Lock wait timeout exceeded; try restarting transaction replace t values(2, 100); replace t values(3, 100); replace t values(4, 100); begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; replace t values(1, 100); begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; replace t values(1, 150); connection conn2; replace t values(1, 175); connection conn1; commit; connection conn2; connection conn1; begin; replace t values(1, 100); connection conn2; select * from t where a<=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=0 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>2 for update; a b 3 100 4 100 5 25 6 36 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a<=2 for update; a b 1 100 2 100 select * from t where a>=0 for update; a b 1 100 2 100 3 100 4 100 5 25 6 36 begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; replace t values(1, 150); connection conn2; select * from t where a<=2 for update; connection conn1; commit; connection conn2; a b 1 150 2 100 connection conn1; begin; replace t values(1, 100); connection conn2; update t set b=b where a<=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=0; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>2; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=2; a b 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a<=2; update t set b=b where a>=0; begin; select * from t; a b 1 100 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; replace t values(1, 150); connection conn2; update t set b=b where a<=2; connection conn1; commit; connection conn2; connection conn1; begin; select * from t where a>=2 and a<=4 for update; a b 2 100 3 100 4 100 connection conn2; select * from t where a>=0 and a<=3 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=3 and a<=6 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a<=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=5 for update; a b 5 25 6 36 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=3 and a<=5; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=5; a b 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a>=0 and a<=3 for update; a b 1 150 2 100 3 100 select * from t where a>=3 and a<=6 for update; a b 3 100 4 100 5 25 6 36 select * from t where a<=2 for update; a b 1 150 2 100 begin; select * from t; a b 1 150 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a>=2 and a<=4 for update; a b 2 100 3 100 4 100 connection conn2; select * from t where a>=0 and a<=3 for update; connection conn1; commit; connection conn2; a b 1 150 2 100 3 100 connection conn1; begin; select * from t where a>=2 and a<=4 for update; a b 2 100 3 100 4 100 connection conn2; update t set b=b where a>=0 and a<=3; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=3 and a<=6; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a<=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=5; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=3 and a<=5; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=5; a b 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a>=0 and a<=3; update t set b=b where a>=3 and a<=6; update t set b=b where a<=2; begin; select * from t; a b 1 150 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; select * from t where a>=2 and a<=4 for update; a b 2 100 3 100 4 100 connection conn2; update t set b=b where a>=0 and a<=3; connection conn1; commit; connection conn2; connection conn1; begin; update t set b=b where a>=2 and a<=4; connection conn2; select * from t where a>=0 and a<=3 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=3 and a<=6 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a<=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=5 for update; a b 5 25 6 36 begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=3 and a<=5; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=5; a b 5 25 6 36 commit; connection conn1; commit; connection conn2; select * from t where a>=0 and a<=3 for update; a b 1 150 2 100 3 100 select * from t where a>=3 and a<=6 for update; a b 3 100 4 100 5 25 6 36 select * from t where a<=2 for update; a b 1 150 2 100 begin; select * from t; a b 1 150 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a>=2 and a<=4; connection conn2; select * from t where a>=0 and a<=3 for update; connection conn1; commit; connection conn2; a b 1 150 2 100 3 100 connection conn1; begin; update t set b=b where a>=2 and a<=4; connection conn2; update t set b=b where a>=0 and a<=3; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=3 and a<=6; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a<=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction update t set b=b where a>=5; begin; select * from t; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a=2; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=3 and a<=5; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t where a>=5; a b 5 25 6 36 commit; connection conn1; commit; connection conn2; update t set b=b where a>=0 and a<=3; update t set b=b where a>=3 and a<=6; update t set b=b where a<=2; begin; select * from t; a b 1 150 2 100 3 100 4 100 5 25 6 36 commit; connection conn1; connection conn1; begin; update t set b=b where a>=2 and a<=4; connection conn2; update t set b=b where a>=0 and a<=3; connection conn1; commit; connection conn2; drop table t;