diff options
Diffstat (limited to 'storage/tokudb/mysql-test')
41 files changed, 653 insertions, 73 deletions
diff --git a/storage/tokudb/mysql-test/rpl/disabled.def b/storage/tokudb/mysql-test/rpl/disabled.def index efa4be9e16c..4c1a9a3e785 100644 --- a/storage/tokudb/mysql-test/rpl/disabled.def +++ b/storage/tokudb/mysql-test/rpl/disabled.def @@ -10,3 +10,6 @@ rpl_tokudb_write_pk: unreliable, uses timestamp differences rpl_tokudb_write_pk_uc1: unreliable, uses timestamp differences rpl_tokudb_write_unique: unreliable, uses timestamp differences rpl_tokudb_write_unique_uc1: unreliable, uses timestamp differences +rpl_tokudb_read_only_ff: unreliable, uses timestamp differences +rpl_tokudb_read_only_tf: unreliable, uses timestamp differences +rpl_tokudb_read_only_tt: unreliable, uses timestamp differences diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ff.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ff.result new file mode 100644 index 00000000000..6db2036d933 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ff.result @@ -0,0 +1,14 @@ +include/master-slave.inc +[connection master] +drop table if exists t; +create table t (a bigint not null, primary key(a)) engine=tokudb; +select unix_timestamp() into @tstart; +insert into t values (1); +insert into t values (2),(3); +insert into t values (4); +select unix_timestamp()-@tstart <= 10; +unix_timestamp()-@tstart <= 10 +1 +include/diff_tables.inc [master:test.t, slave:test.t] +drop table if exists t; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result new file mode 100644 index 00000000000..3bcd3e8ccdd --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result @@ -0,0 +1,14 @@ +include/master-slave.inc +[connection master] +drop table if exists t; +create table t (a bigint not null, primary key(a)) engine=tokudb; +select unix_timestamp() into @tstart; +insert into t values (1); +insert into t values (2),(3); +insert into t values (4); +select unix_timestamp()-@tstart <= 10; +unix_timestamp()-@tstart <= 10 +0 +include/diff_tables.inc [master:test.t, slave:test.t] +drop table if exists t; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tf.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tf.result new file mode 100644 index 00000000000..6db2036d933 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tf.result @@ -0,0 +1,14 @@ +include/master-slave.inc +[connection master] +drop table if exists t; +create table t (a bigint not null, primary key(a)) engine=tokudb; +select unix_timestamp() into @tstart; +insert into t values (1); +insert into t values (2),(3); +insert into t values (4); +select unix_timestamp()-@tstart <= 10; +unix_timestamp()-@tstart <= 10 +1 +include/diff_tables.inc [master:test.t, slave:test.t] +drop table if exists t; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tt.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tt.result new file mode 100644 index 00000000000..6db2036d933 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tt.result @@ -0,0 +1,14 @@ +include/master-slave.inc +[connection master] +drop table if exists t; +create table t (a bigint not null, primary key(a)) engine=tokudb; +select unix_timestamp() into @tstart; +insert into t values (1); +insert into t values (2),(3); +insert into t values (4); +select unix_timestamp()-@tstart <= 10; +unix_timestamp()-@tstart <= 10 +1 +include/diff_tables.inc [master:test.t, slave:test.t] +drop table if exists t; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff-slave.opt new file mode 100644 index 00000000000..b9eb687d8d5 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff-slave.opt @@ -0,0 +1 @@ +--read-only=OFF --tokudb-rpl-check-readonly=OFF --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff.test new file mode 100644 index 00000000000..c77e4b49605 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff.test @@ -0,0 +1,53 @@ +# test replicated write rows log events on a table with a primary key. +# the slave is read only with tokudb unique checks disabled. + +source include/have_tokudb.inc; +let $engine=tokudb; +source include/have_binlog_format_row.inc; +source include/master-slave.inc; + +# initialize +connection master; +disable_warnings; +drop table if exists t; +enable_warnings; + +connection slave; +# show variables like 'read_only'; +# show variables like 'tokudb_rpl_unique_checks%'; + +# insert some rows +connection master; +# select @@binlog_format; +# select @@autocommit; +eval create table t (a bigint not null, primary key(a)) engine=$engine; +# show create table t; +select unix_timestamp() into @tstart; +insert into t values (1); +insert into t values (2),(3); +insert into t values (4); + +sync_slave_with_master; +# source include/sync_slave_sql_with_master.inc; + +connection master; +select unix_timestamp()-@tstart <= 10; + +connection slave; +# insert into t values (5); # test read-only +# show create table t; + +# diff tables +connection master; +--let $diff_tables= master:test.t, slave:test.t +source include/diff_tables.inc; + +# cleanup +connection master; +drop table if exists t; + +sync_slave_with_master; +# source include/sync_slave_sql_with_master.inc; + +source include/rpl_end.inc; + diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft-slave.opt new file mode 100644 index 00000000000..8283875e8a7 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft-slave.opt @@ -0,0 +1 @@ +--read-only=OFF --tokudb-rpl-check-readonly=ON --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft.test new file mode 100644 index 00000000000..c77e4b49605 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft.test @@ -0,0 +1,53 @@ +# test replicated write rows log events on a table with a primary key. +# the slave is read only with tokudb unique checks disabled. + +source include/have_tokudb.inc; +let $engine=tokudb; +source include/have_binlog_format_row.inc; +source include/master-slave.inc; + +# initialize +connection master; +disable_warnings; +drop table if exists t; +enable_warnings; + +connection slave; +# show variables like 'read_only'; +# show variables like 'tokudb_rpl_unique_checks%'; + +# insert some rows +connection master; +# select @@binlog_format; +# select @@autocommit; +eval create table t (a bigint not null, primary key(a)) engine=$engine; +# show create table t; +select unix_timestamp() into @tstart; +insert into t values (1); +insert into t values (2),(3); +insert into t values (4); + +sync_slave_with_master; +# source include/sync_slave_sql_with_master.inc; + +connection master; +select unix_timestamp()-@tstart <= 10; + +connection slave; +# insert into t values (5); # test read-only +# show create table t; + +# diff tables +connection master; +--let $diff_tables= master:test.t, slave:test.t +source include/diff_tables.inc; + +# cleanup +connection master; +drop table if exists t; + +sync_slave_with_master; +# source include/sync_slave_sql_with_master.inc; + +source include/rpl_end.inc; + diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf-slave.opt new file mode 100644 index 00000000000..21e57d27c17 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf-slave.opt @@ -0,0 +1 @@ +--read-only=ON --tokudb-rpl-check-readonly=OFF --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf.test new file mode 100644 index 00000000000..c77e4b49605 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf.test @@ -0,0 +1,53 @@ +# test replicated write rows log events on a table with a primary key. +# the slave is read only with tokudb unique checks disabled. + +source include/have_tokudb.inc; +let $engine=tokudb; +source include/have_binlog_format_row.inc; +source include/master-slave.inc; + +# initialize +connection master; +disable_warnings; +drop table if exists t; +enable_warnings; + +connection slave; +# show variables like 'read_only'; +# show variables like 'tokudb_rpl_unique_checks%'; + +# insert some rows +connection master; +# select @@binlog_format; +# select @@autocommit; +eval create table t (a bigint not null, primary key(a)) engine=$engine; +# show create table t; +select unix_timestamp() into @tstart; +insert into t values (1); +insert into t values (2),(3); +insert into t values (4); + +sync_slave_with_master; +# source include/sync_slave_sql_with_master.inc; + +connection master; +select unix_timestamp()-@tstart <= 10; + +connection slave; +# insert into t values (5); # test read-only +# show create table t; + +# diff tables +connection master; +--let $diff_tables= master:test.t, slave:test.t +source include/diff_tables.inc; + +# cleanup +connection master; +drop table if exists t; + +sync_slave_with_master; +# source include/sync_slave_sql_with_master.inc; + +source include/rpl_end.inc; + diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt-slave.opt new file mode 100644 index 00000000000..fd77ee0da9c --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt-slave.opt @@ -0,0 +1 @@ +--read-only=ON --tokudb-rpl-check-readonly=ON --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt.test new file mode 100644 index 00000000000..c77e4b49605 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt.test @@ -0,0 +1,53 @@ +# test replicated write rows log events on a table with a primary key. +# the slave is read only with tokudb unique checks disabled. + +source include/have_tokudb.inc; +let $engine=tokudb; +source include/have_binlog_format_row.inc; +source include/master-slave.inc; + +# initialize +connection master; +disable_warnings; +drop table if exists t; +enable_warnings; + +connection slave; +# show variables like 'read_only'; +# show variables like 'tokudb_rpl_unique_checks%'; + +# insert some rows +connection master; +# select @@binlog_format; +# select @@autocommit; +eval create table t (a bigint not null, primary key(a)) engine=$engine; +# show create table t; +select unix_timestamp() into @tstart; +insert into t values (1); +insert into t values (2),(3); +insert into t values (4); + +sync_slave_with_master; +# source include/sync_slave_sql_with_master.inc; + +connection master; +select unix_timestamp()-@tstart <= 10; + +connection slave; +# insert into t values (5); # test read-only +# show create table t; + +# diff tables +connection master; +--let $diff_tables= master:test.t, slave:test.t +source include/diff_tables.inc; + +# cleanup +connection master; +drop table if exists t; + +sync_slave_with_master; +# source include/sync_slave_sql_with_master.inc; + +source include/rpl_end.inc; + diff --git a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_released.result b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_released.result index 018900c7b98..190581eddae 100644 --- a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_released.result +++ b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_released.result @@ -2,7 +2,7 @@ set default_storage_engine='tokudb'; set tokudb_prelock_empty=false; drop table if exists t; create table t (id int primary key); -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name @@ -19,7 +19,7 @@ TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main 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 lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name REQUEST_TRX_ID BLOCK_TRX_ID ./test/t-main 0001000000 0001000000 LOCK_WAITS_START_TIME test t main -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id TRX_ID MYSQL_ID TRX_ID MYSQL_ID @@ -31,7 +31,7 @@ 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 lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name ERROR 23000: Duplicate entry '1' for key 'PRIMARY' commit; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name @@ -48,7 +48,7 @@ TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main 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 lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name REQUEST_TRX_ID BLOCK_TRX_ID ./test/t-main 0001000000 0001000000 LOCK_WAITS_START_TIME test t main -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id TRX_ID MYSQL_ID TRX_ID MYSQL_ID @@ -59,7 +59,7 @@ TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main 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 lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name commit; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name diff --git a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result index b9fca50b507..13cdad7a438 100644 --- a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result +++ b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result @@ -2,7 +2,7 @@ set default_storage_engine='tokudb'; set tokudb_prelock_empty=false; drop table if exists t; create table t (id int primary key); -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name @@ -19,7 +19,7 @@ TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main 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 lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name REQUEST_TRX_ID BLOCK_TRX_ID ./test/t-main 0001000000 0001000000 LOCK_WAITS_START_TIME test t main -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id TRX_ID MYSQL_ID TRX_ID MYSQL_ID @@ -30,7 +30,7 @@ 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 lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name ERROR HY000: Lock wait timeout exceeded; try restarting transaction commit; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name diff --git a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result index e4c1adcca19..63e4816e16e 100644 --- a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result +++ b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result @@ -1,23 +1,23 @@ set default_storage_engine='tokudb'; set tokudb_prelock_empty=false; drop table if exists t; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id 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; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id TXN_ID_DEFAULT CLIENT_ID_DEFAULT commit; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id 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; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id TXN_ID_A CLIENT_ID_A commit; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id drop table t; diff --git a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test index c4f9ccefe5c..0f712000527 100644 --- a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test +++ b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test @@ -13,7 +13,7 @@ create table t (id int primary key); # verify that txn_a insert (1) blocks txn_b insert (1) and txn_b gets a duplicate key error # should be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; select * from information_schema.tokudb_locks; select * from information_schema.tokudb_lock_waits; @@ -43,7 +43,7 @@ select * from information_schema.tokudb_lock_waits; # should find the presence of two transactions replace_column 1 TRX_ID 2 MYSQL_ID; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; connection conn_a; commit; @@ -66,7 +66,7 @@ disconnect conn_b; # verify that the lock on the 2nd transaction has been released # should be be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; select * from information_schema.tokudb_locks; select * from information_schema.tokudb_lock_waits; @@ -96,7 +96,7 @@ select * from information_schema.tokudb_lock_waits; # should find the presence of two transactions replace_column 1 TRX_ID 2 MYSQL_ID; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; connection conn_a; commit; @@ -116,7 +116,7 @@ disconnect conn_b; # verify that the lock on the 2nd transaction has been released # should be be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; select * from information_schema.tokudb_locks; select * from information_schema.tokudb_lock_waits; diff --git a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test index 75929fa3b3d..3011443fa04 100644 --- a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test +++ b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test @@ -10,7 +10,7 @@ enable_warnings; create table t (id int primary key); # should be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; select * from information_schema.tokudb_locks; select * from information_schema.tokudb_lock_waits; @@ -40,7 +40,7 @@ select * from information_schema.tokudb_lock_waits; # should find the presence of two transactions replace_column 1 TRX_ID 2 MYSQL_ID; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; connection conn_a; sleep 5; # sleep longer than the lock timer to force a lock timeout on txn_b @@ -61,7 +61,7 @@ disconnect conn_a; disconnect conn_b; # should be be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; select * from information_schema.tokudb_locks; select * from information_schema.tokudb_lock_waits; diff --git a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_trx.test b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_trx.test index b1d5c7e5009..d3c2636ba54 100644 --- a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_trx.test +++ b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_trx.test @@ -8,7 +8,7 @@ drop table if exists t; enable_warnings; # should be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; # should have my txn let $default_id=`select connection_id()`; @@ -16,11 +16,11 @@ 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; +eval select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; # should be empty commit; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; connect(conn_a,localhost,root,,); let a_id=`select connection_id()`; @@ -29,13 +29,13 @@ insert into t values (2); connection default; replace_column 1 TXN_ID_A 2 CLIENT_ID_A; -eval select * from information_schema.tokudb_trx; +eval select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; connection conn_a; commit; connection default; # should be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; disconnect conn_a; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/5733_tokudb.result b/storage/tokudb/mysql-test/tokudb_bugs/r/5733_tokudb.result index 07e8b37c263..a05587cb0a6 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/5733_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/5733_tokudb.result @@ -10005,7 +10005,7 @@ insert into t values (9999,0); commit; explain select id from t where id>0 limit 10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t index_or_range PRIMARY PRIMARY 8 NULL # Using where; Using index_or_range +1 SIMPLE t range_or_index PRIMARY PRIMARY 8 NULL # Using where; Using index explain select * from t where id>0 limit 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db788-optimize-index-name.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db788-optimize-index-name.result new file mode 100644 index 00000000000..019a8299f3c --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db788-optimize-index-name.result @@ -0,0 +1,19 @@ +set default_storage_engine='tokudb'; +drop table if exists t; +create table t (a int, b int, c int, primary key(a), key(b), key(c)); +set tokudb_optimize_index_name='primary'; +optimize table t; +Table Op Msg_type Msg_text +test.t optimize note Table does not support optimize, doing recreate + analyze instead +test.t optimize status OK +set tokudb_optimize_index_name='b'; +optimize table t; +Table Op Msg_type Msg_text +test.t optimize note Table does not support optimize, doing recreate + analyze instead +test.t optimize status OK +set tokudb_optimize_index_name='c'; +optimize table t; +Table Op Msg_type Msg_text +test.t optimize note Table does not support optimize, doing recreate + analyze instead +test.t optimize status OK +drop table t; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db801.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db801.result new file mode 100644 index 00000000000..800db69ba39 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db801.result @@ -0,0 +1,18 @@ +set default_storage_engine=tokudb; +drop table if exists t; +create table t (id int not null primary key, c int not null) engine=tokudb; +insert into t values (1,0); +begin; +update t set c=10 where id=1; +update t set c=100; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +rollback; +drop table t; +create table t (id int not null primary key, c int not null) engine=tokudb partition by hash(id) partitions 1; +insert into t values (1,0); +begin; +update t set c=10 where id=1; +update t set c=100; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +rollback; +drop table t; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db805.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db805.result new file mode 100644 index 00000000000..1bc0372f1b8 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db805.result @@ -0,0 +1,18 @@ +drop table if exists t1,t3; +create table t3(a3 int,b3 decimal(0,0),c3 int,d3 int,primary key(a3,b3)) engine=TOKUDB; +LOCK TABLES t3 WRITE; +create temporary table t1(f1 int,index(f1)) engine=innodb; +INSERT INTO t1 VALUES(1),(1),(1); +select * from t1; +f1 +1 +1 +1 +ALTER TABLE t1 engine=TOKUDB; +select * from t1; +f1 +1 +1 +1 +unlock tables; +drop table t1,t3; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db806.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db806.result new file mode 100644 index 00000000000..ae87dbab281 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db806.result @@ -0,0 +1,9 @@ +drop table if exists t1,t3; +CREATE TABLE t3(a int,c int,d int)engine=TOKUDB; +lock table t3 read; +create temporary table t1 engine=tokudb as SELECT 1; +select * from t1; +1 +1 +unlock tables; +drop table t1,t3; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db811.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db811.result new file mode 100644 index 00000000000..1d26f43c9dd --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db811.result @@ -0,0 +1,14 @@ +drop table if exists t2,t3,t4; +CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; +CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; +CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 13; +LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; +INSERT INTO t2(a)VALUES (REPEAT(0,1)); +ALTER TABLE t2 ADD COLUMN(c INT); +alter table t4 add column c int; +UPDATE t2 SET a=1; +select * from t2; +a b c +1 NULL NULL +unlock tables; +drop table t2,t3,t4; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db811s.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db811s.result new file mode 100644 index 00000000000..0a50e63e037 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db811s.result @@ -0,0 +1,14 @@ +drop table if exists t2,t3,t4; +CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; +CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; +CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 1; +LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; +INSERT INTO t2(a)VALUES (REPEAT(0,1)); +ALTER TABLE t2 ADD COLUMN(c INT); +alter table t4 add column c int; +UPDATE t2 SET a=1; +select * from t2; +a b c +1 NULL NULL +unlock tables; +drop table t2,t3,t4; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db817.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db817.result new file mode 100644 index 00000000000..d69f0dabcb3 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db817.result @@ -0,0 +1,33 @@ +drop table if exists ti; +create table ti (id int primary key) engine=innodb; +begin; +insert into ti values (0); +savepoint b; +insert into ti values (1); +savepoint a2; +insert into ti values (2); +savepoint b; +insert into ti values (3); +rollback to a2; +commit; +select * from ti; +id +0 +1 +drop table if exists tt; +create table tt (id int primary key) engine=tokudb; +begin; +insert into tt values (0); +savepoint b; +insert into tt values (1); +savepoint a2; +insert into tt values (2); +savepoint b; +insert into tt values (3); +rollback to a2; +commit; +select * from tt; +id +0 +1 +drop table ti,tt; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db823.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db823.result new file mode 100644 index 00000000000..d94da5c0673 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db823.result @@ -0,0 +1,11 @@ +drop table if exists s,t; +create table s (id int) engine=tokudb; +lock tables s write; +create temporary table t (id int, key(id)) engine=innodb; +insert into t values (1); +alter table t engine=tokudb; +select * from t; +id +1 +unlock tables; +drop table s, t; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/memcache_dirty.result b/storage/tokudb/mysql-test/tokudb_bugs/r/memcache_dirty.result deleted file mode 100644 index 2ca26cd5c56..00000000000 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/memcache_dirty.result +++ /dev/null @@ -1,14 +0,0 @@ -SET DEFAULT_STORAGE_ENGINE = 'tokudb'; -DROP TABLE IF EXISTS t1; -create table t1 (i int, j int, primary key (i))engine=TokuDB; -insert into t1 values (0,0) MEMCACHE_DIRTY 'a'; -insert into t1 values (1,0) MEMCACHE_DIRTY 'b', 'c'; -update t1 set j=j+1 where i=0 MEMCACHE_DIRTY 'a'; -update t1 set j=j+1 where i=1 MEMCACHE_DIRTY 'b', 'c'; -insert into t1 values (0,0) on duplicate key update j=j+1 MEMCACHE_DIRTY 'a'; -insert into t1 values (2,0) on duplicate key update j=j+1 MEMCACHE_DIRTY 'a', 'b'; -replace into t1 values (0,3) MEMCACHE_DIRTY 'a'; -replace into t1 values (3,3) MEMCACHE_DIRTY 'a', 'b'; -delete from t1 where i=0 MEMCACHE_DIRTY 'a'; -delete from t1 where i=1 MEMCACHE_DIRTY 'b', 'c'; -DROP TABLE t1; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/tokudb718.result b/storage/tokudb/mysql-test/tokudb_bugs/r/tokudb718.result index e63f73caf20..0cf75d40847 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/tokudb718.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/tokudb718.result @@ -3,7 +3,8 @@ drop table if exists t; create table t (id int primary key); begin; insert into t values (1),(2); -select * from information_schema.tokudb_fractal_tree_info; -ERROR HY000: Got error -30994 "Internal error < 0 (Not system error)" from storage engine TokuDB +select dictionary_name from information_schema.tokudb_fractal_tree_info; +dictionary_name +./test/t-status commit; drop table t; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/5733_tokudb.test b/storage/tokudb/mysql-test/tokudb_bugs/t/5733_tokudb.test index 2e30c839905..192004cb113 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/t/5733_tokudb.test +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/5733_tokudb.test @@ -20,9 +20,18 @@ while ($i < $n) { } commit; -# TokuDB may do index or range scan on this. Both are ok -replace_column 9 #; ---replace_result index index_or_range range index_or_range +# the plan for the following query should be a range scan. about 1 of 10 times, +# the plan is an index scan. the different scan type occurs because the query optimizer +# is handed different row counts by tokudb::records_in_range. the cost estimates made +# by the query optimizer are very close to begin with. sometimes, the cost of an index +# scan is less than the cost of a range scan. +# +# if a tokudb checkpoint occurs before this query is run, then the records_in_range +# function returns a larger than expected row estimate. +# +# column 4 is the join type (should be range or index) +# column 9 is the estimated key count +replace_column 4 range_or_index 9 #; explain select id from t where id>0 limit 10; replace_column 9 #; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db788-optimize-index-name.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db788-optimize-index-name.test new file mode 100644 index 00000000000..644f00a5862 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db788-optimize-index-name.test @@ -0,0 +1,21 @@ +# test tokudb_optimize_index_name session variable +set default_storage_engine='tokudb'; +source include/have_tokudb.inc; +disable_warnings; +drop table if exists t; +enable_warnings; + +create table t (a int, b int, c int, primary key(a), key(b), key(c)); +# optimize primary key +set tokudb_optimize_index_name='primary'; +optimize table t; + +# optimize key b +set tokudb_optimize_index_name='b'; +optimize table t; + +# optimize key c +set tokudb_optimize_index_name='c'; +optimize table t; + +drop table t; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db801.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db801.test new file mode 100644 index 00000000000..8a8fcea1496 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db801.test @@ -0,0 +1,50 @@ +# test for the DB-801 bug on mysql-5.5.41 +source include/have_tokudb.inc; +source include/have_partition.inc; +set default_storage_engine=tokudb; + +disable_warnings; +drop table if exists t; +enable_warnings; + +# run the test on a tokudb table +create table t (id int not null primary key, c int not null) engine=tokudb; + +insert into t values (1,0); + +connect(conn1,localhost,root,,); +connection default; +begin; +update t set c=10 where id=1; + +connection conn1; +--error ER_LOCK_WAIT_TIMEOUT +update t set c=100; + +connection default; +rollback; +disconnect conn1; + +drop table t; + +# run the test on a partitioned tokudb table +create table t (id int not null primary key, c int not null) engine=tokudb partition by hash(id) partitions 1; + +insert into t values (1,0); + +connect(conn1,localhost,root,,); +connection default; +begin; +update t set c=10 where id=1; + +connection conn1; +--error ER_LOCK_WAIT_TIMEOUT +update t set c=100; + +connection default; +rollback; +disconnect conn1; + +drop table t; + + diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db805.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db805.test new file mode 100644 index 00000000000..1114de6b325 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db805.test @@ -0,0 +1,17 @@ +# DB-805 test that conversion of t1 from innodb to tokudb can write rows +source include/have_tokudb.inc; +source include/have_innodb.inc; +disable_warnings; +drop table if exists t1,t3; +enable_warnings; + +create table t3(a3 int,b3 decimal(0,0),c3 int,d3 int,primary key(a3,b3)) engine=TOKUDB; +LOCK TABLES t3 WRITE; +create temporary table t1(f1 int,index(f1)) engine=innodb; +INSERT INTO t1 VALUES(1),(1),(1); +select * from t1; +ALTER TABLE t1 engine=TOKUDB; +select * from t1; +unlock tables; + +drop table t1,t3; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db806.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db806.test new file mode 100644 index 00000000000..3815e59f78c --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db806.test @@ -0,0 +1,13 @@ +# DB-806 test that lock tables and create select can write rows to the new table +source include/have_tokudb.inc; +disable_warnings; +drop table if exists t1,t3; +enable_warnings; + +CREATE TABLE t3(a int,c int,d int)engine=TOKUDB; +lock table t3 read; +create temporary table t1 engine=tokudb as SELECT 1; +select * from t1; +unlock tables; + +drop table t1,t3;
\ No newline at end of file diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db811.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db811.test new file mode 100644 index 00000000000..509f482765e --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db811.test @@ -0,0 +1,22 @@ +# DB-811 test that alter table t2 updates both the schema (FRM) and the data (tokudb files) + +source include/have_tokudb.inc; +source include/have_innodb.inc; +source include/have_partition.inc; +disable_warnings; +drop table if exists t2,t3,t4; +enable_warnings; + +CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; +CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; +CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 13; +LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; +INSERT INTO t2(a)VALUES (REPEAT(0,1)); +ALTER TABLE t2 ADD COLUMN(c INT); +alter table t4 add column c int; +UPDATE t2 SET a=1; +select * from t2; +unlock tables; + +drop table t2,t3,t4; + diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db811s.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db811s.test new file mode 100644 index 00000000000..5b8c6ed79d3 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db811s.test @@ -0,0 +1,22 @@ +# DB-811 test that alter table t2 updates both the schema (FRM) and the data (tokudb files) + +source include/have_tokudb.inc; +source include/have_innodb.inc; +source include/have_partition.inc; +disable_warnings; +drop table if exists t2,t3,t4; +enable_warnings; + +CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; +CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; +CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 1; +LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; +INSERT INTO t2(a)VALUES (REPEAT(0,1)); +ALTER TABLE t2 ADD COLUMN(c INT); +alter table t4 add column c int; +UPDATE t2 SET a=1; +select * from t2; +unlock tables; + +drop table t2,t3,t4; + diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db817.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db817.test new file mode 100644 index 00000000000..53c9edc3893 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db817.test @@ -0,0 +1,38 @@ +# verify that duplicate savepoint names in innodb and tokudb work the same +source include/have_innodb.inc; +source include/have_tokudb.inc; +disable_warnings; +drop table if exists ti; +enable_warnings; +create table ti (id int primary key) engine=innodb; +begin; +insert into ti values (0); +savepoint b; +insert into ti values (1); +savepoint a2; +insert into ti values (2); +savepoint b; +insert into ti values (3); +rollback to a2; +commit; +select * from ti; + +disable_warnings; +drop table if exists tt; +enable_warnings; +create table tt (id int primary key) engine=tokudb; +begin; +insert into tt values (0); +savepoint b; +insert into tt values (1); +savepoint a2; +insert into tt values (2); +savepoint b; +insert into tt values (3); +rollback to a2; +commit; +select * from tt; + +drop table ti,tt; + + diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db823.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db823.test new file mode 100644 index 00000000000..2e01c0e5797 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db823.test @@ -0,0 +1,16 @@ +# test DB-823 +# test that the conversion of table t from innodb to tokudb succeeds. +source include/have_tokudb.inc; +source include/have_innodb.inc; +disable_warnings; +drop table if exists s,t; +enable_warnings; +create table s (id int) engine=tokudb; +lock tables s write; +create temporary table t (id int, key(id)) engine=innodb; +insert into t values (1); +alter table t engine=tokudb; +select * from t; +unlock tables; +drop table s, t; + diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/memcache_dirty.test b/storage/tokudb/mysql-test/tokudb_bugs/t/memcache_dirty.test deleted file mode 100644 index e66c4cf0b6f..00000000000 --- a/storage/tokudb/mysql-test/tokudb_bugs/t/memcache_dirty.test +++ /dev/null @@ -1,25 +0,0 @@ ---source include/have_tokudb.inc -# -# Record inconsistency. -# -# -SET DEFAULT_STORAGE_ENGINE = 'tokudb'; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings -create table t1 (i int, j int, primary key (i))engine=TokuDB; -insert into t1 values (0,0) MEMCACHE_DIRTY 'a'; insert into t1 values (1,0) MEMCACHE_DIRTY 'b', 'c'; - -update t1 set j=j+1 where i=0 MEMCACHE_DIRTY 'a'; update t1 set j=j+1 where i=1 MEMCACHE_DIRTY 'b', 'c'; - -insert into t1 values (0,0) on duplicate key update j=j+1 MEMCACHE_DIRTY 'a'; insert into t1 values (2,0) on duplicate key update j=j+1 MEMCACHE_DIRTY 'a', 'b'; - -replace into t1 values (0,3) MEMCACHE_DIRTY 'a'; replace into t1 values (3,3) MEMCACHE_DIRTY 'a', 'b'; - -delete from t1 where i=0 MEMCACHE_DIRTY 'a'; delete from t1 where i=1 MEMCACHE_DIRTY 'b', 'c'; - - -# Final cleanup. -DROP TABLE t1; - diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/tokudb718.test b/storage/tokudb/mysql-test/tokudb_bugs/t/tokudb718.test index 415bb7a2332..735a88afed8 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/t/tokudb718.test +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/tokudb718.test @@ -7,7 +7,6 @@ enable_warnings; create table t (id int primary key); begin; insert into t values (1),(2); ---error 1030 -select * from information_schema.tokudb_fractal_tree_info; +select dictionary_name from information_schema.tokudb_fractal_tree_info; commit; drop table t; |