EVOLUTION-MANAGER
Edit File: i_s_tokudb_locks_released.test
if (`select @@tokudb_version < "5.6.27"`) { --skip Race condition in the test in TokuDB below 5.6.27 } # verify that information_schema.tokudb_locks gets populated with locks for 2 clients source include/have_tokudb.inc; set default_storage_engine='tokudb'; set tokudb_prelock_empty=false; disable_warnings; drop table if exists t; enable_warnings; create table t (id int primary key); set autocommit=0; let $default_id=`select connection_id()`; # should be empty select * from information_schema.tokudb_locks; connect (conn_a,localhost,root,,); set autocommit=0; set tokudb_prelock_empty=OFF; # disable bulk loader insert into t values (1); connect (conn_b,localhost,root,,); set autocommit=0; set tokudb_prelock_empty=OFF; set tokudb_lock_timeout=600000; # set lock wait timeout to 10 minutes send insert into t values (1); # should find the presence of a lock on 2nd transaction connection default; let $wait_condition= select count(*)=1 from information_schema.processlist where info='insert into t values (1)' and state='update'; source include/wait_condition.inc; real_sleep 1; # delay a little to shorten the update -> write row -> lock wait race replace_column 1 TRX_ID 2 MYSQL_ID; eval select * from information_schema.tokudb_locks; connection conn_a; commit; # verify that the lock on the 1st transaction is released and replaced by the lock for the 2nd transaction let $wait_condition= select count(*)=1 from information_schema.tokudb_locks where locks_dname='./test/t-main'; source include/wait_condition.inc; replace_column 1 TRX_ID 2 MYSQL_ID; select * from information_schema.tokudb_locks; connection conn_b; --error 1062 reap; commit; disconnect conn_b; connection default; # verify that the lockwait on the 2nd transaction has been released # should be be empty select * from information_schema.tokudb_locks; drop table t;