Commit 0a8fa2e7 authored by Rich Prohaska's avatar Rich Prohaska

#90 tokudb info schema tests

parent 84b017eb
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_left locks_right
insert into t values (1);
insert into t values (3);
insert into t values (5);
set autocommit=0;
insert into t values (2);
insert into t values (4);
insert into t values (6);
select * from information_schema.tokudb_locks order by locks_trx_id;
locks_trx_id locks_mysql_thread_id locks_dname locks_left locks_right
TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000
TRX_ID MYSQL_ID ./test/t-main 0003000000 0003000000
TRX_ID MYSQL_ID ./test/t-main 0005000000 0005000000
TRX_ID MYSQL_ID ./test/t-main 0002000000 0002000000
TRX_ID MYSQL_ID ./test/t-main 0004000000 0004000000
TRX_ID MYSQL_ID ./test/t-main 0006000000 0006000000
commit;
commit;
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_left locks_right
commit;
drop table t;
set default_storage_engine='tokudb';
set tokudb_prelock_empty=false;
drop table if exists t;
select * from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
set autocommit=0;
create table t (id int primary key);
insert into t values (1);
select * from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
TXN_ID_DEFAULT CLIENT_ID_DEFAULT
commit;
select * from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
set autocommit=0;
insert into t values (2);
select * from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
TXN_ID_A CLIENT_ID_A
commit;
select * from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
drop table t;
# 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;
insert into t values (1);
insert into t values (3);
insert into t values (5);
connect (conn_a,localhost,root,,);
set autocommit=0;
let $a_id=`select connection_id()`;
insert into t values (2);
insert into t values (4);
insert into t values (6);
# should find 3 locks for 2 transactions
connection default;
replace_column 1 TRX_ID 2 MYSQL_ID;
eval select * from information_schema.tokudb_locks order by locks_trx_id;
connection conn_a;
commit;
connection default;
commit;
# should be empty
select * from information_schema.tokudb_locks;
commit;
disconnect conn_a;
drop table t;
\ No newline at end of file
# verify that information_schema.tokudb_trx gets populated with transactions
source include/have_tokudb.inc;
set default_storage_engine='tokudb';
set tokudb_prelock_empty=false;
disable_warnings;
drop table if exists t;
enable_warnings;
# should be empty
select * from information_schema.tokudb_trx;
# should have my txn
let $default_id=`select connection_id()`;
set autocommit=0;
create table t (id int primary key);
insert into t values (1);
replace_column 1 TXN_ID_DEFAULT 2 CLIENT_ID_DEFAULT;
eval select * from information_schema.tokudb_trx;
# should be empty
commit;
select * from information_schema.tokudb_trx;
connect(conn_a,localhost,root,,);
let a_id=`select connection_id()`;
set autocommit=0;
insert into t values (2);
connection default;
replace_column 1 TXN_ID_A 2 CLIENT_ID_A;
eval select * from information_schema.tokudb_trx;
connection conn_a;
commit;
connection default;
# should be empty
select * from information_schema.tokudb_trx;
disconnect conn_a;
drop table t;
\ No newline at end of file
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