diff options
author | Joel Epstein <joel@tokutek.com> | 2013-10-03 16:06:45 -0400 |
---|---|---|
committer | Joel Epstein <joel@tokutek.com> | 2013-10-03 16:06:45 -0400 |
commit | 4bfee013339f0866ff9902493a5120c930822174 (patch) | |
tree | 63487f69031a4f40cec9c9b8e3747a4d9bcb5f34 | |
parent | 227725479319ef02bcc96c2a534c1422d73a748c (diff) | |
download | mariadb-git-4bfee013339f0866ff9902493a5120c930822174.tar.gz |
Checking in mtr test & result files for lock visualization tree
4 files changed, 178 insertions, 0 deletions
diff --git a/mysql-test/suite/tokudb/r/i_s_tokudb_lock_waits_released.result b/mysql-test/suite/tokudb/r/i_s_tokudb_lock_waits_released.result new file mode 100644 index 00000000000..a6b0fbea38e --- /dev/null +++ b/mysql-test/suite/tokudb/r/i_s_tokudb_lock_waits_released.result @@ -0,0 +1,35 @@ +set default_storage_engine='tokudb'; +set tokudb_prelock_empty=false; +drop table if exists t; +create table t (id int primary key); +set autocommit=0; +select * from information_schema.tokudb_locks; +locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right +select * from information_schema.tokudb_lock_waits; +requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time +select * from information_schema.tokudb_trx; +trx_id trx_mysql_thread_id +set autocommit=0; +insert into t values (1); +set autocommit=0; +insert into t values (1); +select * from information_schema.tokudb_locks; +locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right +TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 +select * from information_schema.tokudb_lock_waits; +requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time +REQUEST_TRX_ID BLOCK_TRX_ID ./test/t-main 0001000000 0001000000 LOCK_WAITS_START_TIME +select * from information_schema.tokudb_trx; +trx_id trx_mysql_thread_id +TRX_ID MYSQL_ID +TRX_ID MYSQL_ID +commit; +select * from information_schema.tokudb_locks; +locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right +TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 +TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +commit; +select * from information_schema.tokudb_locks; +locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right +drop table t; diff --git a/mysql-test/suite/tokudb/r/i_s_tokudb_locks_released.result b/mysql-test/suite/tokudb/r/i_s_tokudb_locks_released.result new file mode 100644 index 00000000000..21a6b5d308c --- /dev/null +++ b/mysql-test/suite/tokudb/r/i_s_tokudb_locks_released.result @@ -0,0 +1,24 @@ +set default_storage_engine='tokudb'; +set tokudb_prelock_empty=false; +drop table if exists t; +create table t (id int primary key); +set autocommit=0; +select * from information_schema.tokudb_locks; +locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right +set autocommit=0; +insert into t values (1); +set autocommit=0; +insert into t values (1); +select * from information_schema.tokudb_locks; +locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right +TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 +commit; +select * from information_schema.tokudb_locks; +locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right +TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 +TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +commit; +select * from information_schema.tokudb_locks; +locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right +drop table t; diff --git a/mysql-test/suite/tokudb/t/i_s_tokudb_lock_waits_released.test b/mysql-test/suite/tokudb/t/i_s_tokudb_lock_waits_released.test new file mode 100644 index 00000000000..017fe22d4c4 --- /dev/null +++ b/mysql-test/suite/tokudb/t/i_s_tokudb_lock_waits_released.test @@ -0,0 +1,65 @@ +# verify that information_schema.tokudb_locks gets populated with locks, information_schema.tokudb_lock_waits gets +# populated with 1 lock_wait and all transactions are present in information_schema.tokudb_trx 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; +select * from information_schema.tokudb_lock_waits; +select * from information_schema.tokudb_trx; + +connect (conn_a,localhost,root,,); +set autocommit=0; +let $a_id=`select connection_id()`; + +insert into t values (1); + +connect (conn_b,localhost,root,,); +set autocommit=0; +let $b_id=`select connection_id()`; + +send insert into t values (1); + + +# should find the presence of a lock on 1st transaction +connection default; +replace_column 1 TRX_ID 2 MYSQL_ID; +eval select * from information_schema.tokudb_locks; + +# should find the presence of a lock_wait on the 2nd transaction +replace_column 1 REQUEST_TRX_ID 2 BLOCK_TRX_ID 6 LOCK_WAITS_START_TIME; +eval select * from information_schema.tokudb_lock_waits; + +# should find the presence of two transactions +replace_column 1 TRX_ID 2 MYSQL_ID; +eval select * from information_schema.tokudb_trx; + +connection conn_a; +commit; +# verify that the lock on the 1st transaction is released and replaced by the lock for the 2nd transaction +replace_column 1 TRX_ID 2 MYSQL_ID; +eval select * from information_schema.tokudb_locks; + +connection conn_b; +--error 1062 +reap; +commit; + +disconnect conn_b; + +connection default; +# verify that the lock on the 2nd transaction has been released +# should be be empty +select * from information_schema.tokudb_locks; + + +drop table t; diff --git a/mysql-test/suite/tokudb/t/i_s_tokudb_locks_released.test b/mysql-test/suite/tokudb/t/i_s_tokudb_locks_released.test new file mode 100644 index 00000000000..dbfa746a7d9 --- /dev/null +++ b/mysql-test/suite/tokudb/t/i_s_tokudb_locks_released.test @@ -0,0 +1,54 @@ +# 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; +let $a_id=`select connection_id()`; + +insert into t values (1); + +connect (conn_b,localhost,root,,); +set autocommit=0; +let $b_id=`select connection_id()`; + +send insert into t values (1); + + +# should find the presence of a lock on 2nd transaction +connection default; +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 +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; |