summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'storage/tokudb/mysql-test')
-rw-r--r--storage/tokudb/mysql-test/rpl/disabled.def1
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result4
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ff.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tf.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tt.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result7
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result4
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result4
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result4
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result4
-rw-r--r--storage/tokudb/mysql-test/rpl/t/disabled.def1
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb.test1
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt9
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt8
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt4
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml-master.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml.test3
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1.test2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/suite.opt1
-rw-r--r--storage/tokudb/mysql-test/tokudb/disabled.def8
-rw-r--r--storage/tokudb/mysql-test/tokudb/include/cluster_key.inc138
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/background_job_manager.result122
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/card_add_drop.result22
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/card_add_index.result16
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/card_auto_analyze_lots.result805
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/card_drop_index.result10
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/card_drop_index_2.result10
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/card_drop_pk.result16
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/card_pk_2.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/card_pk_sk.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/card_scale_percent.result42
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/card_sk.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/card_sk_2.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/cluster_2968-0.result2
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/cluster_2968-1.result4
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/cluster_2968-2.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/cluster_2968-3.result4
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/cluster_key.result36
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/cluster_key_part.result652
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_released.result4
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result4
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result24
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks_released.result2
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result21
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/type_bit.result2
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/background_job_manager.opt1
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/background_job_manager.test139
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/card_auto_analyze_lots.test82
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/card_scale_percent.test56
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/cluster_key.test136
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/cluster_key_part.test48
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/disabled.def28
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test4
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test11
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks.test9
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test2
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_trx.test17
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/suite.opt1
-rw-r--r--storage/tokudb/mysql-test/tokudb_add_index/disabled.def0
-rw-r--r--storage/tokudb/mysql-test/tokudb_add_index/t/suite.opt1
-rw-r--r--storage/tokudb/mysql-test/tokudb_alter_table/disabled.def6
-rw-r--r--storage/tokudb/mysql-test/tokudb_alter_table/t/disabled.def8
-rw-r--r--storage/tokudb/mysql-test/tokudb_alter_table/t/suite.opt1
-rw-r--r--storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_exclude.result31
-rw-r--r--storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_set_last_error.result20
-rw-r--r--storage/tokudb/mysql-test/tokudb_backup/t/suite.opt1
-rw-r--r--storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_exclude.test69
-rw-r--r--storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_set_last_error.test32
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/disabled.def14
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/5585.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db233.result37
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db397_delete_trigger.result12
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db397_insert_trigger.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db397_update_trigger.result12
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db739_replace.result2
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1.result12
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1_pick.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2.result12
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2_pick.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db757_part_alter_analyze.result26
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db917.result14
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db938.result35
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db945.result15
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/5585-master.opt2
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/5585.test9
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/db233.test70
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/db397_delete_trigger.test6
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/db397_insert_trigger.test6
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/db397_update_trigger.test4
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/db917.test23
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/db938.test77
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/db945.test24
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/disabled.def16
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/suite.opt1
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/xa-3.test6
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/xa-4.test6
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/xa-6.test6
-rw-r--r--storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result2
-rw-r--r--storage/tokudb/mysql-test/tokudb_mariadb/r/mrr.result4
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/disabled.def3
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/r/partition_alter4_tokudb.result192
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result4
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/t/disabled.def2
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb-master.opt1
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb.test5
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/t/suite.opt1
-rw-r--r--storage/tokudb/mysql-test/tokudb_rpl/r/rpl_rfr_disable_on_expl_pk_absence.result47
-rw-r--r--storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence-slave.opt1
-rw-r--r--storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence.test48
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_delete_fraction.result73
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_in_background_basic.result99
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_mode_basic.result89
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_throttle_basic.result61
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_time_basic.result61
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_auto_analyze.result61
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_cardinality_scale_percent_basic.result36
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_pk_insert_mode_basic.result85
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/t/suite.opt1
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_delete_fraction.test56
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_in_background_basic.test80
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_mode_basic.test72
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_throttle_basic.test50
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_time_basic.test50
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_auto_analyze.test50
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_cardinality_scale_percent_basic.test32
-rw-r--r--storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_pk_insert_mode_basic.test51
172 files changed, 4211 insertions, 491 deletions
diff --git a/storage/tokudb/mysql-test/rpl/disabled.def b/storage/tokudb/mysql-test/rpl/disabled.def
index 25c44654676..4c1a9a3e785 100644
--- a/storage/tokudb/mysql-test/rpl/disabled.def
+++ b/storage/tokudb/mysql-test/rpl/disabled.def
@@ -13,4 +13,3 @@ 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
-rpl_row_sp002_tokudb : tokudb does not support foreign keys
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result
index cd8608f4387..5935e5ddcbd 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result
@@ -1,6 +1,13 @@
include/master-slave.inc
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_%';
+Variable_name Value
+tokudb_rpl_check_readonly ON
+tokudb_rpl_lookup_rows OFF
+tokudb_rpl_lookup_rows_delay 10000
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 10000
create table t (a bigint not null, primary key(a)) engine=tokudb;
insert into t values (1);
insert into t values (2),(3);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result
index 1ba442ecde2..daa04e5f43e 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result
@@ -1,6 +1,13 @@
include/master-slave.inc
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_%';
+Variable_name Value
+tokudb_rpl_check_readonly ON
+tokudb_rpl_lookup_rows OFF
+tokudb_rpl_lookup_rows_delay 10000
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 10000
create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb;
insert into t values (1,0);
insert into t values (2,0),(3,0);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result
index 608e85249fb..518d3318710 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result
@@ -1,6 +1,10 @@
include/master-slave.inc
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_unique_checks%';
+Variable_name Value
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 5000
create table t (a bigint not null, primary key(a)) engine=tokudb;
select unix_timestamp() into @tstart;
insert into t values (1);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result
index c77cbbc71c9..6fab29177d7 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result
@@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_%';
+Variable_name Value
+tokudb_rpl_check_readonly ON
+tokudb_rpl_lookup_rows OFF
+tokudb_rpl_lookup_rows_delay 10000
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 10000
create table t (a bigint not null, primary key(a)) engine=tokudb;
insert into t values (1);
insert into t values (2),(3);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result
index e178b8ad137..f8efd5e04ee 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result
@@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_%';
+Variable_name Value
+tokudb_rpl_check_readonly ON
+tokudb_rpl_lookup_rows ON
+tokudb_rpl_lookup_rows_delay 10000
+tokudb_rpl_unique_checks ON
+tokudb_rpl_unique_checks_delay 0
create table t (a bigint not null, primary key(a)) engine=tokudb;
insert into t values (1);
insert into t values (2),(3);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result
index 30c3d188f9a..59b05ea4dfb 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result
@@ -1,3 +1,6 @@
+SET SESSION tokudb_pk_insert_mode = 2;
+Warnings:
+Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases.
include/master-slave.inc
[connection master]
==========MASTER==========
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
index 5926cdda565..76a5e31b969 100644
--- 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
@@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl%';
+Variable_name Value
+tokudb_rpl_check_readonly OFF
+tokudb_rpl_lookup_rows ON
+tokudb_rpl_lookup_rows_delay 0
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 5000
create table t (a bigint not null, primary key(a)) engine=tokudb;
select unix_timestamp() into @tstart;
insert into t values (1);
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
index 3bcd3e8ccdd..c81a2ebac44 100644
--- 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
@@ -1,6 +1,13 @@
include/master-slave.inc
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl%';
+Variable_name Value
+tokudb_rpl_check_readonly ON
+tokudb_rpl_lookup_rows ON
+tokudb_rpl_lookup_rows_delay 0
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 5000
create table t (a bigint not null, primary key(a)) engine=tokudb;
select unix_timestamp() into @tstart;
insert into t values (1);
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
index 5926cdda565..76a5e31b969 100644
--- 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
@@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl%';
+Variable_name Value
+tokudb_rpl_check_readonly OFF
+tokudb_rpl_lookup_rows ON
+tokudb_rpl_lookup_rows_delay 0
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 5000
create table t (a bigint not null, primary key(a)) engine=tokudb;
select unix_timestamp() into @tstart;
insert into t values (1);
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
index 5926cdda565..0cba2a1cddb 100644
--- 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
@@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl%';
+Variable_name Value
+tokudb_rpl_check_readonly ON
+tokudb_rpl_lookup_rows ON
+tokudb_rpl_lookup_rows_delay 0
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 5000
create table t (a bigint not null, primary key(a)) engine=tokudb;
select unix_timestamp() into @tstart;
insert into t values (1);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result
index 162655f9896..50f43ebe5bf 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result
@@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_%';
+Variable_name Value
+tokudb_rpl_check_readonly ON
+tokudb_rpl_lookup_rows OFF
+tokudb_rpl_lookup_rows_delay 10000
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 10000
create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb;
insert into t values (1,0);
insert into t values (2,0),(3,0);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result
index 3c909718426..9e7f932a3c9 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result
@@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_%';
+Variable_name Value
+tokudb_rpl_check_readonly ON
+tokudb_rpl_lookup_rows ON
+tokudb_rpl_lookup_rows_delay 10000
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 10000
create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb;
insert into t values (1,0);
insert into t values (2,0),(3,0);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result
index 3c909718426..348734b206d 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result
@@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_%';
+Variable_name Value
+tokudb_rpl_check_readonly ON
+tokudb_rpl_lookup_rows OFF
+tokudb_rpl_lookup_rows_delay 10000
+tokudb_rpl_unique_checks ON
+tokudb_rpl_unique_checks_delay 10000
create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb;
insert into t values (1,0);
insert into t values (2,0),(3,0);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result
index 3c909718426..bfd640e52e9 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result
@@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_%';
+Variable_name Value
+tokudb_rpl_check_readonly ON
+tokudb_rpl_lookup_rows ON
+tokudb_rpl_lookup_rows_delay 10000
+tokudb_rpl_unique_checks ON
+tokudb_rpl_unique_checks_delay 10000
create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb;
insert into t values (1,0);
insert into t values (2,0),(3,0);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result
index 941010071ae..faf969f851a 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result
@@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_%';
+Variable_name Value
+tokudb_rpl_check_readonly ON
+tokudb_rpl_lookup_rows OFF
+tokudb_rpl_lookup_rows_delay 10000
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 10000
create table t (a bigint not null, b bigint not null, c bigint not null, primary key(a), unique key(c)) engine=tokudb;
insert into t values (1,0,-1);
insert into t values (2,0,-2),(3,0,-3);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result
index 6a0b1126710..9ac87512f80 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result
@@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_%';
+Variable_name Value
+tokudb_rpl_check_readonly ON
+tokudb_rpl_lookup_rows ON
+tokudb_rpl_lookup_rows_delay 10000
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 10000
create table t (a bigint not null, b bigint not null, c bigint not null, primary key(a), unique key(c)) engine=tokudb;
insert into t values (1,0,-1);
insert into t values (2,0,-2),(3,0,-3);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result
index 5926cdda565..ea1b84f8138 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result
@@ -4,6 +4,10 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_unique_checks%';
+Variable_name Value
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 5000
create table t (a bigint not null, primary key(a)) engine=tokudb;
select unix_timestamp() into @tstart;
insert into t values (1);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result
index 0b5ac77481f..c846ec81612 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result
@@ -4,6 +4,10 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_unique_checks%';
+Variable_name Value
+tokudb_rpl_unique_checks ON
+tokudb_rpl_unique_checks_delay 10000
create table t (a bigint not null, primary key(a)) engine=tokudb;
select unix_timestamp() into @tstart;
insert into t values (1);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result
index 60ffc0d0530..808303387d5 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result
@@ -4,6 +4,10 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_unique_checks%';
+Variable_name Value
+tokudb_rpl_unique_checks OFF
+tokudb_rpl_unique_checks_delay 5000
create table t (a bigint not null, b bigint not null, primary key(a), unique key(b)) engine=tokudb;
select unix_timestamp() into @tstart;
insert into t values (1,2);
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result
index 2f2cf58032e..a40548cec62 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result
@@ -4,6 +4,10 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
+show variables like 'tokudb_rpl_unique_checks%';
+Variable_name Value
+tokudb_rpl_unique_checks ON
+tokudb_rpl_unique_checks_delay 5000
create table t (a bigint not null, b bigint not null, primary key(a), unique key(b)) engine=tokudb;
select unix_timestamp() into @tstart;
insert into t values (1,2);
diff --git a/storage/tokudb/mysql-test/rpl/t/disabled.def b/storage/tokudb/mysql-test/rpl/t/disabled.def
new file mode 100644
index 00000000000..30bc9fea7c5
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/disabled.def
@@ -0,0 +1 @@
+rpl_row_sp002_tokudb : tokudb does not support foreign keys
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb.test
index efb60fac2ba..23d2d6cdf51 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb.test
@@ -1,3 +1,4 @@
+--source include/have_tokudb.inc
#Want to skip this test from daily Valgrind execution
--source include/no_valgrind_without_big.inc
#
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt
index 98240735800..0aa48174807 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt
@@ -1,6 +1,5 @@
--read-only=ON
---tokudb-rpl-unique-checks-delay=10000
---tokudb-rpl-unique-checks=OFF
---tokudb-rpl-lookup-rows-delay=10000
---tokudb-rpl-lookup-rows=OFF
-
+--loose-tokudb-rpl-unique-checks-delay=10000
+--loose-tokudb-rpl-unique-checks=OFF
+--loose-tokudb-rpl-lookup-rows-delay=10000
+--loose-tokudb-rpl-lookup-rows=OFF
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk.test
index fb42f40bb62..bedeb9513be 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk.test
@@ -14,7 +14,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_%';
+show variables like 'tokudb_rpl_%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt
index 8d0e95decb2..0aa48174807 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt
@@ -1,5 +1,5 @@
--read-only=ON
---tokudb-rpl-unique-checks-delay=10000
---tokudb-rpl-unique-checks=OFF
---tokudb-rpl-lookup-rows-delay=10000
---tokudb-rpl-lookup-rows=OFF
+--loose-tokudb-rpl-unique-checks-delay=10000
+--loose-tokudb-rpl-unique-checks=OFF
+--loose-tokudb-rpl-lookup-rows-delay=10000
+--loose-tokudb-rpl-lookup-rows=OFF
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test
index 62e123d5a04..d6ccf2487ae 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test
@@ -13,7 +13,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_%';
+show variables like 'tokudb_rpl_%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt
index c11308c89bf..7f49776e4e8 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt
@@ -1,3 +1,3 @@
--read-only=ON
---tokudb-rpl-unique-checks-delay=5000
---tokudb-rpl-unique-checks=OFF
+--loose-tokudb-rpl-unique-checks-delay=5000
+--loose-tokudb-rpl-unique-checks=OFF
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test
index bd27ceb2c2b..db96ac321c0 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test
@@ -14,7 +14,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_unique_checks%';
+show variables like 'tokudb_rpl_unique_checks%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk-slave.opt
index dc139282dc4..93a2685e847 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk-slave.opt
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=OFF --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=OFF
+--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=OFF --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=OFF
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk.test
index fb42f40bb62..bedeb9513be 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk.test
@@ -14,7 +14,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_%';
+show variables like 'tokudb_rpl_%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1-slave.opt
index 4675b07763d..9a2fec628f9 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1-slave.opt
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-unique-checks-delay=0 --tokudb-rpl-unique-checks=ON --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=ON
+--read-only=ON --loose-tokudb-rpl-unique-checks-delay=0 --loose-tokudb-rpl-unique-checks=ON --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=ON
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1.test
index bf5edbd2c1b..9e9aaede416 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1.test
@@ -15,7 +15,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_%';
+show variables like 'tokudb_rpl_%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml-master.opt
deleted file mode 100644
index fd3de58d816..00000000000
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml-master.opt
+++ /dev/null
@@ -1,2 +0,0 @@
---tokudb_pk_insert_mode=2
-
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml.test
index c27625abd7f..6147d321784 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml.test
@@ -6,4 +6,7 @@
--source include/have_binlog_format_mixed.inc
--source include/have_tokudb.inc
let $engine_type=TokuDB;
+
+SET SESSION tokudb_pk_insert_mode = 2;
+
--source suite/rpl/include/rpl_mixed_dml.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
index b9eb687d8d5..0240c9d6ae4 100644
--- 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
@@ -1 +1 @@
---read-only=OFF --tokudb-rpl-check-readonly=OFF --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF
+--read-only=OFF --loose-tokudb-rpl-check-readonly=OFF --loose-tokudb-rpl-unique-checks-delay=5000 --loose-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
index c77e4b49605..7b3e8f0c0d3 100644
--- 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
@@ -14,7 +14,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_unique_checks%';
+show variables like 'tokudb_rpl%';
# insert some rows
connection master;
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
index 8283875e8a7..e1ee193d4c1 100644
--- 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
@@ -1 +1 @@
---read-only=OFF --tokudb-rpl-check-readonly=ON --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF
+--read-only=OFF --loose-tokudb-rpl-check-readonly=ON --loose-tokudb-rpl-unique-checks-delay=5000 --loose-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
index c77e4b49605..7b3e8f0c0d3 100644
--- 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
@@ -14,7 +14,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_unique_checks%';
+show variables like 'tokudb_rpl%';
# insert some rows
connection master;
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
index 21e57d27c17..e60afd0380a 100644
--- 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
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-check-readonly=OFF --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF
+--read-only=ON --loose-tokudb-rpl-check-readonly=OFF --loose-tokudb-rpl-unique-checks-delay=5000 --loose-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
index c77e4b49605..7b3e8f0c0d3 100644
--- 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
@@ -14,7 +14,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_unique_checks%';
+show variables like 'tokudb_rpl%';
# insert some rows
connection master;
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
index fd77ee0da9c..f6658646e65 100644
--- 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
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-check-readonly=ON --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF
+--read-only=ON --loose-tokudb-rpl-check-readonly=ON --loose-tokudb-rpl-unique-checks-delay=5000 --loose-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
index c77e4b49605..7b3e8f0c0d3 100644
--- 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
@@ -14,7 +14,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_unique_checks%';
+show variables like 'tokudb_rpl%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0-slave.opt
index dc139282dc4..93a2685e847 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0-slave.opt
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=OFF --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=OFF
+--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=OFF --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=OFF
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0.test
index 998987349c7..6dd9b660eed 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0.test
@@ -13,7 +13,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_%';
+show variables like 'tokudb_rpl_%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1-slave.opt
index d546dd00669..a4ca1104425 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1-slave.opt
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=OFF --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=ON
+--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=OFF --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=ON
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1.test
index 998987349c7..6dd9b660eed 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1.test
@@ -13,7 +13,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_%';
+show variables like 'tokudb_rpl_%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0-slave.opt
index 5cfe5f83a91..4b1d21daf5f 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0-slave.opt
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=ON --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=OFF
+--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=ON --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=OFF
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0.test
index 998987349c7..6dd9b660eed 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0.test
@@ -13,7 +13,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_%';
+show variables like 'tokudb_rpl_%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1-slave.opt
index 7cd575c52bb..239e19ac040 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1-slave.opt
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=ON --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=ON
+--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=ON --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=ON
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1.test
index 998987349c7..6dd9b660eed 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1.test
@@ -13,7 +13,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_%';
+show variables like 'tokudb_rpl_%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0-slave.opt
index dc139282dc4..93a2685e847 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0-slave.opt
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=OFF --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=OFF
+--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=OFF --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=OFF
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0.test
index 11401ac0ce0..93fef3699d9 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0.test
@@ -13,7 +13,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_%';
+show variables like 'tokudb_rpl_%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1-slave.opt
index d546dd00669..a4ca1104425 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1-slave.opt
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=OFF --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=ON
+--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=OFF --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=ON
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1.test
index ea77447bc75..c8976db8ccd 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1.test
@@ -13,7 +13,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_%';
+show variables like 'tokudb_rpl_%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk-slave.opt
index 9baf0d65ecf..19b40f86454 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk-slave.opt
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF
+--read-only=ON --loose-tokudb-rpl-unique-checks-delay=5000 --loose-tokudb-rpl-unique-checks=OFF
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk.test
index c77e4b49605..0ed12b34e1f 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk.test
@@ -14,7 +14,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_unique_checks%';
+show variables like 'tokudb_rpl_unique_checks%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1-slave.opt
index b1df0b6daf0..646a9991753 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1-slave.opt
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=ON
+--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=ON
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1.test
index c77e4b49605..0ed12b34e1f 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1.test
@@ -14,7 +14,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_unique_checks%';
+show variables like 'tokudb_rpl_unique_checks%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique-slave.opt
index 9baf0d65ecf..19b40f86454 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique-slave.opt
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF
+--read-only=ON --loose-tokudb-rpl-unique-checks-delay=5000 --loose-tokudb-rpl-unique-checks=OFF
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique.test
index cf6a26b423d..fc4c9597dac 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique.test
@@ -14,7 +14,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_unique_checks%';
+show variables like 'tokudb_rpl_unique_checks%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1-slave.opt
index 0518efd3da5..9139a370e57 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1-slave.opt
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1-slave.opt
@@ -1 +1 @@
---read-only=ON --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=ON
+--read-only=ON --loose-tokudb-rpl-unique-checks-delay=5000 --loose-tokudb-rpl-unique-checks=ON
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1.test
index cf6a26b423d..fc4c9597dac 100644
--- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1.test
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1.test
@@ -14,7 +14,7 @@ enable_warnings;
connection slave;
# show variables like 'read_only';
-# show variables like 'tokudb_rpl_unique_checks%';
+show variables like 'tokudb_rpl_unique_checks%';
# insert some rows
connection master;
diff --git a/storage/tokudb/mysql-test/rpl/t/suite.opt b/storage/tokudb/mysql-test/rpl/t/suite.opt
new file mode 100644
index 00000000000..23511b05020
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/suite.opt
@@ -0,0 +1 @@
+$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0
diff --git a/storage/tokudb/mysql-test/tokudb/disabled.def b/storage/tokudb/mysql-test/tokudb/disabled.def
index 5b7afa1753e..c98a8aa622a 100644
--- a/storage/tokudb/mysql-test/tokudb/disabled.def
+++ b/storage/tokudb/mysql-test/tokudb/disabled.def
@@ -26,9 +26,5 @@ type_temporal_fractional:
type_temporal_upgrade:
type_timestamp_explicit:
cluster_key_part: engine options on partitioned tables
-#i_s_tokudb_lock_waits_released: unstable, race conditions
-#i_s_tokudb_locks_released: unstable, race conditions
-mvcc-19: tokutek
-mvcc-20: tokutek
-mvcc-27: tokutek
-storage_engine_default: tokudb is not the default storage engine
+i_s_tokudb_lock_waits_released: unstable, race conditions
+i_s_tokudb_locks_released: unstable, race conditions
diff --git a/storage/tokudb/mysql-test/tokudb/include/cluster_key.inc b/storage/tokudb/mysql-test/tokudb/include/cluster_key.inc
new file mode 100644
index 00000000000..d637b46e8fc
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/include/cluster_key.inc
@@ -0,0 +1,138 @@
+# test for TokuDB clustering keys.
+# test assumes that a table 't1' exists with the following columns:
+# a int, b int, c int, d int
+insert into t1 values (1,10,100,1000),(2,20,200,2000),(3,30,300,3000),(4,40,400,4000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(9,90,900,9000);
+
+
+#normal queries
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select * from t1 where a > 5;
+select * from t1 where a > 5;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select * from t1 where b > 30;
+select * from t1 where b > 30;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select * from t1 where c > 750;
+select * from t1 where c > 750;
+
+#covering indexes
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select a from t1 where a > 8;
+select a from t1 where a > 8;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select a,b from t1 where b > 30;
+select a,b from t1 where b > 30;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select a,b from t1 where c > 750;
+select a,c from t1 where c > 750;
+
+
+alter table t1 add index bdca(b,d,c,a) clustering=yes;
+insert into t1 values (10,10,10,10);
+alter table t1 drop index bdca;
+
+alter table t1 drop primary key;
+# ignore rows column
+--replace_column 9 NULL;
+explain select * from t1 where a > 5;
+select * from t1 where a > 5;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select * from t1 where b > 30;
+select * from t1 where b > 30;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select * from t1 where c > 750;
+select * from t1 where c > 750;
+
+#covering indexes
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select b from t1 where b > 30;
+select b from t1 where b > 30;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select b from t1 where c > 750;
+select c from t1 where c > 750;
+
+alter table t1 add e varchar(20);
+
+alter table t1 add primary key (a,b,c);
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select * from t1 where a > 5;
+select * from t1 where a > 5;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select * from t1 where b > 30;
+select * from t1 where b > 30;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select * from t1 where c > 750;
+select * from t1 where c > 750;
+
+#covering indexes
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select a from t1 where a > 8;
+select a from t1 where a > 8;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select a,b from t1 where b > 30;
+select a,b from t1 where b > 30;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select a,b from t1 where c > 750;
+select a,c from t1 where c > 750;
+
+
+alter table t1 drop primary key;
+# ignore rows column
+--replace_column 9 NULL;
+explain select * from t1 where a > 5;
+select * from t1 where a > 5;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select * from t1 where b > 30;
+select * from t1 where b > 30;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select * from t1 where c > 750;
+select * from t1 where c > 750;
+
+#covering indexes
+# ignore rows column
+--replace_column 9 NULL;
+explain select b from t1 where b > 30;
+select b from t1 where b > 30;
+
+# ignore rows column
+--replace_column 9 NULL;
+explain select b from t1 where c > 750;
+select c from t1 where c > 750;
+
+
diff --git a/storage/tokudb/mysql-test/tokudb/r/background_job_manager.result b/storage/tokudb/mysql-test/tokudb/r/background_job_manager.result
new file mode 100644
index 00000000000..5769ee74071
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/r/background_job_manager.result
@@ -0,0 +1,122 @@
+set @orig_auto_analyze = @@session.tokudb_auto_analyze;
+set @orig_in_background = @@session.tokudb_analyze_in_background;
+set @orig_mode = @@session.tokudb_analyze_mode;
+set @orig_throttle = @@session.tokudb_analyze_throttle;
+set @orig_time = @@session.tokudb_analyze_time;
+set @orig_scale_percent = @@global.tokudb_cardinality_scale_percent;
+set @orig_default_storage_engine = @@session.default_storage_engine;
+set @orig_pause_background_job_manager = @@global.tokudb_debug_pause_background_job_manager;
+set session default_storage_engine='tokudb';
+set session tokudb_auto_analyze=1;
+set session tokudb_analyze_in_background=1;
+set session tokudb_analyze_mode=tokudb_analyze_standard;
+set session tokudb_analyze_throttle=0;
+set session tokudb_analyze_time=0;
+set global tokudb_cardinality_scale_percent=DEFAULT;
+set global tokudb_debug_pause_background_job_manager=TRUE;
+show create table information_schema.tokudb_background_job_status;
+Table Create Table
+TokuDB_background_job_status CREATE TEMPORARY TABLE `TokuDB_background_job_status` (
+ `id` bigint(0) NOT NULL DEFAULT '0',
+ `database_name` varchar(256) NOT NULL DEFAULT '',
+ `table_name` varchar(256) NOT NULL DEFAULT '',
+ `job_type` varchar(256) NOT NULL DEFAULT '',
+ `job_params` varchar(256) NOT NULL DEFAULT '',
+ `scheduler` varchar(32) NOT NULL DEFAULT '',
+ `scheduled_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `started_time` datetime DEFAULT NULL,
+ `status` varchar(256) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=utf8
+create table t1 (a int not null auto_increment, b int, c int, primary key(a), key kb(b), key kc(c), key kabc(a,b,c), key kab(a,b), key kbc(b,c));
+insert into t1(b,c) values(0,0), (1,1), (2,2), (3,3);
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+database_name table_name job_type job_params scheduler
+test t1 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; AUTO
+create table t2 like t1;
+create table t3 like t1;
+create table t4 like t1;
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+analyze table t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+analyze table t3;
+Table Op Msg_type Msg_text
+test.t3 analyze status OK
+analyze table t4;
+Table Op Msg_type Msg_text
+test.t4 analyze status OK
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+database_name table_name job_type job_params scheduler
+test t1 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; AUTO
+test t2 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+test t3 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+test t4 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+set global tokudb_debug_pause_background_job_manager=FALSE;
+set global tokudb_debug_pause_background_job_manager=TRUE;
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+analyze table t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+analyze table t3;
+Table Op Msg_type Msg_text
+test.t3 analyze status OK
+analyze table t4;
+Table Op Msg_type Msg_text
+test.t4 analyze status OK
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+database_name table_name job_type job_params scheduler
+test t1 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+test t2 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+test t3 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+test t4 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+alter table t1 add column d int;
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+database_name table_name job_type job_params scheduler
+test t2 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+test t3 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+test t4 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+set session tokudb_analyze_mode=tokudb_analyze_cancel;
+analyze table t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+database_name table_name job_type job_params scheduler
+test t3 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+test t4 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+set session tokudb_analyze_mode=tokudb_analyze_recount_rows;
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+database_name table_name job_type job_params scheduler
+test t3 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+test t4 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+test t1 TOKUDB_ANALYZE_MODE_RECOUNT_ROWS TOKUDB_ANALYZE_THROTTLE=0; USER
+set session tokudb_analyze_mode=tokudb_analyze_standard;
+set session tokudb_analyze_in_background=0;
+analyze table t3;
+Table Op Msg_type Msg_text
+test.t3 analyze status OK
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+database_name table_name job_type job_params scheduler
+test t4 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER
+test t1 TOKUDB_ANALYZE_MODE_RECOUNT_ROWS TOKUDB_ANALYZE_THROTTLE=0; USER
+drop table t1;
+drop table t2;
+drop table t3;
+drop table t4;
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+database_name table_name job_type job_params scheduler
+set global tokudb_debug_pause_background_job_manager=FALSE;
+set session tokudb_auto_analyze = @orig_auto_analyze;
+set session tokudb_analyze_in_background = @orig_in_background;
+set session tokudb_analyze_mode = @orig_mode;
+set session tokudb_analyze_throttle = @orig_throttle;
+set session tokudb_analyze_time = @orig_time;
+set global tokudb_cardinality_scale_percent = @orig_scale_percent;
+set session default_storage_engine = @orig_default_storage_engine;
+set global tokudb_debug_pause_background_job_manager = @orig_pause_background_job_manager;
diff --git a/storage/tokudb/mysql-test/tokudb/r/card_add_drop.result b/storage/tokudb/mysql-test/tokudb/r/card_add_drop.result
index 431f0200a7a..71a39eb1f3e 100644
--- a/storage/tokudb/mysql-test/tokudb/r/card_add_drop.result
+++ b/storage/tokudb/mysql-test/tokudb/r/card_add_drop.result
@@ -4,35 +4,35 @@ create table tt (a int, b int, c int, d int, key(a), key(b), key(c));
insert into tt values (0,0,0,0),(1,0,0,0),(2,0,1,0),(3,0,1,0);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-tt 1 a 1 a A NULL NULL NULL YES BTREE
-tt 1 b 1 b A NULL NULL NULL YES BTREE
-tt 1 c 1 c A NULL NULL NULL YES BTREE
+tt 1 a 1 a A 4 NULL NULL YES BTREE
+tt 1 b 1 b A 4 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 1 a 1 a A 4 NULL NULL YES BTREE
-tt 1 b 1 b A 1 NULL NULL YES BTREE
-tt 1 c 1 c A 2 NULL NULL YES BTREE
+tt 1 b 1 b A 2 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
alter table tt drop key b, add key (d);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 1 a 1 a A 4 NULL NULL YES BTREE
-tt 1 c 1 c A 2 NULL NULL YES BTREE
-tt 1 d 1 d A NULL NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
+tt 1 d 1 d A 4 NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 1 a 1 a A 4 NULL NULL YES BTREE
-tt 1 c 1 c A 2 NULL NULL YES BTREE
-tt 1 d 1 d A 1 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
+tt 1 d 1 d A 2 NULL NULL YES BTREE
flush tables;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 1 a 1 a A 4 NULL NULL YES BTREE
-tt 1 c 1 c A 2 NULL NULL YES BTREE
-tt 1 d 1 d A 1 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
+tt 1 d 1 d A 2 NULL NULL YES BTREE
drop table tt;
diff --git a/storage/tokudb/mysql-test/tokudb/r/card_add_index.result b/storage/tokudb/mysql-test/tokudb/r/card_add_index.result
index f5ba5b58bed..9a929b19a80 100644
--- a/storage/tokudb/mysql-test/tokudb/r/card_add_index.result
+++ b/storage/tokudb/mysql-test/tokudb/r/card_add_index.result
@@ -15,32 +15,32 @@ alter table tt add key (b);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
-tt 1 b 1 b A NULL NULL NULL YES BTREE
+tt 1 b 1 b A 4 NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
-tt 1 b 1 b A 1 NULL NULL YES BTREE
+tt 1 b 1 b A 2 NULL NULL YES BTREE
alter table tt add key (c);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
-tt 1 b 1 b A 1 NULL NULL YES BTREE
-tt 1 c 1 c A NULL NULL NULL YES BTREE
+tt 1 b 1 b A 2 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
-tt 1 b 1 b A 1 NULL NULL YES BTREE
-tt 1 c 1 c A 2 NULL NULL YES BTREE
+tt 1 b 1 b A 2 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
flush tables;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
-tt 1 b 1 b A 1 NULL NULL YES BTREE
-tt 1 c 1 c A 2 NULL NULL YES BTREE
+tt 1 b 1 b A 2 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
drop table tt;
diff --git a/storage/tokudb/mysql-test/tokudb/r/card_auto_analyze_lots.result b/storage/tokudb/mysql-test/tokudb/r/card_auto_analyze_lots.result
new file mode 100644
index 00000000000..662ffbade25
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/r/card_auto_analyze_lots.result
@@ -0,0 +1,805 @@
+SHOW INDEX FROM ar_200;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_200 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_200 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_199;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_199 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_199 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_198;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_198 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_198 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_197;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_197 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_197 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_196;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_196 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_196 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_195;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_195 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_195 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_194;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_194 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_194 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_193;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_193 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_193 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_192;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_192 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_192 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_191;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_191 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_191 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_190;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_190 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_190 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_189;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_189 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_189 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_188;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_188 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_188 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_187;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_187 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_187 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_186;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_186 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_186 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_185;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_185 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_185 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_184;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_184 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_184 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_183;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_183 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_183 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_182;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_182 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_182 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_181;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_181 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_181 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_180;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_180 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_180 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_179;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_179 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_179 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_178;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_178 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_178 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_177;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_177 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_177 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_176;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_176 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_176 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_175;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_175 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_175 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_174;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_174 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_174 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_173;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_173 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_173 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_172;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_172 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_172 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_171;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_171 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_171 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_170;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_170 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_170 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_169;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_169 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_169 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_168;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_168 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_168 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_167;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_167 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_167 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_166;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_166 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_166 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_165;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_165 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_165 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_164;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_164 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_164 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_163;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_163 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_163 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_162;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_162 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_162 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_161;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_161 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_161 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_160;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_160 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_160 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_159;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_159 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_159 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_158;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_158 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_158 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_157;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_157 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_157 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_156;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_156 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_156 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_155;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_155 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_155 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_154;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_154 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_154 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_153;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_153 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_153 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_152;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_152 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_152 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_151;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_151 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_151 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_150;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_150 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_150 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_149;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_149 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_149 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_148;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_148 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_148 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_147;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_147 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_147 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_146;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_146 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_146 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_145;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_145 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_145 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_144;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_144 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_144 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_143;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_143 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_143 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_142;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_142 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_142 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_141;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_141 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_141 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_140;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_140 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_140 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_139;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_139 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_139 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_138;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_138 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_138 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_137;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_137 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_137 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_136;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_136 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_136 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_135;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_135 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_135 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_134;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_134 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_134 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_133;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_133 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_133 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_132;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_132 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_132 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_131;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_131 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_131 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_130;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_130 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_130 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_129;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_129 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_129 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_128;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_128 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_128 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_127;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_127 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_127 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_126;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_126 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_126 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_125;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_125 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_125 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_124;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_124 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_124 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_123;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_123 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_123 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_122;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_122 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_122 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_121;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_121 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_121 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_120;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_120 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_120 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_119;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_119 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_119 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_118;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_118 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_118 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_117;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_117 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_117 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_116;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_116 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_116 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_115;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_115 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_115 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_114;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_114 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_114 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_113;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_113 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_113 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_112;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_112 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_112 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_111;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_111 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_111 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_110;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_110 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_110 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_109;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_109 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_109 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_108;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_108 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_108 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_107;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_107 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_107 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_106;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_106 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_106 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_105;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_105 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_105 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_104;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_104 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_104 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_103;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_103 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_103 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_102;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_102 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_102 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_101;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_101 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_101 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_100;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_100 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_100 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_99;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_99 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_99 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_98;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_98 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_98 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_97;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_97 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_97 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_96;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_96 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_96 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_95;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_95 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_95 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_94;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_94 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_94 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_93;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_93 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_93 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_92;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_92 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_92 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_91;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_91 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_91 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_90;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_90 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_90 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_89;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_89 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_89 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_88;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_88 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_88 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_87;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_87 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_87 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_86;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_86 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_86 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_85;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_85 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_85 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_84;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_84 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_84 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_83;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_83 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_83 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_82;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_82 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_82 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_81;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_81 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_81 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_80;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_80 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_80 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_79;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_79 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_79 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_78;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_78 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_78 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_77;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_77 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_77 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_76;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_76 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_76 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_75;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_75 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_75 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_74;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_74 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_74 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_73;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_73 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_73 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_72;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_72 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_72 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_71;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_71 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_71 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_70;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_70 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_70 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_69;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_69 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_69 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_68;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_68 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_68 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_67;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_67 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_67 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_66;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_66 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_66 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_65;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_65 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_65 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_64;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_64 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_64 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_63;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_63 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_63 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_62;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_62 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_62 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_61;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_61 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_61 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_60;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_60 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_60 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_59;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_59 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_59 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_58;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_58 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_58 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_57;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_57 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_57 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_56;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_56 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_56 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_55;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_55 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_55 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_54;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_54 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_54 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_53;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_53 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_53 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_52;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_52 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_52 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_51;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_51 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_51 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_50;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_50 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_50 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_49;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_49 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_49 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_48;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_48 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_48 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_47;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_47 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_47 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_46;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_46 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_46 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_45;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_45 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_45 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_44;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_44 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_44 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_43;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_43 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_43 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_42;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_42 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_42 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_41;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_41 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_41 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_40;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_40 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_40 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_39;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_39 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_39 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_38;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_38 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_38 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_37;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_37 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_37 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_36;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_36 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_36 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_35;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_35 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_35 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_34;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_34 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_34 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_33;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_33 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_33 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_32;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_32 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_32 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_31;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_31 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_31 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_30;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_30 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_30 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_29;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_29 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_29 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_28;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_28 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_28 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_27;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_27 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_27 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_26;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_26 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_26 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_25;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_25 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_25 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_24;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_24 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_24 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_23;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_23 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_23 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_22;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_22 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_22 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_21;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_21 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_21 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_20;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_20 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_20 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_19;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_19 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_19 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_18;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_18 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_18 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_17;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_17 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_17 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_16;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_16 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_16 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_15;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_15 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_15 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_14;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_14 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_14 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_13;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_13 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_13 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_12;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_12 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_12 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_11;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_11 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_11 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_10;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_10 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_10 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_9;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_9 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_9 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_8;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_8 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_8 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_7;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_7 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_7 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_6;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_6 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_6 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_5;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_5 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_5 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_4;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_4 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_4 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_3;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_3 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_3 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_2;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_2 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_2 1 bkey 1 b A 1 NULL NULL YES BTREE
+SHOW INDEX FROM ar_1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+ar_1 0 PRIMARY 1 a A 1 NULL NULL BTREE
+ar_1 1 bkey 1 b A 1 NULL NULL YES BTREE
+SET SESSION tokudb_auto_analyze = @orig_auto_analyze;
+SET SESSION tokudb_analyze_in_background = @orig_in_background;
+SET SESSION tokudb_analyze_mode = @orig_mode;
+SET SESSION tokudb_analyze_throttle = @orig_throttle;
+SET SESSION tokudb_analyze_time = @orig_time;
diff --git a/storage/tokudb/mysql-test/tokudb/r/card_drop_index.result b/storage/tokudb/mysql-test/tokudb/r/card_drop_index.result
index 9fc8fb6a6b8..2cfdfe11296 100644
--- a/storage/tokudb/mysql-test/tokudb/r/card_drop_index.result
+++ b/storage/tokudb/mysql-test/tokudb/r/card_drop_index.result
@@ -5,21 +5,21 @@ insert into tt values (1,0,0),(2,0,0),(3,0,1),(4,0,1);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
-tt 1 b 1 b A NULL NULL NULL YES BTREE
-tt 1 c 1 c A NULL NULL NULL YES BTREE
+tt 1 b 1 b A 4 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
-tt 1 b 1 b A 1 NULL NULL YES BTREE
-tt 1 c 1 c A 2 NULL NULL YES BTREE
+tt 1 b 1 b A 2 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
alter table tt drop key b;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
-tt 1 c 1 c A 2 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
alter table tt drop key c;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
diff --git a/storage/tokudb/mysql-test/tokudb/r/card_drop_index_2.result b/storage/tokudb/mysql-test/tokudb/r/card_drop_index_2.result
index 4103a37a6ed..ed28d2a3226 100644
--- a/storage/tokudb/mysql-test/tokudb/r/card_drop_index_2.result
+++ b/storage/tokudb/mysql-test/tokudb/r/card_drop_index_2.result
@@ -132,21 +132,21 @@ count(*)
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 500 NULL NULL BTREE
-tt 1 b 1 b A NULL NULL NULL YES BTREE
-tt 1 c 1 c A NULL NULL NULL YES BTREE
+tt 1 b 1 b A 500 NULL NULL YES BTREE
+tt 1 c 1 c A 500 NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 500 NULL NULL BTREE
-tt 1 b 1 b A 125 NULL NULL YES BTREE
-tt 1 c 1 c A 1 NULL NULL YES BTREE
+tt 1 b 1 b A 250 NULL NULL YES BTREE
+tt 1 c 1 c A 2 NULL NULL YES BTREE
alter table tt drop key b;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 500 NULL NULL BTREE
-tt 1 c 1 c A 1 NULL NULL YES BTREE
+tt 1 c 1 c A 2 NULL NULL YES BTREE
alter table tt drop key c;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
diff --git a/storage/tokudb/mysql-test/tokudb/r/card_drop_pk.result b/storage/tokudb/mysql-test/tokudb/r/card_drop_pk.result
index bdbd9a3f097..2369d88c274 100644
--- a/storage/tokudb/mysql-test/tokudb/r/card_drop_pk.result
+++ b/storage/tokudb/mysql-test/tokudb/r/card_drop_pk.result
@@ -5,24 +5,24 @@ insert into tt values (1,0,0),(2,0,0),(3,0,1),(4,0,1);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
-tt 1 b 1 b A NULL NULL NULL YES BTREE
-tt 1 c 1 c A NULL NULL NULL YES BTREE
+tt 1 b 1 b A 4 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
-tt 1 b 1 b A 1 NULL NULL YES BTREE
-tt 1 c 1 c A 2 NULL NULL YES BTREE
+tt 1 b 1 b A 2 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
alter table tt drop primary key;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-tt 1 b 1 b A NULL NULL NULL YES BTREE
-tt 1 c 1 c A NULL NULL NULL YES BTREE
+tt 1 b 1 b A 4 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
flush tables;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-tt 1 b 1 b A NULL NULL NULL YES BTREE
-tt 1 c 1 c A NULL NULL NULL YES BTREE
+tt 1 b 1 b A 4 NULL NULL YES BTREE
+tt 1 c 1 c A 4 NULL NULL YES BTREE
drop table tt;
diff --git a/storage/tokudb/mysql-test/tokudb/r/card_pk_2.result b/storage/tokudb/mysql-test/tokudb/r/card_pk_2.result
index dd850df9a89..3c1b652db15 100644
--- a/storage/tokudb/mysql-test/tokudb/r/card_pk_2.result
+++ b/storage/tokudb/mysql-test/tokudb/r/card_pk_2.result
@@ -4,18 +4,18 @@ create table tt (a int, b int, primary key(a,b));
insert into tt values (0,0),(0,1),(1,0),(1,1);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-tt 0 PRIMARY 1 a A NULL NULL NULL BTREE
+tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
tt 0 PRIMARY 2 b A 4 NULL NULL BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-tt 0 PRIMARY 1 a A 2 NULL NULL BTREE
+tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
tt 0 PRIMARY 2 b A 4 NULL NULL BTREE
flush tables;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-tt 0 PRIMARY 1 a A 2 NULL NULL BTREE
+tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
tt 0 PRIMARY 2 b A 4 NULL NULL BTREE
drop table tt;
diff --git a/storage/tokudb/mysql-test/tokudb/r/card_pk_sk.result b/storage/tokudb/mysql-test/tokudb/r/card_pk_sk.result
index 5458f19de32..02c8d1f8218 100644
--- a/storage/tokudb/mysql-test/tokudb/r/card_pk_sk.result
+++ b/storage/tokudb/mysql-test/tokudb/r/card_pk_sk.result
@@ -1004,7 +1004,7 @@ insert into tt values (4*999,4*999+1),(4*999+1,4*999+2),(4*999+2,4*999+3),(4*999
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE
-tt 1 b 1 b A NULL NULL NULL YES BTREE
+tt 1 b 1 b A 4000 NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
@@ -2022,17 +2022,17 @@ insert into tt values (4*999,0),(4*999+1,0),(4*999+2,0),(4*999+3,0);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE
-tt 1 b 1 b A NULL NULL NULL YES BTREE
+tt 1 b 1 b A 4000 NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE
-tt 1 b 1 b A 1 NULL NULL YES BTREE
+tt 1 b 1 b A 2 NULL NULL YES BTREE
flush tables;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE
-tt 1 b 1 b A 1 NULL NULL YES BTREE
+tt 1 b 1 b A 2 NULL NULL YES BTREE
drop table tt;
diff --git a/storage/tokudb/mysql-test/tokudb/r/card_scale_percent.result b/storage/tokudb/mysql-test/tokudb/r/card_scale_percent.result
new file mode 100644
index 00000000000..cfd7e38179c
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/r/card_scale_percent.result
@@ -0,0 +1,42 @@
+set global tokudb_cardinality_scale_percent = 10;
+analyze table tt;
+Table Op Msg_type Msg_text
+test.tt analyze status OK
+show indexes from tt;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE
+tt 1 b 1 b A 4000 NULL NULL YES BTREE
+tt 1 c 1 c A 4000 NULL NULL YES BTREE
+tt 1 d 1 d A 4000 NULL NULL YES BTREE
+set global tokudb_cardinality_scale_percent = 50;
+analyze table tt;
+Table Op Msg_type Msg_text
+test.tt analyze status OK
+show indexes from tt;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE
+tt 1 b 1 b A 4000 NULL NULL YES BTREE
+tt 1 c 1 c A 4000 NULL NULL YES BTREE
+tt 1 d 1 d A 2000 NULL NULL YES BTREE
+set global tokudb_cardinality_scale_percent = 100;
+analyze table tt;
+Table Op Msg_type Msg_text
+test.tt analyze status OK
+show indexes from tt;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE
+tt 1 b 1 b A 4000 NULL NULL YES BTREE
+tt 1 c 1 c A 2000 NULL NULL YES BTREE
+tt 1 d 1 d A 1000 NULL NULL YES BTREE
+set global tokudb_cardinality_scale_percent = 200;
+Warnings:
+Warning 1292 Truncated incorrect tokudb_cardinality_scale_percent value: '200'
+analyze table tt;
+Table Op Msg_type Msg_text
+test.tt analyze status OK
+show indexes from tt;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE
+tt 1 b 1 b A 4000 NULL NULL YES BTREE
+tt 1 c 1 c A 2000 NULL NULL YES BTREE
+tt 1 d 1 d A 1000 NULL NULL YES BTREE
diff --git a/storage/tokudb/mysql-test/tokudb/r/card_sk.result b/storage/tokudb/mysql-test/tokudb/r/card_sk.result
index 1846b4e82bc..310fc863a9b 100644
--- a/storage/tokudb/mysql-test/tokudb/r/card_sk.result
+++ b/storage/tokudb/mysql-test/tokudb/r/card_sk.result
@@ -5,15 +5,15 @@ insert into tt values (1,0),(2,1),(3,2),(4,3);
insert into tt values (5,0),(6,1),(7,2),(8,3);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-tt 1 b 1 b A NULL NULL NULL YES BTREE
+tt 1 b 1 b A 8 NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-tt 1 b 1 b A 4 NULL NULL YES BTREE
+tt 1 b 1 b A 8 NULL NULL YES BTREE
flush tables;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-tt 1 b 1 b A 4 NULL NULL YES BTREE
+tt 1 b 1 b A 8 NULL NULL YES BTREE
drop table tt;
diff --git a/storage/tokudb/mysql-test/tokudb/r/card_sk_2.result b/storage/tokudb/mysql-test/tokudb/r/card_sk_2.result
index c087bad3b18..8ff57b63e5d 100644
--- a/storage/tokudb/mysql-test/tokudb/r/card_sk_2.result
+++ b/storage/tokudb/mysql-test/tokudb/r/card_sk_2.result
@@ -4,18 +4,18 @@ create table tt (a int, b int, key(a,b));
insert into tt values (0,0),(0,1),(1,0),(1,1);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-tt 1 a 1 a A NULL NULL NULL YES BTREE
-tt 1 a 2 b A NULL NULL NULL YES BTREE
+tt 1 a 1 a A 4 NULL NULL YES BTREE
+tt 1 a 2 b A 4 NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-tt 1 a 1 a A 2 NULL NULL YES BTREE
+tt 1 a 1 a A 4 NULL NULL YES BTREE
tt 1 a 2 b A 4 NULL NULL YES BTREE
flush tables;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-tt 1 a 1 a A 2 NULL NULL YES BTREE
+tt 1 a 1 a A 4 NULL NULL YES BTREE
tt 1 a 2 b A 4 NULL NULL YES BTREE
drop table tt;
diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-0.result b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-0.result
index 1e0935543dc..9e524df3276 100644
--- a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-0.result
+++ b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-0.result
@@ -1042,5 +1042,5 @@ t CREATE TABLE `t` (
explain select straight_join * from s,t where s.b = t.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE s index b b 5 NULL 1000 Using where; Using index
-1 SIMPLE t ref b b 5 test.s.b 11 Using index
+1 SIMPLE t ref b b 5 test.s.b 1 Using index
drop table s,t;
diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-1.result b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-1.result
index 9337718ce35..1aeb40d182a 100644
--- a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-1.result
+++ b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-1.result
@@ -1042,7 +1042,7 @@ t CREATE TABLE `t` (
explain select straight_join * from s,t where s.b = t.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE s ALL b NULL NULL NULL 1000 Using where
-1 SIMPLE t ref b b 5 test.s.b 11
+1 SIMPLE t ref b b 5 test.s.b 1
alter table s add key(b) clustering=yes;
Warnings:
Note 1831 Duplicate index 'b_2' defined on the table 'test.s'. This is deprecated and will be disallowed in a future release.
@@ -1092,7 +1092,7 @@ t CREATE TABLE `t` (
explain select straight_join * from s,t where s.b = t.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE s index b_2 b_2 5 NULL 1000 Using where; Using index
-1 SIMPLE t ref b_2 b_2 5 test.s.b 11 Using index
+1 SIMPLE t ref b_2 b_2 5 test.s.b 1 Using index
alter table s add key(b);
Warnings:
Note 1831 Duplicate index 'b' defined on the table 'test.s'. This is deprecated and will be disallowed in a future release.
diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-2.result b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-2.result
index 710509b2acf..9fdb28404c7 100644
--- a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-2.result
+++ b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-2.result
@@ -1042,7 +1042,7 @@ t CREATE TABLE `t` (
explain select straight_join s.a,t.a from s,t where s.b = t.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE s ALL b NULL NULL NULL 1000 Using where
-1 SIMPLE t ref b b 5 test.s.b 11
+1 SIMPLE t ref b b 5 test.s.b 1
alter table s add key(b,a);
alter table t add key(b,a);
show create table s;
@@ -1066,7 +1066,7 @@ t CREATE TABLE `t` (
explain select straight_join s.a,t.a from s,t where s.b = t.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE s index b,b_2 b_2 10 NULL 1000 Using where; Using index
-1 SIMPLE t ref b,b_2 b_2 5 test.s.b 11 Using index
+1 SIMPLE t ref b,b_2 b_2 5 test.s.b 1 Using index
alter table s add key(b) clustering=yes;
Warnings:
Note 1831 Duplicate index 'b_3' defined on the table 'test.s'. This is deprecated and will be disallowed in a future release.
@@ -1096,7 +1096,7 @@ t CREATE TABLE `t` (
explain select straight_join s.a,t.a from s,t where s.b = t.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE s index b,b_2,b_3 b_2 10 NULL 1000 Using where; Using index
-1 SIMPLE t ref b,b_2,b_3 b_3 5 test.s.b 1 Using index
+1 SIMPLE t ref b,b_2,b_3 b_2 5 test.s.b 1 Using index
alter table s drop key b_2;
alter table t drop key b_2;
show create table s;
diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-3.result b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-3.result
index 660d63c54c8..eec0e67ef30 100644
--- a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-3.result
+++ b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-3.result
@@ -1062,8 +1062,8 @@ u CREATE TABLE `u` (
explain select straight_join * from s,t,u where s.b = t.b and s.c = u.c;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE s ALL b NULL NULL NULL 1000 Using where
-1 SIMPLE t ref b b 5 test.s.b 11
-1 SIMPLE u ref c c 5 test.s.c 11
+1 SIMPLE t ref b b 5 test.s.b 1
+1 SIMPLE u ref c c 5 test.s.c 1
alter table s add key (b) clustering=yes;
Warnings:
Note 1831 Duplicate index 'b_2' defined on the table 'test.s'. This is deprecated and will be disallowed in a future release.
diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_key.result b/storage/tokudb/mysql-test/tokudb/r/cluster_key.result
index 74298d69114..fab288047be 100644
--- a/storage/tokudb/mysql-test/tokudb/r/cluster_key.result
+++ b/storage/tokudb/mysql-test/tokudb/r/cluster_key.result
@@ -1,6 +1,6 @@
SET DEFAULT_STORAGE_ENGINE='tokudb';
DROP TABLE IF EXISTS t1;
-create table t1(a int, b int, c int, d int, primary key(a), key(b) clustering=yes, key (c))engine=tokudb;
+create table t1(a int, b int, c int, d int, primary key(a,b,c), key(b) clustering=yes, key (c))engine=tokudb;
insert into t1 values (1,10,100,1000),(2,20,200,2000),(3,30,300,3000),(4,40,400,4000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(9,90,900,9000);
explain select * from t1 where a > 5;
id select_type table type possible_keys key key_len ref rows Extra
@@ -13,7 +13,7 @@ a b c d
9 90 900 9000
explain select * from t1 where b > 30;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
select * from t1 where b > 30;
a b c d
4 40 400 4000
@@ -24,7 +24,7 @@ a b c d
9 90 900 9000
explain select * from t1 where c > 750;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 5 NULL NULL; Using where
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
select * from t1 where c > 750;
a b c d
8 80 800 8000
@@ -37,7 +37,7 @@ a
9
explain select a,b from t1 where b > 30;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index
+1 SIMPLE t1 index b c 4 NULL NULL; Using where; Using index
select a,b from t1 where b > 30;
a b
4 40
@@ -48,7 +48,7 @@ a b
9 90
explain select a,b from t1 where c > 750;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 5 NULL NULL; Using where
+1 SIMPLE t1 index c c 4 NULL NULL; Using where; Using index
select a,c from t1 where c > 750;
a c
8 800
@@ -69,7 +69,7 @@ a b c d
10 10 10 10
explain select * from t1 where b > 30;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
select * from t1 where b > 30;
a b c d
4 40 400 4000
@@ -80,14 +80,14 @@ a b c d
9 90 900 9000
explain select * from t1 where c > 750;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 5 NULL NULL; Using where
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
select * from t1 where c > 750;
a b c d
8 80 800 8000
9 90 900 9000
explain select b from t1 where b > 30;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
select b from t1 where b > 30;
b
40
@@ -98,13 +98,13 @@ b
90
explain select b from t1 where c > 750;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 5 NULL NULL; Using where
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
select c from t1 where c > 750;
c
800
900
alter table t1 add e varchar(20);
-alter table t1 add primary key (a);
+alter table t1 add primary key (a,b,c);
explain select * from t1 where a > 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where
@@ -117,7 +117,7 @@ a b c d e
10 10 10 10 NULL
explain select * from t1 where b > 30;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
select * from t1 where b > 30;
a b c d e
4 40 400 4000 NULL
@@ -128,7 +128,7 @@ a b c d e
9 90 900 9000 NULL
explain select * from t1 where c > 750;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 5 NULL NULL; Using where
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
select * from t1 where c > 750;
a b c d e
8 80 800 8000 NULL
@@ -142,7 +142,7 @@ a
10
explain select a,b from t1 where b > 30;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index
+1 SIMPLE t1 index b c 4 NULL NULL; Using where; Using index
select a,b from t1 where b > 30;
a b
4 40
@@ -153,7 +153,7 @@ a b
9 90
explain select a,b from t1 where c > 750;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 5 NULL NULL; Using where
+1 SIMPLE t1 index c c 4 NULL NULL; Using where; Using index
select a,c from t1 where c > 750;
a c
8 800
@@ -171,7 +171,7 @@ a b c d e
10 10 10 10 NULL
explain select * from t1 where b > 30;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
select * from t1 where b > 30;
a b c d e
4 40 400 4000 NULL
@@ -182,14 +182,14 @@ a b c d e
9 90 900 9000 NULL
explain select * from t1 where c > 750;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 5 NULL NULL; Using where
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
select * from t1 where c > 750;
a b c d e
8 80 800 8000 NULL
9 90 900 9000 NULL
explain select b from t1 where b > 30;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
select b from t1 where b > 30;
b
40
@@ -200,7 +200,7 @@ b
90
explain select b from t1 where c > 750;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 5 NULL NULL; Using where
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
select c from t1 where c > 750;
c
800
diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_key_part.result b/storage/tokudb/mysql-test/tokudb/r/cluster_key_part.result
index cd8fc340314..6df54cac05a 100644
--- a/storage/tokudb/mysql-test/tokudb/r/cluster_key_part.result
+++ b/storage/tokudb/mysql-test/tokudb/r/cluster_key_part.result
@@ -1,11 +1,22 @@
set default_storage_engine='tokudb';
-drop table if exists t;
-create table t (
-x int not null,
-y int not null,
-primary key(x))
-partition by hash(x) partitions 2;
-show create table t;
+DROP TABLE IF EXISTS t;
+CREATE TABLE t (a INT NOT NULL AUTO_INCREMENT, b INT, PRIMARY KEY(a), CLUSTERING KEY b(b)) ENGINE=TokuDB
+PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = TokuDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TokuDB);
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) NOT NULL AUTO_INCREMENT,
+ `b` int(11) DEFAULT NULL,
+ PRIMARY KEY (`a`),
+ CLUSTERING KEY `b` (`b`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (100) ENGINE = TokuDB,
+ PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */
+DROP TABLE t;
+CREATE TABLE t (x INT NOT NULL, y INT NOT NULL, PRIMARY KEY(x))
+PARTITION BY HASH(x) PARTITIONS 2;
+SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`x` int(11) NOT NULL,
@@ -14,8 +25,8 @@ t CREATE TABLE `t` (
) ENGINE=TokuDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (x)
PARTITIONS 2 */
-alter table t add clustering key(y);
-show create table t;
+ALTER TABLE t ADD CLUSTERING KEY(y);
+SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`x` int(11) NOT NULL,
@@ -25,4 +36,625 @@ t CREATE TABLE `t` (
) ENGINE=TokuDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (x)
PARTITIONS 2 */
-drop table t;
+DROP TABLE t;
+CREATE TABLE t1(a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), CLUSTERING KEY(b), KEY (c)) ENGINE=TOKUDB
+PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (5) ENGINE = TOKUDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TOKUDB);
+insert into t1 values (1,10,100,1000),(2,20,200,2000),(3,30,300,3000),(4,40,400,4000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(9,90,900,9000);
+explain select * from t1 where a > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where
+select * from t1 where a > 5;
+a b c d
+6 60 600 6000
+7 70 700 7000
+8 80 800 8000
+9 90 900 9000
+explain select * from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where
+select * from t1 where b > 30;
+a b c d
+4 40 400 4000
+5 50 500 5000
+6 60 600 6000
+7 70 700 7000
+8 80 800 8000
+9 90 900 9000
+explain select * from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select * from t1 where c > 750;
+a b c d
+8 80 800 8000
+9 90 900 9000
+explain select a from t1 where a > 8;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where; Using index
+select a from t1 where a > 8;
+a
+9
+explain select a,b from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
+select a,b from t1 where b > 30;
+a b
+4 40
+5 50
+6 60
+7 70
+8 80
+9 90
+explain select a,b from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index c b 4 NULL NULL; Using where; Using index
+select a,c from t1 where c > 750;
+a c
+8 800
+9 900
+alter table t1 add clustering index bdca(b,d,c,a);
+insert into t1 values (10,10,10,10);
+alter table t1 drop index bdca;
+alter table t1 drop primary key;
+explain select * from t1 where a > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; Using where
+select * from t1 where a > 5;
+a b c d
+6 60 600 6000
+7 70 700 7000
+8 80 800 8000
+9 90 900 9000
+10 10 10 10
+explain select * from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where
+select * from t1 where b > 30;
+a b c d
+4 40 400 4000
+5 50 500 5000
+6 60 600 6000
+7 70 700 7000
+8 80 800 8000
+9 90 900 9000
+explain select * from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select * from t1 where c > 750;
+a b c d
+8 80 800 8000
+9 90 900 9000
+explain select b from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
+select b from t1 where b > 30;
+b
+40
+50
+60
+70
+80
+90
+explain select b from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select c from t1 where c > 750;
+c
+800
+900
+alter table t1 add e varchar(20);
+alter table t1 add primary key (a,b,c);
+explain select * from t1 where a > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where
+select * from t1 where a > 5;
+a b c d e
+6 60 600 6000 NULL
+7 70 700 7000 NULL
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+10 10 10 10 NULL
+explain select * from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where
+select * from t1 where b > 30;
+a b c d e
+4 40 400 4000 NULL
+5 50 500 5000 NULL
+6 60 600 6000 NULL
+7 70 700 7000 NULL
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select * from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select * from t1 where c > 750;
+a b c d e
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select a from t1 where a > 8;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where; Using index
+select a from t1 where a > 8;
+a
+9
+10
+explain select a,b from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
+select a,b from t1 where b > 30;
+a b
+4 40
+5 50
+6 60
+7 70
+8 80
+9 90
+explain select a,b from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where; Using index
+select a,c from t1 where c > 750;
+a c
+8 800
+9 900
+alter table t1 drop primary key;
+explain select * from t1 where a > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; Using where
+select * from t1 where a > 5;
+a b c d e
+6 60 600 6000 NULL
+7 70 700 7000 NULL
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+10 10 10 10 NULL
+explain select * from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where
+select * from t1 where b > 30;
+a b c d e
+4 40 400 4000 NULL
+5 50 500 5000 NULL
+6 60 600 6000 NULL
+7 70 700 7000 NULL
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select * from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select * from t1 where c > 750;
+a b c d e
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select b from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
+select b from t1 where b > 30;
+b
+40
+50
+60
+70
+80
+90
+explain select b from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select c from t1 where c > 750;
+c
+800
+900
+DROP TABLE t1;
+CREATE TABLE t1(a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), CLUSTERING KEY(b), KEY (c)) ENGINE=TOKUDB
+PARTITION BY RANGE(b) (PARTITION p0 VALUES LESS THAN (50) ENGINE = TOKUDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TOKUDB);
+insert into t1 values (1,10,100,1000),(2,20,200,2000),(3,30,300,3000),(4,40,400,4000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(9,90,900,9000);
+explain select * from t1 where a > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where
+select * from t1 where a > 5;
+a b c d
+6 60 600 6000
+7 70 700 7000
+8 80 800 8000
+9 90 900 9000
+explain select * from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where
+select * from t1 where b > 30;
+a b c d
+4 40 400 4000
+5 50 500 5000
+6 60 600 6000
+7 70 700 7000
+8 80 800 8000
+9 90 900 9000
+explain select * from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select * from t1 where c > 750;
+a b c d
+8 80 800 8000
+9 90 900 9000
+explain select a from t1 where a > 8;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where; Using index
+select a from t1 where a > 8;
+a
+9
+explain select a,b from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
+select a,b from t1 where b > 30;
+a b
+4 40
+5 50
+6 60
+7 70
+8 80
+9 90
+explain select a,b from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index c b 4 NULL NULL; Using where; Using index
+select a,c from t1 where c > 750;
+a c
+8 800
+9 900
+alter table t1 add clustering index bdca(b,d,c,a);
+insert into t1 values (10,10,10,10);
+alter table t1 drop index bdca;
+alter table t1 drop primary key;
+explain select * from t1 where a > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; Using where
+select * from t1 where a > 5;
+a b c d
+10 10 10 10
+6 60 600 6000
+7 70 700 7000
+8 80 800 8000
+9 90 900 9000
+explain select * from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where
+select * from t1 where b > 30;
+a b c d
+4 40 400 4000
+5 50 500 5000
+6 60 600 6000
+7 70 700 7000
+8 80 800 8000
+9 90 900 9000
+explain select * from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select * from t1 where c > 750;
+a b c d
+8 80 800 8000
+9 90 900 9000
+explain select b from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
+select b from t1 where b > 30;
+b
+40
+50
+60
+70
+80
+90
+explain select b from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select c from t1 where c > 750;
+c
+800
+900
+alter table t1 add e varchar(20);
+alter table t1 add primary key (a,b,c);
+explain select * from t1 where a > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where
+select * from t1 where a > 5;
+a b c d e
+10 10 10 10 NULL
+6 60 600 6000 NULL
+7 70 700 7000 NULL
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select * from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where
+select * from t1 where b > 30;
+a b c d e
+4 40 400 4000 NULL
+5 50 500 5000 NULL
+6 60 600 6000 NULL
+7 70 700 7000 NULL
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select * from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select * from t1 where c > 750;
+a b c d e
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select a from t1 where a > 8;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where; Using index
+select a from t1 where a > 8;
+a
+10
+9
+explain select a,b from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
+select a,b from t1 where b > 30;
+a b
+4 40
+5 50
+6 60
+7 70
+8 80
+9 90
+explain select a,b from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index c b 4 NULL NULL; Using where; Using index
+select a,c from t1 where c > 750;
+a c
+8 800
+9 900
+alter table t1 drop primary key;
+explain select * from t1 where a > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; Using where
+select * from t1 where a > 5;
+a b c d e
+10 10 10 10 NULL
+6 60 600 6000 NULL
+7 70 700 7000 NULL
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select * from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where
+select * from t1 where b > 30;
+a b c d e
+4 40 400 4000 NULL
+5 50 500 5000 NULL
+6 60 600 6000 NULL
+7 70 700 7000 NULL
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select * from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select * from t1 where c > 750;
+a b c d e
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select b from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
+select b from t1 where b > 30;
+b
+40
+50
+60
+70
+80
+90
+explain select b from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select c from t1 where c > 750;
+c
+800
+900
+DROP TABLE t1;
+CREATE TABLE t1(a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), CLUSTERING KEY(b), KEY (c)) ENGINE=TOKUDB
+PARTITION BY RANGE(c) (PARTITION p0 VALUES LESS THAN (500) ENGINE = TOKUDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TOKUDB);
+insert into t1 values (1,10,100,1000),(2,20,200,2000),(3,30,300,3000),(4,40,400,4000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(9,90,900,9000);
+explain select * from t1 where a > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where
+select * from t1 where a > 5;
+a b c d
+6 60 600 6000
+7 70 700 7000
+8 80 800 8000
+9 90 900 9000
+explain select * from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where
+select * from t1 where b > 30;
+a b c d
+4 40 400 4000
+5 50 500 5000
+6 60 600 6000
+7 70 700 7000
+8 80 800 8000
+9 90 900 9000
+explain select * from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select * from t1 where c > 750;
+a b c d
+8 80 800 8000
+9 90 900 9000
+explain select a from t1 where a > 8;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where; Using index
+select a from t1 where a > 8;
+a
+9
+explain select a,b from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
+select a,b from t1 where b > 30;
+a b
+4 40
+5 50
+6 60
+7 70
+8 80
+9 90
+explain select a,b from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index c b 4 NULL NULL; Using where; Using index
+select a,c from t1 where c > 750;
+a c
+8 800
+9 900
+alter table t1 add clustering index bdca(b,d,c,a);
+insert into t1 values (10,10,10,10);
+alter table t1 drop index bdca;
+alter table t1 drop primary key;
+explain select * from t1 where a > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; Using where
+select * from t1 where a > 5;
+a b c d
+10 10 10 10
+6 60 600 6000
+7 70 700 7000
+8 80 800 8000
+9 90 900 9000
+explain select * from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where
+select * from t1 where b > 30;
+a b c d
+4 40 400 4000
+5 50 500 5000
+6 60 600 6000
+7 70 700 7000
+8 80 800 8000
+9 90 900 9000
+explain select * from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select * from t1 where c > 750;
+a b c d
+8 80 800 8000
+9 90 900 9000
+explain select b from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
+select b from t1 where b > 30;
+b
+40
+50
+60
+70
+80
+90
+explain select b from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select c from t1 where c > 750;
+c
+800
+900
+alter table t1 add e varchar(20);
+alter table t1 add primary key (a,b,c);
+explain select * from t1 where a > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where
+select * from t1 where a > 5;
+a b c d e
+10 10 10 10 NULL
+6 60 600 6000 NULL
+7 70 700 7000 NULL
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select * from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where
+select * from t1 where b > 30;
+a b c d e
+4 40 400 4000 NULL
+5 50 500 5000 NULL
+6 60 600 6000 NULL
+7 70 700 7000 NULL
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select * from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select * from t1 where c > 750;
+a b c d e
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select a from t1 where a > 8;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where; Using index
+select a from t1 where a > 8;
+a
+10
+9
+explain select a,b from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
+select a,b from t1 where b > 30;
+a b
+4 40
+5 50
+6 60
+7 70
+8 80
+9 90
+explain select a,b from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index c b 4 NULL NULL; Using where; Using index
+select a,c from t1 where c > 750;
+a c
+8 800
+9 900
+alter table t1 drop primary key;
+explain select * from t1 where a > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; Using where
+select * from t1 where a > 5;
+a b c d e
+10 10 10 10 NULL
+6 60 600 6000 NULL
+7 70 700 7000 NULL
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select * from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where
+select * from t1 where b > 30;
+a b c d e
+4 40 400 4000 NULL
+5 50 500 5000 NULL
+6 60 600 6000 NULL
+7 70 700 7000 NULL
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select * from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select * from t1 where c > 750;
+a b c d e
+8 80 800 8000 NULL
+9 90 900 9000 NULL
+explain select b from t1 where b > 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index
+select b from t1 where b > 30;
+b
+40
+50
+60
+70
+80
+90
+explain select b from t1 where c > 750;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range c c 4 NULL NULL; Using where
+select c from t1 where c > 750;
+c
+800
+900
+DROP TABLE t1;
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 190581eddae..6f9592ddc1f 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
@@ -10,8 +10,10 @@ 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
set autocommit=0;
set tokudb_prelock_empty=OFF;
+set tokudb_lock_timeout=600000;
insert into t values (1);
set autocommit=0;
+set tokudb_lock_timeout=600000;
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 locks_table_schema locks_table_name locks_table_dictionary_name
@@ -38,9 +40,11 @@ locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right lo
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
set autocommit=0;
+set tokudb_lock_timeout=600000;
set tokudb_prelock_empty=OFF;
replace into t values (1);
set autocommit=0;
+set tokudb_lock_timeout=600000;
replace 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 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 13cdad7a438..ce8f7d2d7ec 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
@@ -12,7 +12,9 @@ set autocommit=0;
set tokudb_prelock_empty=OFF;
insert into t values (1);
set autocommit=0;
-insert into t values (1);
+set tokudb_prelock_empty=OFF;
+set tokudb_lock_timeout=60000;
+replace 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 locks_table_schema locks_table_name locks_table_dictionary_name
TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main
diff --git a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result
index a07f7ba52fe..070f42b30de 100644
--- a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result
+++ b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result
@@ -3,8 +3,8 @@ 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 locks_table_schema locks_table_name locks_table_dictionary_name
+select locks_dname,locks_key_left,locks_key_right,locks_table_schema,locks_table_name,locks_table_dictionary_name from information_schema.tokudb_locks where locks_table_schema='test' and locks_table_name='t' and locks_table_dictionary_name='main' order by locks_key_left, locks_key_right;
+locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name
insert into t values (1);
insert into t values (3);
insert into t values (5);
@@ -12,17 +12,17 @@ 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_key_left;
-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
-TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main
-TRX_ID MYSQL_ID ./test/t-main 0003000000 0003000000 test t main
-TRX_ID MYSQL_ID ./test/t-main 0005000000 0005000000 test t main
-TRX_ID MYSQL_ID ./test/t-main 0002000000 0002000000 test t main
-TRX_ID MYSQL_ID ./test/t-main 0004000000 0004000000 test t main
-TRX_ID MYSQL_ID ./test/t-main 0006000000 0006000000 test t main
+select locks_dname,locks_key_left,locks_key_right,locks_table_schema,locks_table_name,locks_table_dictionary_name from information_schema.tokudb_locks where locks_table_schema='test' and locks_table_name='t' and locks_table_dictionary_name='main' order by locks_key_left, locks_key_right;
+locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name
+./test/t-main 0001000000 0001000000 test t main
+./test/t-main 0002000000 0002000000 test t main
+./test/t-main 0003000000 0003000000 test t main
+./test/t-main 0004000000 0004000000 test t main
+./test/t-main 0005000000 0005000000 test t main
+./test/t-main 0006000000 0006000000 test t main
commit;
commit;
-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
+select locks_dname,locks_key_left,locks_key_right,locks_table_schema,locks_table_name,locks_table_dictionary_name from information_schema.tokudb_locks where locks_table_schema='test' and locks_table_name='t' and locks_table_dictionary_name='main' order by locks_key_left, locks_key_right;
+locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name
commit;
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks_released.result b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks_released.result
index 0a5862e9322..aa58437fc69 100644
--- a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks_released.result
+++ b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks_released.result
@@ -9,6 +9,8 @@ set autocommit=0;
set tokudb_prelock_empty=OFF;
insert into t values (1);
set autocommit=0;
+set tokudb_prelock_empty=OFF;
+set tokudb_lock_timeout=600000;
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 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 63e4816e16e..3a9a936a7a6 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,26 @@
set default_storage_engine='tokudb';
set tokudb_prelock_empty=false;
drop table if exists t;
-select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
+select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id());
trx_id trx_mysql_thread_id
set autocommit=0;
create table t (id int primary key);
insert into t values (1);
-select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
-trx_id trx_mysql_thread_id
-TXN_ID_DEFAULT CLIENT_ID_DEFAULT
+select count(trx_mysql_thread_id) from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id());
+count(trx_mysql_thread_id)
+1
commit;
-select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
+select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id());
trx_id trx_mysql_thread_id
set autocommit=0;
insert into t values (2);
-select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
-trx_id trx_mysql_thread_id
-TXN_ID_A CLIENT_ID_A
+select count(trx_mysql_thread_id) from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id());
+count(trx_mysql_thread_id)
+1
+select count(trx_mysql_thread_id) from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id());
+count(trx_mysql_thread_id)
+0
commit;
-select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
+select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id());
trx_id trx_mysql_thread_id
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/r/type_bit.result b/storage/tokudb/mysql-test/tokudb/r/type_bit.result
index a5587de9e54..c147c203d43 100644
--- a/storage/tokudb/mysql-test/tokudb/r/type_bit.result
+++ b/storage/tokudb/mysql-test/tokudb/r/type_bit.result
@@ -675,7 +675,7 @@ INSERT INTO t1(a) VALUES
(65535),(65525),(65535),(65535),(65535),(65535),(65535),(65535),(65535),(65535);
EXPLAIN SELECT 1 FROM t1 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL a 3 NULL 6 Using index for group-by
+1 SIMPLE t1 index NULL a 3 NULL 10 Using index
SELECT 1 FROM t1 GROUP BY a;
1
1
diff --git a/storage/tokudb/mysql-test/tokudb/t/background_job_manager.opt b/storage/tokudb/mysql-test/tokudb/t/background_job_manager.opt
new file mode 100644
index 00000000000..3cc9ea3009e
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/t/background_job_manager.opt
@@ -0,0 +1 @@
+--tokudb-background-job-status
diff --git a/storage/tokudb/mysql-test/tokudb/t/background_job_manager.test b/storage/tokudb/mysql-test/tokudb/t/background_job_manager.test
new file mode 100644
index 00000000000..933814442e0
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/t/background_job_manager.test
@@ -0,0 +1,139 @@
+# This is a comprehensive test for the background job manager and
+# the information_schema.tokudb_background_job_status table
+#
+# This test validates that analyze table in various modes operate as expected
+# for both foreground and background jobs.
+#
+# This test is NOT intended to test the actual results of an analysis.
+#
+# This test makes use of a global, debug only tokudb variable
+# tokudb_debug_pause_background_job_manager in order to control the bjm and
+# prevent it from acting on any queued jobs.
+# This variable was necessary since the debug_sync facility requires any thread
+# that is syncing to have a valid THD associated with it, which a background
+# thread would not have. This variable is compiled out of release builds.
+
+-- source include/have_tokudb.inc
+-- source include/have_debug.inc
+
+-- enable_query_log
+
+set @orig_auto_analyze = @@session.tokudb_auto_analyze;
+set @orig_in_background = @@session.tokudb_analyze_in_background;
+set @orig_mode = @@session.tokudb_analyze_mode;
+set @orig_throttle = @@session.tokudb_analyze_throttle;
+set @orig_time = @@session.tokudb_analyze_time;
+set @orig_scale_percent = @@global.tokudb_cardinality_scale_percent;
+set @orig_default_storage_engine = @@session.default_storage_engine;
+set @orig_pause_background_job_manager = @@global.tokudb_debug_pause_background_job_manager;
+
+# first, lets set up to auto analyze in the background with about any activity
+set session default_storage_engine='tokudb';
+set session tokudb_auto_analyze=1;
+set session tokudb_analyze_in_background=1;
+set session tokudb_analyze_mode=tokudb_analyze_standard;
+set session tokudb_analyze_throttle=0;
+set session tokudb_analyze_time=0;
+set global tokudb_cardinality_scale_percent=DEFAULT;
+
+# in debug build, we can prevent the background job manager from running,
+# let's do it so we can see that there was an analyze scheduled on the first
+# insert
+set global tokudb_debug_pause_background_job_manager=TRUE;
+
+# let's see what the i_s table is laid out like
+show create table information_schema.tokudb_background_job_status;
+
+create table t1 (a int not null auto_increment, b int, c int, primary key(a), key kb(b), key kc(c), key kabc(a,b,c), key kab(a,b), key kbc(b,c));
+
+insert into t1(b,c) values(0,0), (1,1), (2,2), (3,3);
+
+# insert above should have triggered an analyze, but since the bjm is paused,
+# we will see it sitting in the queue
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+
+# some more tables
+create table t2 like t1;
+create table t3 like t1;
+create table t4 like t1;
+
+# manually analyze, the t1 should be rejected because there is already a job
+# pending. t2, t3 and t4 should get queued.
+analyze table t1;
+analyze table t2;
+analyze table t3;
+analyze table t4;
+
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+
+# let the bjm go to clear the jobs
+set global tokudb_debug_pause_background_job_manager=FALSE;
+
+# wait for the bjm queue to empty
+-- disable_query_log
+let $wait_condition=select count(*)=0 from information_schema.tokudb_background_job_status;
+-- source include/wait_condition.inc
+-- enable_query_log
+
+# pause the bjm again
+set global tokudb_debug_pause_background_job_manager=TRUE;
+
+# add some new jobs
+analyze table t1;
+analyze table t2;
+analyze table t3;
+analyze table t4;
+
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+
+# alter a table, should kill the job for t1
+alter table t1 add column d int;
+
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+
+# try an explicit cancel on t2
+set session tokudb_analyze_mode=tokudb_analyze_cancel;
+analyze table t2;
+
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+
+# try a recount on t1, should reschedule a new job
+set session tokudb_analyze_mode=tokudb_analyze_recount_rows;
+analyze table t1;
+
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+
+# do a foreground analysis that clashes with a background job, it should
+# kill the background job for t3 and perform the analysis immediately
+set session tokudb_analyze_mode=tokudb_analyze_standard;
+set session tokudb_analyze_in_background=0;
+analyze table t3;
+
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+
+# drop the tables, should kill the remaining jobs for t1, and t4
+drop table t1;
+drop table t2;
+drop table t3;
+drop table t4;
+
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+
+# let the bjm go
+set global tokudb_debug_pause_background_job_manager=FALSE;
+
+#cleanup
+-- disable_query_log
+let $wait_condition=select count(*)=0 from information_schema.tokudb_background_job_status;
+-- source include/wait_condition.inc
+
+set session tokudb_auto_analyze = @orig_auto_analyze;
+set session tokudb_analyze_in_background = @orig_in_background;
+set session tokudb_analyze_mode = @orig_mode;
+set session tokudb_analyze_throttle = @orig_throttle;
+set session tokudb_analyze_time = @orig_time;
+set global tokudb_cardinality_scale_percent = @orig_scale_percent;
+set session default_storage_engine = @orig_default_storage_engine;
+set global tokudb_debug_pause_background_job_manager = @orig_pause_background_job_manager;
+
+-- enable_query_log
diff --git a/storage/tokudb/mysql-test/tokudb/t/card_auto_analyze_lots.test b/storage/tokudb/mysql-test/tokudb/t/card_auto_analyze_lots.test
new file mode 100644
index 00000000000..ec74a4a28bc
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/t/card_auto_analyze_lots.test
@@ -0,0 +1,82 @@
+# Test the auto analyze on lots of tables
+-- source include/have_tokudb.inc
+
+-- disable_query_log
+let $max = 200;
+
+SET @orig_auto_analyze = @@session.tokudb_auto_analyze;
+SET @orig_in_background = @@session.tokudb_analyze_in_background;
+SET @orig_mode = @@session.tokudb_analyze_mode;
+SET @orig_throttle = @@session.tokudb_analyze_throttle;
+SET @orig_time = @@session.tokudb_analyze_time;
+
+SET SESSION tokudb_auto_analyze = 1;
+SET SESSION tokudb_analyze_in_background = 0;
+SET SESSION tokudb_analyze_mode = TOKUDB_ANALYZE_STANDARD;
+SET SESSION tokudb_analyze_throttle = 0;
+SET SESSION tokudb_analyze_time = 0;
+
+let $i = $max;
+while ($i > 0) {
+ eval CREATE TABLE ar_$i (a INT, b INT, PRIMARY KEY (a), KEY bkey (b)) ENGINE=TOKUDB;
+ dec $i;
+}
+
+# check that the one row insertion triggered auto analyze within the calling
+# client context, the cardinality should go from NULL to 1
+let $i = $max;
+while ($i > 0) {
+ eval INSERT INTO ar_$i VALUES (0, 0);
+ dec $i;
+}
+-- enable_query_log
+let $i = $max;
+while ($i > 0) {
+ eval SHOW INDEX FROM ar_$i;
+ dec $i;
+}
+
+
+-- disable_query_log
+# check that lots of background analysis get scheduled and run
+# cleanly and serially in the background
+SET SESSION tokudb_auto_analyze = 1;
+SET SESSION tokudb_analyze_in_background = 1;
+SET SESSION tokudb_analyze_mode = TOKUDB_ANALYZE_STANDARD;
+SET SESSION tokudb_analyze_throttle = 0;
+SET SESSION tokudb_analyze_time = 0;
+
+let $i = $max;
+while ($i > 0) {
+ eval INSERT INTO ar_$i VALUES (1, 1), (2, 1), (3, 2), (4, 2);
+ dec $i;
+}
+
+let $i = $max;
+while ($i > 0) {
+ eval INSERT INTO ar_$i VALUES (5, 3), (6, 3), (7, 4), (8, 4);
+ dec $i;
+}
+
+# would be too long to wait for stats to become up to date here and
+# checking is quite non-deterministic, InnoDB test does same thing
+
+# dropping tables should cancel any running background jobs
+let $i = $max;
+while ($i > 0) {
+ eval DROP TABLE ar_$i;
+ dec $i;
+}
+
+# wait for the bjm queue to empty
+-- disable_query_log
+let $wait_condition=select count(*)=0 from information_schema.tokudb_background_job_status;
+-- source include/wait_condition.inc
+
+SET SESSION tokudb_auto_analyze = @orig_auto_analyze;
+SET SESSION tokudb_analyze_in_background = @orig_in_background;
+SET SESSION tokudb_analyze_mode = @orig_mode;
+SET SESSION tokudb_analyze_throttle = @orig_throttle;
+SET SESSION tokudb_analyze_time = @orig_time;
+
+-- enable_query_log
diff --git a/storage/tokudb/mysql-test/tokudb/t/card_scale_percent.test b/storage/tokudb/mysql-test/tokudb/t/card_scale_percent.test
new file mode 100644
index 00000000000..47f1eb37989
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/t/card_scale_percent.test
@@ -0,0 +1,56 @@
+-- source include/have_tokudb.inc
+
+-- disable_query_log
+
+set @orig_throttle = @@session.tokudb_analyze_throttle;
+set @orig_time = @@session.tokudb_analyze_time;
+set @orig_scale_percent = @@global.tokudb_cardinality_scale_percent;
+
+create table tt (a int, b int, c int, d int, primary key(a), key(b), key(c), key(d)) engine=tokudb;
+let $i=0;
+while ($i < 1000) {
+ eval insert into tt values ($i, $i, $i, $i);
+ inc $i;
+}
+while ($i < 2000) {
+ eval insert into tt values ($i, $i, $i, 0);
+ inc $i;
+}
+while ($i < 3000) {
+ eval insert into tt values ($i, $i, 0, 0);
+ inc $i;
+}
+while ($i < 4000) {
+ eval insert into tt values ($i, 0, 0, 0);
+ inc $i;
+}
+
+set session tokudb_analyze_time=0;
+set session tokudb_analyze_throttle=0;
+
+-- enable_query_log
+
+set global tokudb_cardinality_scale_percent = 10;
+analyze table tt;
+show indexes from tt;
+
+set global tokudb_cardinality_scale_percent = 50;
+analyze table tt;
+show indexes from tt;
+
+set global tokudb_cardinality_scale_percent = 100;
+analyze table tt;
+show indexes from tt;
+
+set global tokudb_cardinality_scale_percent = 200;
+analyze table tt;
+show indexes from tt;
+
+-- disable_query_log
+
+drop table tt;
+set session tokudb_analyze_throttle = @orig_throttle;
+set session tokudb_analyze_time = @orig_time;
+set global tokudb_cardinality_scale_percent = @orig_scale_percent;
+
+-- enable_query_log
diff --git a/storage/tokudb/mysql-test/tokudb/t/cluster_key.test b/storage/tokudb/mysql-test/tokudb/t/cluster_key.test
index 9280324b8cc..d491784577e 100644
--- a/storage/tokudb/mysql-test/tokudb/t/cluster_key.test
+++ b/storage/tokudb/mysql-test/tokudb/t/cluster_key.test
@@ -5,140 +5,8 @@ SET DEFAULT_STORAGE_ENGINE='tokudb';
DROP TABLE IF EXISTS t1;
--enable_warnings
-create table t1(a int, b int, c int, d int, primary key(a), key(b) clustering=yes, key (c))engine=tokudb;
+create table t1(a int, b int, c int, d int, primary key(a,b,c), key(b) clustering=yes, key (c))engine=tokudb;
-insert into t1 values (1,10,100,1000),(2,20,200,2000),(3,30,300,3000),(4,40,400,4000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(9,90,900,9000);
-
-
-#normal queries
-
-# ignore rows column
---replace_column 9 NULL;
-explain select * from t1 where a > 5;
-select * from t1 where a > 5;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select * from t1 where b > 30;
-select * from t1 where b > 30;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select * from t1 where c > 750;
-select * from t1 where c > 750;
-
-#covering indexes
-
-# ignore rows column
---replace_column 9 NULL;
-explain select a from t1 where a > 8;
-select a from t1 where a > 8;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select a,b from t1 where b > 30;
-select a,b from t1 where b > 30;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select a,b from t1 where c > 750;
-select a,c from t1 where c > 750;
-
-
-alter table t1 add index bdca(b,d,c,a) clustering=yes;
-insert into t1 values (10,10,10,10);
-alter table t1 drop index bdca;
-
-alter table t1 drop primary key;
-# ignore rows column
---replace_column 9 NULL;
-explain select * from t1 where a > 5;
-select * from t1 where a > 5;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select * from t1 where b > 30;
-select * from t1 where b > 30;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select * from t1 where c > 750;
-select * from t1 where c > 750;
-
-#covering indexes
-
-# ignore rows column
---replace_column 9 NULL;
-explain select b from t1 where b > 30;
-select b from t1 where b > 30;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select b from t1 where c > 750;
-select c from t1 where c > 750;
-
-alter table t1 add e varchar(20);
-
-alter table t1 add primary key (a);
-
-# ignore rows column
---replace_column 9 NULL;
-explain select * from t1 where a > 5;
-select * from t1 where a > 5;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select * from t1 where b > 30;
-select * from t1 where b > 30;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select * from t1 where c > 750;
-select * from t1 where c > 750;
-
-#covering indexes
-
-# ignore rows column
---replace_column 9 NULL;
-explain select a from t1 where a > 8;
-select a from t1 where a > 8;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select a,b from t1 where b > 30;
-select a,b from t1 where b > 30;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select a,b from t1 where c > 750;
-select a,c from t1 where c > 750;
-
-
-alter table t1 drop primary key;
-# ignore rows column
---replace_column 9 NULL;
-explain select * from t1 where a > 5;
-select * from t1 where a > 5;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select * from t1 where b > 30;
-select * from t1 where b > 30;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select * from t1 where c > 750;
-select * from t1 where c > 750;
-
-#covering indexes
-# ignore rows column
---replace_column 9 NULL;
-explain select b from t1 where b > 30;
-select b from t1 where b > 30;
-
-# ignore rows column
---replace_column 9 NULL;
-explain select b from t1 where c > 750;
-select c from t1 where c > 750;
+--source ../include/cluster_key.inc
drop table t1;
diff --git a/storage/tokudb/mysql-test/tokudb/t/cluster_key_part.test b/storage/tokudb/mysql-test/tokudb/t/cluster_key_part.test
index 8da7aa1078f..310866d14bc 100644
--- a/storage/tokudb/mysql-test/tokudb/t/cluster_key_part.test
+++ b/storage/tokudb/mysql-test/tokudb/t/cluster_key_part.test
@@ -5,19 +5,47 @@ source include/have_partition.inc;
set default_storage_engine='tokudb';
disable_warnings;
-drop table if exists t;
+DROP TABLE IF EXISTS t;
enable_warnings;
-create table t (
- x int not null,
- y int not null,
- primary key(x))
-partition by hash(x) partitions 2;
+CREATE TABLE t (a INT NOT NULL AUTO_INCREMENT, b INT, PRIMARY KEY(a), KEY b(b) CLUSTERING=YES) ENGINE=TokuDB
+PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = TokuDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TokuDB);
-show create table t;
+SHOW CREATE TABLE t;
-alter table t add key(y) clustering=yes;
+DROP TABLE t;
-show create table t;
-drop table t;
+
+CREATE TABLE t (x INT NOT NULL, y INT NOT NULL, PRIMARY KEY(x))
+PARTITION BY HASH(x) PARTITIONS 2;
+
+SHOW CREATE TABLE t;
+
+ALTER TABLE t ADD KEY(y) CLUSTERING=YES;
+
+SHOW CREATE TABLE t;
+
+DROP TABLE t;
+
+
+CREATE TABLE t1(a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), KEY(b) CLUSTERING=YES, KEY (c)) ENGINE=TOKUDB
+PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (5) ENGINE = TOKUDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TOKUDB);
+
+--source ../include/cluster_key.inc
+
+DROP TABLE t1;
+
+CREATE TABLE t1(a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), KEY(b) CLUSTERING=YES, KEY (c)) ENGINE=TOKUDB
+PARTITION BY RANGE(b) (PARTITION p0 VALUES LESS THAN (50) ENGINE = TOKUDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TOKUDB);
+
+--source ../include/cluster_key.inc
+
+DROP TABLE t1;
+
+CREATE TABLE t1(a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), KEY(b) CLUSTERING=YES, KEY (c)) ENGINE=TOKUDB
+PARTITION BY RANGE(c) (PARTITION p0 VALUES LESS THAN (500) ENGINE = TOKUDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TOKUDB);
+
+--source ../include/cluster_key.inc
+
+DROP TABLE t1;
diff --git a/storage/tokudb/mysql-test/tokudb/t/disabled.def b/storage/tokudb/mysql-test/tokudb/t/disabled.def
new file mode 100644
index 00000000000..f7413a0edc5
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/t/disabled.def
@@ -0,0 +1,28 @@
+mvcc-19: tokutek
+mvcc-20: tokutek
+mvcc-27: tokutek
+storage_engine_default: tokudb is not the default storage engine
+fast_update_binlog_mixed : https://tokutek.atlassian.net/browse/DB-871
+fast_update_binlog_row : https://tokutek.atlassian.net/browse/DB-871
+fast_update_binlog_statement : https://tokutek.atlassian.net/browse/DB-871
+fast_update_blobs_fixed_varchar : https://tokutek.atlassian.net/browse/DB-871
+fast_update_blobs : https://tokutek.atlassian.net/browse/DB-871
+fast_update_blobs_with_varchar : https://tokutek.atlassian.net/browse/DB-871
+fast_update_char : https://tokutek.atlassian.net/browse/DB-871
+fast_update_deadlock : https://tokutek.atlassian.net/browse/DB-871
+fast_update_decr_floor : https://tokutek.atlassian.net/browse/DB-871
+fast_update_disable_slow_update : https://tokutek.atlassian.net/browse/DB-871
+fast_update_error : https://tokutek.atlassian.net/browse/DB-871
+fast_update_int_bounds : https://tokutek.atlassian.net/browse/DB-871
+fast_update_int : https://tokutek.atlassian.net/browse/DB-871
+fast_update_key : https://tokutek.atlassian.net/browse/DB-871
+fast_update_sqlmode : https://tokutek.atlassian.net/browse/DB-871
+fast_update_uint_bounds : https://tokutek.atlassian.net/browse/DB-871
+fast_update_varchar : https://tokutek.atlassian.net/browse/DB-871
+fast_upsert_bin_pad : https://tokutek.atlassian.net/browse/DB-871
+fast_upsert_char : https://tokutek.atlassian.net/browse/DB-871
+fast_upsert_deadlock : https://tokutek.atlassian.net/browse/DB-871
+fast_upsert_int : https://tokutek.atlassian.net/browse/DB-871
+fast_upsert_key : https://tokutek.atlassian.net/browse/DB-871
+fast_upsert_sqlmode : https://tokutek.atlassian.net/browse/DB-871
+fast_upsert_values : https://tokutek.atlassian.net/browse/DB-871
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 3fd6ddb88fe..012c0af63b5 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
@@ -25,10 +25,12 @@ select * from information_schema.tokudb_lock_waits;
connect (conn_a,localhost,root,,);
set autocommit=0;
set tokudb_prelock_empty=OFF; # disable the bulk loader
+set tokudb_lock_timeout=600000; # set lock wait timeout to 10 minutes
insert into t values (1);
connect (conn_b,localhost,root,,);
set autocommit=0;
+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 1st transaction
@@ -74,11 +76,13 @@ select * from information_schema.tokudb_lock_waits;
connect (conn_a,localhost,root,,);
set autocommit=0;
+set tokudb_lock_timeout=600000; # set lock wait timeout to 10 minutes
set tokudb_prelock_empty=OFF; # disable the bulk loader
replace into t values (1);
connect (conn_b,localhost,root,,);
set autocommit=0;
+set tokudb_lock_timeout=600000; # set lock wait timeout to 10 minutes
send replace into t values (1);
# should find the presence of a lock on 1st transaction
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 06923d4ca58..42fb548814f 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
@@ -21,11 +21,14 @@ insert into t values (1);
connect (conn_b,localhost,root,,);
set autocommit=0;
-send insert into t values (1);
+set tokudb_prelock_empty=OFF;
+set tokudb_lock_timeout=60000; # set lock wait timeout to 1 minute
+
+send replace into t values (1);
# should find the presence of a lock on 1st transaction
connection default;
-let $wait_condition= select count(*)=1 from information_schema.processlist where info='insert into t values (1)' and state='update';
+let $wait_condition= select count(*)=1 from information_schema.processlist where info='replace 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
@@ -41,7 +44,9 @@ replace_column 1 TRX_ID 2 MYSQL_ID;
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
+real_sleep 45; # sleep till we get close to timeout since wait_condidion will timeout @ 30 seconds
+let $wait_condition= select count(*)=0 from information_schema.processlist where info='replace into t values (1)' and state='update';
+source include/wait_condition.inc;
commit;
# verify that the lock on the 1st transaction is released and replaced by the lock for the 2nd transaction
diff --git a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks.test b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks.test
index e5a67559b1a..8f205ad7f45 100644
--- a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks.test
+++ b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks.test
@@ -12,7 +12,7 @@ set autocommit=0;
let $default_id=`select connection_id()`;
# should be empty
-select * from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right,locks_table_schema,locks_table_name,locks_table_dictionary_name from information_schema.tokudb_locks where locks_table_schema='test' and locks_table_name='t' and locks_table_dictionary_name='main' order by locks_key_left, locks_key_right;
insert into t values (1);
insert into t values (3);
@@ -28,8 +28,7 @@ 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,locks_key_left;
+eval select locks_dname,locks_key_left,locks_key_right,locks_table_schema,locks_table_name,locks_table_dictionary_name from information_schema.tokudb_locks where locks_table_schema='test' and locks_table_name='t' and locks_table_dictionary_name='main' order by locks_key_left, locks_key_right;
connection conn_a;
commit;
@@ -37,9 +36,9 @@ connection default;
commit;
# should be empty
-select * from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right,locks_table_schema,locks_table_name,locks_table_dictionary_name from information_schema.tokudb_locks where locks_table_schema='test' and locks_table_name='t' and locks_table_dictionary_name='main' order by locks_key_left, locks_key_right;
commit;
disconnect conn_a;
-drop table t; \ No newline at end of file
+drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test
index 19f413e79f9..bbb0533e784 100644
--- a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test
+++ b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test
@@ -27,6 +27,8 @@ 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);
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 d3c2636ba54..517280391c4 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,35 +8,32 @@ drop table if exists t;
enable_warnings;
# should be empty
-select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
+select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id());
# 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 trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
+select count(trx_mysql_thread_id) from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id());
# should be empty
commit;
-select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
+select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id());
connect(conn_a,localhost,root,,);
-let a_id=`select connection_id()`;
set autocommit=0;
insert into t values (2);
+select count(trx_mysql_thread_id) from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id());
connection default;
-replace_column 1 TXN_ID_A 2 CLIENT_ID_A;
-eval select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
+select count(trx_mysql_thread_id) from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id());
connection conn_a;
commit;
connection default;
# should be empty
-select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
+select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id());
disconnect conn_a;
-drop table t; \ No newline at end of file
+drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/t/suite.opt b/storage/tokudb/mysql-test/tokudb/t/suite.opt
new file mode 100644
index 00000000000..23511b05020
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/t/suite.opt
@@ -0,0 +1 @@
+$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0
diff --git a/storage/tokudb/mysql-test/tokudb_add_index/disabled.def b/storage/tokudb/mysql-test/tokudb_add_index/disabled.def
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/storage/tokudb/mysql-test/tokudb_add_index/disabled.def
+++ /dev/null
diff --git a/storage/tokudb/mysql-test/tokudb_add_index/t/suite.opt b/storage/tokudb/mysql-test/tokudb_add_index/t/suite.opt
new file mode 100644
index 00000000000..23511b05020
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_add_index/t/suite.opt
@@ -0,0 +1 @@
+$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0
diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/disabled.def b/storage/tokudb/mysql-test/tokudb_alter_table/disabled.def
deleted file mode 100644
index 828c5ee216b..00000000000
--- a/storage/tokudb/mysql-test/tokudb_alter_table/disabled.def
+++ /dev/null
@@ -1,6 +0,0 @@
-# alter table
-hcad_tmp_tables: tmp tables bypass hot alter, we run hcad_tmp_tables_56 instead
-hcad_with_locks: how this could work, if alter needs an exclusive mdl lock?
-
-frm_discover_partition: No partition discovery in MariaDB 5.5
-
diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/t/disabled.def b/storage/tokudb/mysql-test/tokudb_alter_table/t/disabled.def
new file mode 100644
index 00000000000..3ea96dac116
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_alter_table/t/disabled.def
@@ -0,0 +1,8 @@
+# alter table
+hcad_tmp_tables: tmp tables bypass hot alter, we run hcad_tmp_tables_56 instead
+hcad_with_locks: cant alter table concurrent with reading a table in 5.5
+
+# virtual columns
+virtual_columns: no virtual columns in MySQL 5.5
+
+frm_discover_partition: needs the tokutek patch for frm discovery for partitioned tables
diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/t/suite.opt b/storage/tokudb/mysql-test/tokudb_alter_table/t/suite.opt
new file mode 100644
index 00000000000..23511b05020
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_alter_table/t/suite.opt
@@ -0,0 +1 @@
+$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0
diff --git a/storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_exclude.result b/storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_exclude.result
new file mode 100644
index 00000000000..0bec62e54f6
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_exclude.result
@@ -0,0 +1,31 @@
+create table t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
+create table t1a(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
+create table t1b(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
+create table t1c(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
+select @@session.tokudb_backup_last_error;
+@@session.tokudb_backup_last_error
+0
+select @@session.tokudb_backup_last_error_string;
+@@session.tokudb_backup_last_error_string
+NULL
+20
+set session tokudb_backup_exclude='(t1a|t1c)+';
+select @@session.tokudb_backup_last_error;
+@@session.tokudb_backup_last_error
+0
+select @@session.tokudb_backup_last_error_string;
+@@session.tokudb_backup_last_error_string
+NULL
+10
+set session tokudb_backup_exclude='t1[abc]+';
+select @@session.tokudb_backup_last_error;
+@@session.tokudb_backup_last_error
+0
+select @@session.tokudb_backup_last_error_string;
+@@session.tokudb_backup_last_error_string
+NULL
+5
+drop table t1;
+drop table t1a;
+drop table t1b;
+drop table t1c;
diff --git a/storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_set_last_error.result b/storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_set_last_error.result
new file mode 100644
index 00000000000..e1baf8418ad
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_set_last_error.result
@@ -0,0 +1,20 @@
+create table t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
+set session tokudb_backup_dir='/aint/no/way/this/exists/here';
+ERROR 42000: Variable 'tokudb_backup_dir' can't be set to the value of '/aint/no/way/this/exists/here'
+select @@session.tokudb_backup_last_error;
+@@session.tokudb_backup_last_error
+2
+select @@session.tokudb_backup_last_error_string;
+@@session.tokudb_backup_last_error_string
+Could not get real path for /aint/no/way/this/exists/here
+set session tokudb_backup_last_error_string='this should not crash the server';
+select @@session.tokudb_backup_last_error_string;
+@@session.tokudb_backup_last_error_string
+this should not crash the server
+set session tokudb_backup_dir='/aint/no/way/this/exists/here';
+ERROR 42000: Variable 'tokudb_backup_dir' can't be set to the value of '/aint/no/way/this/exists/here'
+select @@session.tokudb_backup_last_error_string;
+@@session.tokudb_backup_last_error_string
+Could not get real path for /aint/no/way/this/exists/here
+set session tokudb_backup_last_error_string = @old_backup_last_error_string;
+drop table t1;
diff --git a/storage/tokudb/mysql-test/tokudb_backup/t/suite.opt b/storage/tokudb/mysql-test/tokudb_backup/t/suite.opt
new file mode 100644
index 00000000000..e52bd6327e0
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_backup/t/suite.opt
@@ -0,0 +1 @@
+$TOKUDB_OPT $TOKUDB_LOAD_ADD $TOKUDB_BACKUP_OPT $TOKUDB_BACKUP_LOAD_ADD --loose-tokudb-check-jemalloc=0
diff --git a/storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_exclude.test b/storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_exclude.test
new file mode 100644
index 00000000000..a0ff5152f66
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_exclude.test
@@ -0,0 +1,69 @@
+# This test is to specifically test the TokuDB backup excluse functionality.
+# This is _not_ an illustration of how to exclude tables from a TokuDB backup,
+# if you exclude TokuDB database files in this way, you will have a useless
+# backup.
+source include/have_tokudb_backup.inc;
+
+disable_query_log;
+
+set @old_backup_exclude = @@session.tokudb_backup_exclude;
+
+enable_query_log;
+
+# This should create 20 files prefixed with '_test_t1'
+create table t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
+create table t1a(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
+create table t1b(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
+create table t1c(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
+
+# This should not filter any files
+disable_query_log;
+--exec mkdir $MYSQLTEST_VARDIR/tmp/backup
+--eval set session tokudb_backup_dir='$MYSQLTEST_VARDIR/tmp/backup'
+enable_query_log;
+
+select @@session.tokudb_backup_last_error;
+select @@session.tokudb_backup_last_error_string;
+
+# 20 files should be in the backup set
+--exec ls $MYSQLTEST_VARDIR/tmp/backup/mysql_data_dir | grep -c _test_t1
+
+--exec rm -rf $MYSQLTEST_VARDIR/tmp/backup
+
+
+# This should filter all files for the t1a and t1c tables
+set session tokudb_backup_exclude='(t1a|t1c)+';
+
+disable_query_log;
+--exec mkdir $MYSQLTEST_VARDIR/tmp/backup
+--eval set session tokudb_backup_dir='$MYSQLTEST_VARDIR/tmp/backup'
+enable_query_log;
+
+select @@session.tokudb_backup_last_error;
+select @@session.tokudb_backup_last_error_string;
+
+# 10 files should be in the backup set
+--exec ls $MYSQLTEST_VARDIR/tmp/backup/mysql_data_dir | grep -c _test_t1
+
+--exec rm -rf $MYSQLTEST_VARDIR/tmp/backup
+
+# This should filter all files for the t1a, t1b, and t1c tables
+set session tokudb_backup_exclude='t1[abc]+';
+
+disable_query_log;
+--exec mkdir $MYSQLTEST_VARDIR/tmp/backup
+--eval set session tokudb_backup_dir='$MYSQLTEST_VARDIR/tmp/backup'
+enable_query_log;
+
+select @@session.tokudb_backup_last_error;
+select @@session.tokudb_backup_last_error_string;
+
+# 5 files should be in the backup set
+--exec ls $MYSQLTEST_VARDIR/tmp/backup/mysql_data_dir | grep -c _test_t1
+
+--exec rm -rf $MYSQLTEST_VARDIR/tmp/backup
+
+drop table t1;
+drop table t1a;
+drop table t1b;
+drop table t1c;
diff --git a/storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_set_last_error.test b/storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_set_last_error.test
new file mode 100644
index 00000000000..18fc8cc5efb
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_set_last_error.test
@@ -0,0 +1,32 @@
+# This test validates that the plugin will not crash if a user sets
+# tokudb_backup_last_error_string after performing a backup.
+source include/have_tokudb_backup.inc;
+
+disable_query_log;
+
+set @old_backup_last_error_string = @@session.tokudb_backup_last_error_string;
+
+enable_query_log;
+
+create table t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
+
+# this should fail and set the error string since the dummy directory
+# doesn't exist
+--error ER_WRONG_VALUE_FOR_VAR
+--eval set session tokudb_backup_dir='/aint/no/way/this/exists/here'
+
+select @@session.tokudb_backup_last_error;
+select @@session.tokudb_backup_last_error_string;
+
+set session tokudb_backup_last_error_string='this should not crash the server';
+select @@session.tokudb_backup_last_error_string;
+
+# this should fail again and set the error string since the dummy directory
+# doesn't exist
+--error ER_WRONG_VALUE_FOR_VAR
+--eval set session tokudb_backup_dir='/aint/no/way/this/exists/here'
+select @@session.tokudb_backup_last_error_string;
+
+set session tokudb_backup_last_error_string = @old_backup_last_error_string;
+
+drop table t1;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/disabled.def b/storage/tokudb/mysql-test/tokudb_bugs/disabled.def
index 068cbb413e0..d0d1a47e006 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/disabled.def
+++ b/storage/tokudb/mysql-test/tokudb_bugs/disabled.def
@@ -1,14 +1,2 @@
-memcache_dirty : #4609 memcache patch from facebook not ported to mysql 5.5
-4472 : #4521 MDL for alter table in 5.5 prohibits this test from having any chance of working
-
-tokudb_drop_part_table_668: no tokudb test data in mariadb tree
-tokudb_drop_simple_table_668: no tokudb test data in mariadb tree
5585: times out, too many huge insert...selects
-fileops-3: how this could work, if alter needs an exclusive mdl lock?
-6053: tokudb is not the default storage engine
-
-checkpoint_lock_2: test can not work when the checkpoint_safe_lock is a fair rwlock
-
-# this test was added in 7.5.4 and fails in 10.0
-# but running this very test in 7.5.3 fails in exactly the same manner
-db768: never worked. tokutek was informed, 2015-01-14
+db233: different execution path in mariadb, debug_sync point is not hit
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/5585.result b/storage/tokudb/mysql-test/tokudb_bugs/r/5585.result
index 608afa00370..1008764148b 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/5585.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/5585.result
@@ -10,12 +10,6 @@ insert into t1 select t1.file_id+40, t1.file_number+40 from t1;
insert into t1 select t1.file_id+100, t1.file_number+100 from t1;
insert into t1 select t1.file_id+200, t1.file_number+200 from t1;
insert into t1 select t1.file_id+400, t1.file_number+400 from t1;
-insert into t1 select t1.file_id+1000, t1.file_number+1000 from t1;
-insert into t1 select t1.file_id+10000, t1.file_number+10000 from t1;
-insert into t1 select t1.file_id+100000, t1.file_number+100000 from t1;
-insert into t1 select t1.file_id+1000000, t1.file_number+1000000 from t1;
-insert into t1 select t1.file_id+10000000, t1.file_number+10000000 from t1;
-insert into t1 select t1.file_id+100000000, t1.file_number+100000000 from t1;
create table t2 (
file_id bigint unsigned not null,
country char(2) not null,
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db233.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db233.result
new file mode 100644
index 00000000000..e5808f52e69
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db233.result
@@ -0,0 +1,37 @@
+SET SESSION tokudb_auto_analyze = 0;
+SET SESSION tokudb_analyze_in_background = 0;
+CREATE TABLE t1(
+`id` int(10) unsigned NOT NULL,
+`k` int(10) unsigned NOT NULL DEFAULT '0',
+`c` char(120) NOT NULL DEFAULT '',
+`pad` char(60) NOT NULL DEFAULT '',
+KEY `xid` (`id`),
+KEY `k` (`k`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES(1, 1, '1', '1'), (2, 2, '2', '2'), (3, 3, '3', '3'), (4, 4, '4', '4'),
+(5, 5, '5', '5'), (6, 6, '6', '6'), (6, 6, '6', '6'), (7, 7, '7', '7'),
+(8, 8, '8', '8'), (9, 9, '9', '9'), (10, 10, '10', '10'), (11, 11, '11', '11');
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+set DEBUG_SYNC = 'tokudb_icp_desc_scan_invalidate SIGNAL hit1 WAIT_FOR done1';
+SELECT c FROM t1 WHERE id BETWEEN 5 AND 8 ORDER BY id DESC;
+set DEBUG_SYNC = 'now WAIT_FOR hit1';
+set DEBUG_SYNC = 'now SIGNAL done1';
+c
+8
+7
+6
+6
+5
+set DEBUG_SYNC = 'tokudb_icp_asc_scan_out_of_range SIGNAL hit2 WAIT_FOR done2';
+SELECT c FROM t1 WHERE id BETWEEN 5 AND 8 ORDER BY id ASC;
+set DEBUG_SYNC = 'now WAIT_FOR hit2';
+set DEBUG_SYNC = 'now SIGNAL done2';
+c
+5
+6
+6
+7
+8
+drop table t1;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db397_delete_trigger.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db397_delete_trigger.result
index da82fa445e8..c8565fb4b2b 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/db397_delete_trigger.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db397_delete_trigger.result
@@ -25,11 +25,11 @@ select col1,action from t1_audit;
col1 action
0 DUMMY
1 BEFORE DEL
-select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right;
locks_dname locks_key_left locks_key_right
-./test/t1_audit-main 0200000000000000 0200000000000000
-./test/t1-main ff01000000 0101000000
./test/t1-main 0001000000 0001000000
+./test/t1-main ff01000000 0101000000
+./test/t1_audit-main 0200000000000000 0200000000000000
commit;
drop trigger t1_trigger;
create trigger t1_trigger after delete on t1
@@ -46,11 +46,11 @@ col1 action
0 DUMMY
1 BEFORE DEL
2 AFTER DELE
-select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right;
locks_dname locks_key_left locks_key_right
-./test/t1_audit-main 0300000000000000 0300000000000000
-./test/t1-main ff02000000 0102000000
./test/t1-main 0002000000 0002000000
+./test/t1-main ff02000000 0102000000
+./test/t1_audit-main 0300000000000000 0300000000000000
commit;
drop trigger t1_trigger;
drop table t1;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db397_insert_trigger.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db397_insert_trigger.result
index 41765a6fcd3..aef99a9adcd 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/db397_insert_trigger.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db397_insert_trigger.result
@@ -25,10 +25,10 @@ select col1,action from t1_audit;
col1 action
0 DUMMY
1 BEFORE INSERT
-select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right;
locks_dname locks_key_left locks_key_right
-./test/t1_audit-main 0200000000000000 0200000000000000
./test/t1-main 0001000000 0001000000
+./test/t1_audit-main 0200000000000000 0200000000000000
commit;
drop trigger t1_trigger;
create trigger t1_trigger after insert on t1
@@ -46,10 +46,10 @@ col1 action
0 DUMMY
1 BEFORE INSERT
2 AFTER INSERT
-select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right;
locks_dname locks_key_left locks_key_right
-./test/t1_audit-main 0300000000000000 0300000000000000
./test/t1-main 0002000000 0002000000
+./test/t1_audit-main 0300000000000000 0300000000000000
commit;
drop trigger t1_trigger;
drop table t1;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db397_update_trigger.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db397_update_trigger.result
index c197430ad25..d9b944d3849 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/db397_update_trigger.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db397_update_trigger.result
@@ -25,11 +25,11 @@ select col1,action from t1_audit;
col1 action
0 DUMMY
1 BEFORE UPDATE
-select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right;
locks_dname locks_key_left locks_key_right
-./test/t1_audit-main 0200000000000000 0200000000000000
-./test/t1-main ff01000000 0101000000
./test/t1-main 0001000000 0001000000
+./test/t1-main ff01000000 0101000000
+./test/t1_audit-main 0200000000000000 0200000000000000
commit;
drop trigger t1_trigger;
create trigger t1_trigger after update on t1
@@ -48,11 +48,11 @@ col1 action
0 DUMMY
1 BEFORE UPDATE
2 AFTER UPDATE
-select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right;
locks_dname locks_key_left locks_key_right
-./test/t1_audit-main 0300000000000000 0300000000000000
-./test/t1-main ff02000000 0102000000
./test/t1-main 0002000000 0002000000
+./test/t1-main ff02000000 0102000000
+./test/t1_audit-main 0300000000000000 0300000000000000
commit;
drop trigger t1_trigger;
drop table t1, t1_audit;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db739_replace.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db739_replace.result
index 2bf141add9a..58a4ed6708a 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/db739_replace.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db739_replace.result
@@ -100010,5 +100010,7 @@ insert into t (id,a) values (999,98);
insert into t (id,a) values (999,99);
delete from t where id=404;
set tokudb_pk_insert_mode=2;
+Warnings:
+Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases.
replace into t values (404,0,0,0);
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash.result
index 3ed5758bd15..70bc86e1abc 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash.result
@@ -3,19 +3,19 @@ drop table if exists t;
create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2;
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t 0 PRIMARY 1 id A 0 NULL NULL BTREE
-t 1 x 1 x A NULL NULL NULL YES BTREE
+t 0 PRIMARY 1 id A 2 NULL NULL BTREE
+t 1 x 1 x A 2 NULL NULL YES BTREE
insert into t values (1,1),(3,1),(5,1);
insert into t values (2,1),(4,1),(6,1);
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 6 NULL NULL BTREE
-t 1 x 1 x A NULL NULL NULL YES BTREE
+t 1 x 1 x A 6 NULL NULL YES BTREE
analyze table t;
Table Op Msg_type Msg_text
test.t analyze status OK
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 6 NULL NULL BTREE
-t 1 x 1 x A 2 NULL NULL YES BTREE
+t 1 x 1 x A 6 NULL NULL YES BTREE
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1.result
index 776342ce90e..b6d9fd7da85 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1.result
@@ -3,18 +3,18 @@ drop table if exists t;
create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2;
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t 0 PRIMARY 1 id A 0 NULL NULL BTREE
-t 1 x 1 x A NULL NULL NULL YES BTREE
+t 0 PRIMARY 1 id A 2 NULL NULL BTREE
+t 1 x 1 x A 2 NULL NULL YES BTREE
insert into t values (1,1),(3,1),(5,1);
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t 0 PRIMARY 1 id A 3 NULL NULL BTREE
-t 1 x 1 x A NULL NULL NULL YES BTREE
+t 0 PRIMARY 1 id A 4 NULL NULL BTREE
+t 1 x 1 x A 4 NULL NULL YES BTREE
analyze table t;
Table Op Msg_type Msg_text
test.t analyze status OK
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t 0 PRIMARY 1 id A 3 NULL NULL BTREE
-t 1 x 1 x A 1 NULL NULL YES BTREE
+t 0 PRIMARY 1 id A 4 NULL NULL BTREE
+t 1 x 1 x A 4 NULL NULL YES BTREE
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1_pick.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1_pick.result
index 480978a545b..5ba5da21789 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1_pick.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1_pick.result
@@ -3,19 +3,19 @@ drop table if exists t;
create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2;
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t 0 PRIMARY 1 id A 0 NULL NULL BTREE
-t 1 x 1 x A NULL NULL NULL YES BTREE
+t 0 PRIMARY 1 id A 2 NULL NULL BTREE
+t 1 x 1 x A 2 NULL NULL YES BTREE
insert into t values (1,1),(3,2),(5,3);
insert into t values (2,1),(4,1),(6,1),(8,1);
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 7 NULL NULL BTREE
-t 1 x 1 x A NULL NULL NULL YES BTREE
+t 1 x 1 x A 7 NULL NULL YES BTREE
analyze table t;
Table Op Msg_type Msg_text
test.t analyze status OK
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 7 NULL NULL BTREE
-t 1 x 1 x A 1 NULL NULL YES BTREE
+t 1 x 1 x A 3 NULL NULL YES BTREE
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2.result
index ec2a37b02d4..6d345d98c95 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2.result
@@ -3,18 +3,18 @@ drop table if exists t;
create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2;
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t 0 PRIMARY 1 id A 0 NULL NULL BTREE
-t 1 x 1 x A NULL NULL NULL YES BTREE
+t 0 PRIMARY 1 id A 2 NULL NULL BTREE
+t 1 x 1 x A 2 NULL NULL YES BTREE
insert into t values (2,1),(4,1),(6,1);
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t 0 PRIMARY 1 id A 3 NULL NULL BTREE
-t 1 x 1 x A NULL NULL NULL YES BTREE
+t 0 PRIMARY 1 id A 4 NULL NULL BTREE
+t 1 x 1 x A 4 NULL NULL YES BTREE
analyze table t;
Table Op Msg_type Msg_text
test.t analyze status OK
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t 0 PRIMARY 1 id A 3 NULL NULL BTREE
-t 1 x 1 x A 1 NULL NULL YES BTREE
+t 0 PRIMARY 1 id A 4 NULL NULL BTREE
+t 1 x 1 x A 4 NULL NULL YES BTREE
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2_pick.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2_pick.result
index c1160ae27a0..06639c311cf 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2_pick.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2_pick.result
@@ -3,14 +3,14 @@ drop table if exists t;
create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2;
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t 0 PRIMARY 1 id A 0 NULL NULL BTREE
-t 1 x 1 x A NULL NULL NULL YES BTREE
+t 0 PRIMARY 1 id A 2 NULL NULL BTREE
+t 1 x 1 x A 2 NULL NULL YES BTREE
insert into t values (1,1),(3,2),(5,3),(7,4);
insert into t values (2,1),(4,1),(6,1);
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 7 NULL NULL BTREE
-t 1 x 1 x A NULL NULL NULL YES BTREE
+t 1 x 1 x A 7 NULL NULL YES BTREE
analyze table t;
Table Op Msg_type Msg_text
test.t analyze status OK
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db757_part_alter_analyze.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db757_part_alter_analyze.result
index 21ce7704928..62337802688 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/db757_part_alter_analyze.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db757_part_alter_analyze.result
@@ -6,30 +6,30 @@ partition by range(id)
insert into t values (1,1,1),(2,1,2),(3,1,3),(4,1,4);
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t 0 PRIMARY 1 id A 4 NULL NULL BTREE
-t 1 x 1 x A NULL NULL NULL YES BTREE
-t 1 y 1 y A NULL NULL NULL YES BTREE
+t 0 PRIMARY 1 id A 5 NULL NULL BTREE
+t 1 x 1 x A 5 NULL NULL YES BTREE
+t 1 y 1 y A 5 NULL NULL YES BTREE
alter table t analyze partition p0;
Table Op Msg_type Msg_text
test.t analyze status OK
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t 0 PRIMARY 1 id A 4 NULL NULL BTREE
-t 1 x 1 x A 1 NULL NULL YES BTREE
-t 1 y 1 y A 4 NULL NULL YES BTREE
+t 0 PRIMARY 1 id A 5 NULL NULL BTREE
+t 1 x 1 x A 5 NULL NULL YES BTREE
+t 1 y 1 y A 5 NULL NULL YES BTREE
alter table t analyze partition p1;
Table Op Msg_type Msg_text
test.t analyze status OK
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t 0 PRIMARY 1 id A 4 NULL NULL BTREE
-t 1 x 1 x A 1 NULL NULL YES BTREE
-t 1 y 1 y A 4 NULL NULL YES BTREE
+t 0 PRIMARY 1 id A 5 NULL NULL BTREE
+t 1 x 1 x A 5 NULL NULL YES BTREE
+t 1 y 1 y A 5 NULL NULL YES BTREE
insert into t values (100,1,1),(200,2,1),(300,3,1),(400,4,1),(500,5,1);
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 9 NULL NULL BTREE
-t 1 x 1 x A 2 NULL NULL YES BTREE
+t 1 x 1 x A 9 NULL NULL YES BTREE
t 1 y 1 y A 9 NULL NULL YES BTREE
alter table t analyze partition p0;
Table Op Msg_type Msg_text
@@ -37,8 +37,8 @@ test.t analyze status OK
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 9 NULL NULL BTREE
-t 1 x 1 x A NULL NULL NULL YES BTREE
-t 1 y 1 y A NULL NULL NULL YES BTREE
+t 1 x 1 x A 9 NULL NULL YES BTREE
+t 1 y 1 y A 9 NULL NULL YES BTREE
alter table t analyze partition p1;
Table Op Msg_type Msg_text
test.t analyze status OK
@@ -46,5 +46,5 @@ show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 9 NULL NULL BTREE
t 1 x 1 x A 9 NULL NULL YES BTREE
-t 1 y 1 y A 1 NULL NULL YES BTREE
+t 1 y 1 y A 9 NULL NULL YES BTREE
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db917.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db917.result
new file mode 100644
index 00000000000..9c29033429e
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db917.result
@@ -0,0 +1,14 @@
+drop table if exists t1;
+set @orig_table_open_cache = @@global.table_open_cache;
+create table t1(a int) engine = tokudb partition by key(a) partitions 2 (partition p0 engine = tokudb, partition p1 engine = tokudb);
+lock tables t1 read;
+set @@global.table_open_cache = 1;
+begin;
+insert into t1 values(1),(1);
+select * from t1 where c like _ucs2 0x039C0025 collate ucs2_unicode_ci;
+ERROR 42S22: Unknown column 'c' in 'where clause'
+create table t1(c1 binary (1), c2 varbinary(1));
+ERROR 42S01: Table 't1' already exists
+unlock tables;
+drop table t1;
+set @@global.table_open_cache = @orig_table_open_cache;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db938.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db938.result
new file mode 100644
index 00000000000..779d458221b
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db938.result
@@ -0,0 +1,35 @@
+set @orig_auto_analyze = @@session.tokudb_auto_analyze;
+set @orig_in_background = @@session.tokudb_analyze_in_background;
+set @orig_mode = @@session.tokudb_analyze_mode;
+set @orig_throttle = @@session.tokudb_analyze_throttle;
+set @orig_time = @@session.tokudb_analyze_time;
+set @orig_scale_percent = @@global.tokudb_cardinality_scale_percent;
+set @orig_default_storage_engine = @@session.default_storage_engine;
+set @orig_pause_background_job_manager = @@global.tokudb_debug_pause_background_job_manager;
+set session default_storage_engine = 'tokudb';
+set session tokudb_auto_analyze = 1;
+set session tokudb_analyze_in_background = 1;
+set session tokudb_analyze_mode = tokudb_analyze_standard;
+set session tokudb_analyze_throttle = 0;
+set session tokudb_analyze_time = 0;
+set global tokudb_cardinality_scale_percent = DEFAULT;
+set global tokudb_debug_pause_background_job_manager = TRUE;
+create table t1 (a int not null auto_increment, b int, c int, primary key(a), key kb(b), key kc(c), key kabc(a,b,c), key kab(a,b), key kbc(b,c));
+insert into t1(b,c) values(0,0), (1,1), (2,2), (3,3);
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+database_name table_name job_type job_params scheduler
+test t1 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; AUTO
+set DEBUG_SYNC = 'tokudb_after_truncate_all_dictionarys SIGNAL closed WAIT_FOR done';
+TRUNCATE TABLE t1;
+set global tokudb_debug_pause_background_job_manager = FALSE;
+set DEBUG_SYNC = 'now SIGNAL done';
+drop table t1;
+set session tokudb_auto_analyze = @orig_auto_analyze;
+set session tokudb_analyze_in_background = @orig_in_background;
+set session tokudb_analyze_mode = @orig_mode;
+set session tokudb_analyze_throttle = @orig_throttle;
+set session tokudb_analyze_time = @orig_time;
+set global tokudb_cardinality_scale_percent = @orig_scale_percent;
+set session default_storage_engine = @orig_default_storage_engine;
+set global tokudb_debug_pause_background_job_manager = @orig_pause_background_job_manager;
+set DEBUG_SYNC='reset';
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db945.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db945.result
new file mode 100644
index 00000000000..6b3c239d602
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db945.result
@@ -0,0 +1,15 @@
+set default_storage_engine='tokudb';
+drop table if exists t1;
+set session tokudb_auto_analyze = 1;
+set session tokudb_analyze_in_background = true;
+set session tokudb_analyze_mode = TOKUDB_ANALYZE_STANDARD;
+set session tokudb_analyze_throttle = 0;
+set session tokudb_analyze_time = 0;
+create table t1(a int, b text(1), c text(1), filler text(1), primary key(a, b(1)), unique key (a, c(1)));
+lock tables t1 write, t1 as a read, t1 as b read;
+insert into t1(a) values(1);
+Warnings:
+Warning 1364 Field 'b' doesn't have a default value
+alter table t1 drop key a;
+unlock tables;
+drop table t1;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/5585-master.opt b/storage/tokudb/mysql-test/tokudb_bugs/t/5585-master.opt
index 017432e797d..acad193fd76 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/t/5585-master.opt
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/5585-master.opt
@@ -1 +1 @@
---tokudb-cache-size=1000000000 --innodb-buffer-pool-size=1000000000
+--loose-tokudb-cache-size=1000000000 --innodb-buffer-pool-size=1000000000
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/5585.test b/storage/tokudb/mysql-test/tokudb_bugs/t/5585.test
index bf0df681e7a..2489748dfa1 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/t/5585.test
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/5585.test
@@ -1,5 +1,6 @@
--source include/have_innodb.inc
--source include/have_tokudb.inc
+--source include/big_test.inc
--disable_warnings
drop table if exists t1, t2;
@@ -18,12 +19,6 @@ insert into t1 select t1.file_id+40, t1.file_number+40 from t1;
insert into t1 select t1.file_id+100, t1.file_number+100 from t1;
insert into t1 select t1.file_id+200, t1.file_number+200 from t1;
insert into t1 select t1.file_id+400, t1.file_number+400 from t1;
-insert into t1 select t1.file_id+1000, t1.file_number+1000 from t1;
-insert into t1 select t1.file_id+10000, t1.file_number+10000 from t1;
-insert into t1 select t1.file_id+100000, t1.file_number+100000 from t1;
-insert into t1 select t1.file_id+1000000, t1.file_number+1000000 from t1;
-insert into t1 select t1.file_id+10000000, t1.file_number+10000000 from t1;
-insert into t1 select t1.file_id+100000000, t1.file_number+100000000 from t1;
create table t2 (
file_id bigint unsigned not null,
@@ -64,4 +59,4 @@ select t1.file_id,
(select hits from t2 where t2.file_id = t1.file_id and t2.insert_ts = date(date_sub(now(),interval 1 day))) as d
from t1;
-drop table if exists t1, t2; \ No newline at end of file
+drop table if exists t1, t2;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db233.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db233.test
new file mode 100644
index 00000000000..8e4c3b73c09
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db233.test
@@ -0,0 +1,70 @@
+# This test for DB-233 tests that icp descending range scans stop properly once
+# it fails to find a key match instead of continuing to scan all the way to the
+# beginning of the index.
+
+-- source include/have_tokudb.inc
+-- source include/have_debug.inc
+-- source include/have_debug_sync.inc
+
+-- enable_query_log
+
+SET SESSION tokudb_auto_analyze = 0;
+SET SESSION tokudb_analyze_in_background = 0;
+
+CREATE TABLE t1(
+ `id` int(10) unsigned NOT NULL,
+ `k` int(10) unsigned NOT NULL DEFAULT '0',
+ `c` char(120) NOT NULL DEFAULT '',
+ `pad` char(60) NOT NULL DEFAULT '',
+ KEY `xid` (`id`),
+ KEY `k` (`k`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1;
+
+INSERT INTO t1 VALUES(1, 1, '1', '1'), (2, 2, '2', '2'), (3, 3, '3', '3'), (4, 4, '4', '4'),
+(5, 5, '5', '5'), (6, 6, '6', '6'), (6, 6, '6', '6'), (7, 7, '7', '7'),
+(8, 8, '8', '8'), (9, 9, '9', '9'), (10, 10, '10', '10'), (11, 11, '11', '11');
+
+ANALYZE TABLE t1;
+
+# lets flip to another connection
+connect(conn1, localhost, root);
+
+# set up the DEBUG_SYNC point
+set DEBUG_SYNC = 'tokudb_icp_desc_scan_invalidate SIGNAL hit1 WAIT_FOR done1';
+
+# send the query
+send SELECT c FROM t1 WHERE id BETWEEN 5 AND 8 ORDER BY id DESC;
+
+# back to default connection
+connection default;
+
+# wait for the ICP reverse scan to invalidate
+set DEBUG_SYNC = 'now WAIT_FOR hit1';
+
+# lets release and clean up
+set DEBUG_SYNC = 'now SIGNAL done1';
+
+connection conn1;
+reap;
+
+# set up the DEBUG_SYNC point again, but for the out of range
+set DEBUG_SYNC = 'tokudb_icp_asc_scan_out_of_range SIGNAL hit2 WAIT_FOR done2';
+
+# send the query
+send SELECT c FROM t1 WHERE id BETWEEN 5 AND 8 ORDER BY id ASC;
+
+# back to default connection
+connection default;
+
+# wait for the ICP reverse scan to invalidate
+set DEBUG_SYNC = 'now WAIT_FOR hit2';
+
+# lets release and clean up
+set DEBUG_SYNC = 'now SIGNAL done2';
+
+connection conn1;
+reap;
+
+connection default;
+disconnect conn1;
+drop table t1;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db397_delete_trigger.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db397_delete_trigger.test
index 00751ed2346..79043664607 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/t/db397_delete_trigger.test
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db397_delete_trigger.test
@@ -28,7 +28,7 @@ start transaction;
delete from t1 where col1 = 1;
select col1,col2 from t1;
select col1,action from t1_audit;
-select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right;
# note the locks on t1 and t1_audit
commit;
drop trigger t1_trigger;
@@ -41,10 +41,10 @@ start transaction;
delete from t1 where col1 = 2;
select col1,col2 from t1;
select col1,action from t1_audit;
-select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right;
# note the locks on t1 and t1_audit
commit;
drop trigger t1_trigger;
drop table t1;
-drop table t1_audit; \ No newline at end of file
+drop table t1_audit;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db397_insert_trigger.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db397_insert_trigger.test
index f32496e524d..ffe2face9f2 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/t/db397_insert_trigger.test
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db397_insert_trigger.test
@@ -27,7 +27,7 @@ start transaction;
insert into t1 (col1, col2) values (1,1);
select col1,col2 from t1;
select col1,action from t1_audit;
-select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right;
# note the locks on t1 and t1_audit
commit;
drop trigger t1_trigger;
@@ -39,10 +39,10 @@ start transaction;
insert into t1 (col1, col2) values (2,2);
select col1,col2 from t1;
select col1,action from t1_audit;
-select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right;
# note the locks on t1 and t1_audit
commit;
drop trigger t1_trigger;
drop table t1;
-drop table t1_audit; \ No newline at end of file
+drop table t1_audit;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db397_update_trigger.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db397_update_trigger.test
index f1407e6488a..063a88cb4ab 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/t/db397_update_trigger.test
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db397_update_trigger.test
@@ -29,7 +29,7 @@ start transaction;
update t1 set col2=1000 where col1 = 1;
select col1,col2 from t1;
select col1,action from t1_audit;
-select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right;
# check locks on t1 and t1_audit
commit;
drop trigger t1_trigger;
@@ -43,7 +43,7 @@ start transaction;
update t1 set col2=1001 where col1 = 2;
select col1,col2 from t1;
select col1,action from t1_audit;
-select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks;
+select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right;
# check locks on t1 and t1_audit
commit;
drop trigger t1_trigger;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db917.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db917.test
new file mode 100644
index 00000000000..ae94d7b30de
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db917.test
@@ -0,0 +1,23 @@
+# test DB-917
+# test that table/share open lock timeout does not crash the server on subsequent access
+source include/have_partition.inc;
+source include/have_tokudb.inc;
+disable_warnings;
+drop table if exists t1;
+enable_warnings;
+set @orig_table_open_cache = @@global.table_open_cache;
+create table t1(a int) engine = tokudb partition by key(a) partitions 2 (partition p0 engine = tokudb, partition p1 engine = tokudb);
+lock tables t1 read;
+set @@global.table_open_cache = 1;
+begin;
+insert into t1 values(1),(1);
+# when the bug is present, this results in a lock wait timeout
+--error ER_BAD_FIELD_ERROR
+select * from t1 where c like _ucs2 0x039C0025 collate ucs2_unicode_ci;
+# when the bug exists, this results in the assertion
+# kc_info->cp_info[keynr] == NULL in tokudb/ha_tokudb.cc initialize_col_pack_info
+--error ER_TABLE_EXISTS_ERROR
+create table t1(c1 binary (1), c2 varbinary(1));
+unlock tables;
+drop table t1;
+set @@global.table_open_cache = @orig_table_open_cache;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db938.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db938.test
new file mode 100644
index 00000000000..f56f93d1492
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db938.test
@@ -0,0 +1,77 @@
+# This test for DB-938 tests a race condition where a scheduled background job
+# (analyze) ends up operating on a set of DB* key_file[] in TOKUDB_SHARE that
+# were set to NULL during a TRUNCATE TABLE operation.
+
+-- source include/have_tokudb.inc
+-- source include/have_debug.inc
+-- source include/have_debug_sync.inc
+
+-- enable_query_log
+
+set @orig_auto_analyze = @@session.tokudb_auto_analyze;
+set @orig_in_background = @@session.tokudb_analyze_in_background;
+set @orig_mode = @@session.tokudb_analyze_mode;
+set @orig_throttle = @@session.tokudb_analyze_throttle;
+set @orig_time = @@session.tokudb_analyze_time;
+set @orig_scale_percent = @@global.tokudb_cardinality_scale_percent;
+set @orig_default_storage_engine = @@session.default_storage_engine;
+set @orig_pause_background_job_manager = @@global.tokudb_debug_pause_background_job_manager;
+
+# first, lets set up to auto analyze in the background with about any activity
+set session default_storage_engine = 'tokudb';
+set session tokudb_auto_analyze = 1;
+set session tokudb_analyze_in_background = 1;
+set session tokudb_analyze_mode = tokudb_analyze_standard;
+set session tokudb_analyze_throttle = 0;
+set session tokudb_analyze_time = 0;
+set global tokudb_cardinality_scale_percent = DEFAULT;
+
+# in debug build, we can prevent the background job manager from running,
+# let's do it to hold a job from running until we get the TRUNCATE TABLE
+# in action
+set global tokudb_debug_pause_background_job_manager = TRUE;
+
+create table t1 (a int not null auto_increment, b int, c int, primary key(a), key kb(b), key kc(c), key kabc(a,b,c), key kab(a,b), key kbc(b,c));
+
+insert into t1(b,c) values(0,0), (1,1), (2,2), (3,3);
+
+# insert above should have triggered an analyze, but since the bjm is paused,
+# we will see it sitting in the queue
+select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status;
+
+# lets flip to another connection
+connect(conn1, localhost, root);
+
+# set up the DEBUG_SYNC point
+set DEBUG_SYNC = 'tokudb_after_truncate_all_dictionarys SIGNAL closed WAIT_FOR done';
+
+# send the truncat table
+send TRUNCATE TABLE t1;
+
+# back to default connection
+connection default;
+
+# release the bjm
+set global tokudb_debug_pause_background_job_manager = FALSE;
+
+# if the bug is present, the bjm should crash here within 1/4 of a second
+sleep 5;
+
+# lets release and clean up
+set DEBUG_SYNC = 'now SIGNAL done';
+
+connection conn1;
+reap;
+connection default;
+disconnect conn1;
+drop table t1;
+
+set session tokudb_auto_analyze = @orig_auto_analyze;
+set session tokudb_analyze_in_background = @orig_in_background;
+set session tokudb_analyze_mode = @orig_mode;
+set session tokudb_analyze_throttle = @orig_throttle;
+set session tokudb_analyze_time = @orig_time;
+set global tokudb_cardinality_scale_percent = @orig_scale_percent;
+set session default_storage_engine = @orig_default_storage_engine;
+set global tokudb_debug_pause_background_job_manager = @orig_pause_background_job_manager;
+set DEBUG_SYNC='reset';
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db945.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db945.test
new file mode 100644
index 00000000000..27b0d284484
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db945.test
@@ -0,0 +1,24 @@
+source include/have_tokudb.inc;
+set default_storage_engine='tokudb';
+disable_warnings;
+drop table if exists t1;
+enable_warnings;
+
+set session tokudb_auto_analyze = 1;
+set session tokudb_analyze_in_background = true;
+set session tokudb_analyze_mode = TOKUDB_ANALYZE_STANDARD;
+set session tokudb_analyze_throttle = 0;
+set session tokudb_analyze_time = 0;
+
+create table t1(a int, b text(1), c text(1), filler text(1), primary key(a, b(1)), unique key (a, c(1)));
+lock tables t1 write, t1 as a read, t1 as b read;
+insert into t1(a) values(1);
+alter table t1 drop key a;
+unlock tables;
+
+# wait for the bjm queue to empty
+-- disable_query_log
+let $wait_condition=select count(*)=0 from information_schema.tokudb_background_job_status;
+-- source include/wait_condition.inc
+
+drop table t1;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/disabled.def b/storage/tokudb/mysql-test/tokudb_bugs/t/disabled.def
new file mode 100644
index 00000000000..8c755dde8f5
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/disabled.def
@@ -0,0 +1,16 @@
+2952: tokutek not_5_5
+4472 : #4521 MDL for alter table in 5.5 prohibits this test from having any chance of working
+fileops-2: tokutek not_5_5
+fileops-3: tokutek not_5_5
+fileops-4: tokutek not_5_5
+memcache_dirty: tokutek FB port
+xa-2: tokutek not_5_5
+tokudb_drop_part_table_668: upgrade from tokudb 6.6.8
+tokudb_drop_simple_table_668: upgrade from tokudb 6.6.8
+checkpoint_lock_2: test can not work when the checkpoint_safe_lock is a fair rwlock
+6053: tokudb is not the default storage engine
+1883: tokutek's auto inc singleton patch missing
+3083: no patch to find_shortest_key to prefer PK over CK
+db768 : https://tokutek.atlassian.net/browse/DB-768
+dict_leak_3518 : https://tokutek.atlassian.net/browse/DB-635
+1872 : https://tokutek.atlassian.net/browse/DB-750
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/suite.opt b/storage/tokudb/mysql-test/tokudb_bugs/t/suite.opt
new file mode 100644
index 00000000000..23511b05020
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/suite.opt
@@ -0,0 +1 @@
+$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/xa-3.test b/storage/tokudb/mysql-test/tokudb_bugs/t/xa-3.test
index 828cf03d2fd..e19291991b6 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/t/xa-3.test
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/xa-3.test
@@ -1,6 +1,12 @@
-- source include/have_innodb.inc
-- source include/have_tokudb.inc
-- source include/have_debug.inc
+# Valgrind would report memory leaks on the intentional crashes
+-- source include/not_valgrind.inc
+# Embedded server does not support crashing
+-- source include/not_embedded.inc
+# Avoid CrashReporter popup on Mac
+-- source include/not_crashrep.inc
--disable_warnings
drop table if exists t1, t2;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/xa-4.test b/storage/tokudb/mysql-test/tokudb_bugs/t/xa-4.test
index 1642cb7ca1b..f1f96711b89 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/t/xa-4.test
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/xa-4.test
@@ -1,6 +1,12 @@
-- source include/have_innodb.inc
-- source include/have_tokudb.inc
-- source include/have_debug.inc
+# Valgrind would report memory leaks on the intentional crashes
+-- source include/not_valgrind.inc
+# Embedded server does not support crashing
+-- source include/not_embedded.inc
+# Avoid CrashReporter popup on Mac
+-- source include/not_crashrep.inc
--disable_warnings
drop table if exists t1, t2;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/xa-6.test b/storage/tokudb/mysql-test/tokudb_bugs/t/xa-6.test
index 312c2d15cd2..c6c11f633e1 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/t/xa-6.test
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/xa-6.test
@@ -1,5 +1,11 @@
--source include/have_tokudb.inc
--source include/have_debug.inc
+# Valgrind would report memory leaks on the intentional crashes
+-- source include/not_valgrind.inc
+# Embedded server does not support crashing
+-- source include/not_embedded.inc
+# Avoid CrashReporter popup on Mac
+-- source include/not_crashrep.inc
--disable_warnings
drop table if exists t1;
diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result b/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result
index 625bb255755..086c4f4cc18 100644
--- a/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result
+++ b/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result
@@ -1,6 +1,6 @@
CREATE TABLE t1 (i INT) ENGINE=TokuDB;
EXPLAIN INSERT INTO t1 SELECT * FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using temporary
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using temporary
INSERT INTO t1 SELECT * FROM t1;
DROP TABLE t1;
diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/r/mrr.result b/storage/tokudb/mysql-test/tokudb_mariadb/r/mrr.result
index 02ede175ce1..50e5b1940b0 100644
--- a/storage/tokudb/mysql-test/tokudb_mariadb/r/mrr.result
+++ b/storage/tokudb/mysql-test/tokudb_mariadb/r/mrr.result
@@ -34,7 +34,7 @@ SELECT t3.task_id, t3.field FROM
t3,t2 WHERE t3.task_id=t2.task_id AND t2.type NOT IN (8,11);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY,ymtasks_type ymtasks_type 2 NULL 2 Using where; Using index
-1 SIMPLE t3 ref ymtasksoptions_task ymtasksoptions_task 4 test.t2.task_id 7
+1 SIMPLE t3 ref ymtasksoptions_task ymtasksoptions_task 4 test.t2.task_id 1
SELECT t3.task_id, t3.field FROM
t3,t2 WHERE t3.task_id=t2.task_id AND t2.type NOT IN (8,11);
task_id field
@@ -85,7 +85,7 @@ SELECT t3.task_id, t3.field FROM
t3,t2 WHERE t3.task_id=t2.task_id AND t2.type NOT IN (8,11);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY,ymtasks_type ymtasks_type 2 NULL 2 Using where; Using index
-1 SIMPLE t3 ref ymtasksoptions_task ymtasksoptions_task 4 test.t2.task_id 7 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t3 ref ymtasksoptions_task ymtasksoptions_task 4 test.t2.task_id 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
SELECT t3.task_id, t3.field FROM
t3,t2 WHERE t3.task_id=t2.task_id AND t2.type NOT IN (8,11);
task_id field
diff --git a/storage/tokudb/mysql-test/tokudb_parts/disabled.def b/storage/tokudb/mysql-test/tokudb_parts/disabled.def
index 582ca590166..3252a463176 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/disabled.def
+++ b/storage/tokudb/mysql-test/tokudb_parts/disabled.def
@@ -1,6 +1,3 @@
-partition_basic_symlink_tokudb : tokudb_file_per_table is not supported
-partition_reorganize_tokudb : tokudb_file_per_table is not supported
-
partition_max_parts_hash_tokudb: 5.6 test not merged yet
partition_max_parts_inv_tokudb: 5.6 test not merged yet
partition_max_parts_key_tokudb: 5.6 test not merged yet
diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter4_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter4_tokudb.result
index 644c4815a36..b4e8e47b7d9 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter4_tokudb.result
+++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter4_tokudb.result
@@ -7560,7 +7560,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8019,7 +8020,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8489,7 +8491,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8960,7 +8963,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9425,7 +9429,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9896,7 +9901,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10372,7 +10378,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10846,7 +10853,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11310,7 +11318,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11769,7 +11778,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12239,7 +12249,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12710,7 +12721,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13175,7 +13187,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13646,7 +13659,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14122,7 +14136,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14596,7 +14611,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze Error Error in list of partitions to test.t1
+test.t1 analyze status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -26313,7 +26329,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -26772,7 +26789,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27242,7 +27260,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27713,7 +27732,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28178,7 +28198,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28649,7 +28670,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29125,7 +29147,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29599,7 +29622,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30063,7 +30087,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30522,7 +30547,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30992,7 +31018,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31463,7 +31490,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31928,7 +31956,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32399,7 +32428,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32875,7 +32905,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -33349,7 +33380,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check Error Error in list of partitions to test.t1
+test.t1 check status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -45082,7 +45114,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -45541,7 +45574,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -46011,7 +46045,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -46482,7 +46517,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -46947,7 +46983,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47418,7 +47455,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47894,7 +47932,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48368,7 +48407,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48832,7 +48872,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49291,7 +49332,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49761,7 +49803,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50232,7 +50275,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50697,7 +50741,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51168,7 +51213,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51644,7 +51690,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -52118,7 +52165,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize Error Error in list of partitions to test.t1
+test.t1 optimize status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -75368,7 +75416,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -75827,7 +75876,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -76297,7 +76347,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -76768,7 +76819,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -77233,7 +77285,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -77704,7 +77757,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -78180,7 +78234,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -78654,7 +78709,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79118,7 +79174,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79577,7 +79634,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80047,7 +80105,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80518,7 +80577,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80983,7 +81043,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81454,7 +81515,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81930,7 +81992,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -82404,7 +82467,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair Error Error in list of partitions to test.t1
+test.t1 repair status Operation failed
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result
index 2101feaacb3..aadfaba3b7b 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result
+++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result
@@ -1,3 +1,6 @@
+SET @tokudb_prelock_empty_saved = @@GLOBAL.tokudb_prelock_empty;
+SET GLOBAL tokudb_prelock_empty = 0;
+SET SESSION tokudb_prelock_empty = 0;
DROP TABLE IF EXISTS t1;
# test without partitioning for reference
CREATE TABLE t1 (
@@ -1107,3 +1110,4 @@ a
0
DROP TABLE t1;
##############################################################################
+SET GLOBAL tokudb_prelock_empty = @tokudb_prelock_empty_saved;
diff --git a/storage/tokudb/mysql-test/tokudb_parts/t/disabled.def b/storage/tokudb/mysql-test/tokudb_parts/t/disabled.def
new file mode 100644
index 00000000000..90e599cd035
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_parts/t/disabled.def
@@ -0,0 +1,2 @@
+partition_basic_symlink_tokudb : tokudb_file_per_table is not supported
+partition_reorganize_tokudb : tokudb_file_per_table is not supported
diff --git a/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb-master.opt b/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb-master.opt
deleted file mode 100644
index 857da664d10..00000000000
--- a/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---tokudb-prelock-empty=0
diff --git a/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb.test b/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb.test
index a13ddf65d4b..ceec2fda9ee 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb.test
+++ b/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb.test
@@ -29,7 +29,12 @@
let $engine= 'TokuDB';
--source include/have_tokudb.inc
+SET @tokudb_prelock_empty_saved = @@GLOBAL.tokudb_prelock_empty;
+SET GLOBAL tokudb_prelock_empty = 0;
+SET SESSION tokudb_prelock_empty = 0;
+
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
--source suite/parts/inc/partition_auto_increment.inc
+SET GLOBAL tokudb_prelock_empty = @tokudb_prelock_empty_saved;
diff --git a/storage/tokudb/mysql-test/tokudb_parts/t/suite.opt b/storage/tokudb/mysql-test/tokudb_parts/t/suite.opt
new file mode 100644
index 00000000000..23511b05020
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_parts/t/suite.opt
@@ -0,0 +1 @@
+$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0
diff --git a/storage/tokudb/mysql-test/tokudb_rpl/r/rpl_rfr_disable_on_expl_pk_absence.result b/storage/tokudb/mysql-test/tokudb_rpl/r/rpl_rfr_disable_on_expl_pk_absence.result
new file mode 100644
index 00000000000..981a833aea5
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_rpl/r/rpl_rfr_disable_on_expl_pk_absence.result
@@ -0,0 +1,47 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+call mtr.add_suppression("read free replication is disabled for tokudb table");
+CREATE TABLE t (a int(11), b char(20)) ENGINE = TokuDB;
+INSERT INTO t (a, b) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e');
+SELECT * FROM t;
+a b
+1 a
+2 b
+3 c
+4 d
+5 e
+UPDATE t SET a = a + 10 WHERE b = 'b';
+SELECT * FROM t;
+a b
+1 a
+12 b
+3 c
+4 d
+5 e
+SELECT * FROM t;
+a b
+1 a
+12 b
+3 c
+4 d
+5 e
+UPDATE t SET a = a + 10 WHERE b = 'b';
+SELECT * FROM t;
+a b
+1 a
+22 b
+3 c
+4 d
+5 e
+SELECT * FROM t;
+a b
+1 a
+22 b
+3 c
+4 d
+5 e
+DROP TABLE t;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence-slave.opt b/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence-slave.opt
new file mode 100644
index 00000000000..fb12af6c5bd
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence-slave.opt
@@ -0,0 +1 @@
+--read-only=true --tokudb-rpl-unique-checks=false --tokudb-rpl-lookup-rows=false
diff --git a/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence.test b/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence.test
new file mode 100644
index 00000000000..67e77c1511c
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence.test
@@ -0,0 +1,48 @@
+# Test case for bug#1536663
+#
+# When read-free-replication is enabled for tokudb and there is no explicit
+# pk for replicated table there can be dublicated records in the table on
+# update operation.
+#
+# Consider this update operation:
+# UPDATE t SET a = a + 10 WHERE b = 'b';
+# The master does rows lookup and updates the rows which values correspond to
+# the condition. The update events are written to binary log with
+# rows values from the master. As rows lookup is forbidden for slave
+# the new rows are added instead of updating corresponding rows.
+#
+# Without the fix there will be several rows with b = 'b' in the table on slave
+# instead of one updated row.
+#
+
+--source include/have_tokudb.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+call mtr.add_suppression("read free replication is disabled for tokudb table");
+
+--connection master
+CREATE TABLE t (a int(11), b char(20)) ENGINE = TokuDB;
+INSERT INTO t (a, b) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e');
+
+--sync_slave_with_master
+--sorted_result
+SELECT * FROM t;
+
+--let $i = 2
+--while($i) {
+ --dec $i
+ --connection master
+ UPDATE t SET a = a + 10 WHERE b = 'b';
+ --sorted_result
+ SELECT * FROM t;
+ --sync_slave_with_master
+ --sorted_result
+ SELECT * FROM t;
+}
+
+--connection master
+DROP TABLE t;
+--sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_delete_fraction.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_delete_fraction.result
new file mode 100644
index 00000000000..41918883dd6
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_delete_fraction.result
@@ -0,0 +1,73 @@
+SET @orig_global = @@global.tokudb_analyze_delete_fraction;
+SELECT @orig_global;
+@orig_global
+1
+SET @orig_session = @@session.tokudb_analyze_delete_fraction;
+SELECT @orig_session;
+@orig_session
+1
+SET GLOBAL tokudb_analyze_delete_fraction = .5;
+SELECT @@global.tokudb_analyze_delete_fraction;
+@@global.tokudb_analyze_delete_fraction
+0.500000
+SET GLOBAL tokudb_analyze_delete_fraction = 0;
+SELECT @@global.tokudb_analyze_delete_fraction;
+@@global.tokudb_analyze_delete_fraction
+0.000000
+SET GLOBAL tokudb_analyze_delete_fraction = DEFAULT;
+SELECT @@global.tokudb_analyze_delete_fraction;
+@@global.tokudb_analyze_delete_fraction
+1.000000
+SET GLOBAL tokudb_analyze_delete_fraction = 'foobar';
+ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_delete_fraction'
+SELECT @@global.tokudb_analyze_delete_fraction;
+@@global.tokudb_analyze_delete_fraction
+1.000000
+SET GLOBAL tokudb_analyze_delete_fraction = 3.75;
+Warnings:
+Warning 1292 Truncated incorrect tokudb_analyze_delete_fraction value: '3.75'
+SELECT @@global.tokudb_analyze_delete_fraction;
+@@global.tokudb_analyze_delete_fraction
+1.000000
+SET SESSION tokudb_analyze_delete_fraction = .5;
+SELECT @@session.tokudb_analyze_delete_fraction;
+@@session.tokudb_analyze_delete_fraction
+0.500000
+SET SESSION tokudb_analyze_delete_fraction = 0;
+SELECT @@session.tokudb_analyze_delete_fraction;
+@@session.tokudb_analyze_delete_fraction
+0.000000
+SET SESSION tokudb_analyze_delete_fraction = DEFAULT;
+SELECT @@session.tokudb_analyze_delete_fraction;
+@@session.tokudb_analyze_delete_fraction
+1.000000
+SET SESSION tokudb_analyze_delete_fraction = 'foobar';
+ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_delete_fraction'
+SELECT @@session.tokudb_analyze_delete_fraction;
+@@session.tokudb_analyze_delete_fraction
+1.000000
+SET SESSION tokudb_analyze_delete_fraction = 3.75;
+Warnings:
+Warning 1292 Truncated incorrect tokudb_analyze_delete_fraction value: '3.75'
+SELECT @@session.tokudb_analyze_delete_fraction;
+@@session.tokudb_analyze_delete_fraction
+1.000000
+SET GLOBAL tokudb_analyze_delete_fraction = .2;
+SET SESSION tokudb_analyze_delete_fraction = .3;
+SELECT @@global.tokudb_analyze_delete_fraction;
+@@global.tokudb_analyze_delete_fraction
+0.200000
+SELECT @@session.tokudb_analyze_delete_fraction;
+@@session.tokudb_analyze_delete_fraction
+0.300000
+SHOW VARIABLES LIKE 'tokudb_analyze_delete_fraction';
+Variable_name Value
+tokudb_analyze_delete_fraction 0.300000
+SET SESSION tokudb_analyze_delete_fraction = @orig_session;
+SELECT @@session.tokudb_analyze_delete_fraction;
+@@session.tokudb_analyze_delete_fraction
+1.000000
+SET GLOBAL tokudb_analyze_delete_fraction = @orig_global;
+SELECT @@global.tokudb_analyze_delete_fraction;
+@@global.tokudb_analyze_delete_fraction
+1.000000
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_in_background_basic.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_in_background_basic.result
new file mode 100644
index 00000000000..53e96810eda
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_in_background_basic.result
@@ -0,0 +1,99 @@
+SET @orig_global = @@global.tokudb_analyze_in_background;
+SELECT @orig_global;
+@orig_global
+0
+SET @orig_session = @@session.tokudb_analyze_in_background;
+SELECT @orig_session;
+@orig_session
+0
+SET GLOBAL tokudb_analyze_in_background = 0;
+SELECT @@global.tokudb_analyze_in_background;
+@@global.tokudb_analyze_in_background
+0
+SET GLOBAL tokudb_analyze_in_background = 1;
+SELECT @@global.tokudb_analyze_in_background;
+@@global.tokudb_analyze_in_background
+1
+SET GLOBAL tokudb_analyze_in_background = DEFAULT;
+SELECT @@global.tokudb_analyze_in_background;
+@@global.tokudb_analyze_in_background
+0
+SET GLOBAL tokudb_analyze_in_background = -6;
+SELECT @@global.tokudb_analyze_in_background;
+@@global.tokudb_analyze_in_background
+1
+SET GLOBAL tokudb_analyze_in_background = 1.6;
+ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_in_background'
+SELECT @@global.tokudb_analyze_in_background;
+@@global.tokudb_analyze_in_background
+1
+SET GLOBAL tokudb_analyze_in_background = "T";
+ERROR 42000: Variable 'tokudb_analyze_in_background' can't be set to the value of 'T'
+SELECT @@global.tokudb_analyze_in_background;
+@@global.tokudb_analyze_in_background
+1
+SET GLOBAL tokudb_analyze_in_background = "Y";
+ERROR 42000: Variable 'tokudb_analyze_in_background' can't be set to the value of 'Y'
+SELECT @@global.tokudb_analyze_in_background;
+@@global.tokudb_analyze_in_background
+1
+SET GLOBAL tokudb_analyze_in_background = 'foobar';
+ERROR 42000: Variable 'tokudb_analyze_in_background' can't be set to the value of 'foobar'
+SELECT @@global.tokudb_analyze_in_background;
+@@global.tokudb_analyze_in_background
+1
+SET SESSION tokudb_analyze_in_background = 0;
+SELECT @@session.tokudb_analyze_in_background;
+@@session.tokudb_analyze_in_background
+0
+SET SESSION tokudb_analyze_in_background = 1;
+SELECT @@session.tokudb_analyze_in_background;
+@@session.tokudb_analyze_in_background
+1
+SET SESSION tokudb_analyze_in_background = DEFAULT;
+SELECT @@session.tokudb_analyze_in_background;
+@@session.tokudb_analyze_in_background
+1
+SET SESSION tokudb_analyze_in_background = -6;
+SELECT @@session.tokudb_analyze_in_background;
+@@session.tokudb_analyze_in_background
+1
+SET SESSION tokudb_analyze_in_background = 1.6;
+ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_in_background'
+SELECT @@session.tokudb_analyze_in_background;
+@@session.tokudb_analyze_in_background
+1
+SET SESSION tokudb_analyze_in_background = "T";
+ERROR 42000: Variable 'tokudb_analyze_in_background' can't be set to the value of 'T'
+SELECT @@session.tokudb_analyze_in_background;
+@@session.tokudb_analyze_in_background
+1
+SET SESSION tokudb_analyze_in_background = "Y";
+ERROR 42000: Variable 'tokudb_analyze_in_background' can't be set to the value of 'Y'
+SELECT @@session.tokudb_analyze_in_background;
+@@session.tokudb_analyze_in_background
+1
+SET SESSION tokudb_analyze_in_background = 'foobar';
+ERROR 42000: Variable 'tokudb_analyze_in_background' can't be set to the value of 'foobar'
+SELECT @@session.tokudb_analyze_in_background;
+@@session.tokudb_analyze_in_background
+1
+SET GLOBAL tokudb_analyze_in_background = 0;
+SET SESSION tokudb_analyze_in_background = 1;
+SELECT @@global.tokudb_analyze_in_background;
+@@global.tokudb_analyze_in_background
+0
+SELECT @@session.tokudb_analyze_in_background;
+@@session.tokudb_analyze_in_background
+1
+SHOW VARIABLES LIKE 'tokudb_analyze_in_background';
+Variable_name Value
+tokudb_analyze_in_background ON
+SET SESSION tokudb_analyze_in_background = @orig_session;
+SELECT @@session.tokudb_analyze_in_background;
+@@session.tokudb_analyze_in_background
+0
+SET GLOBAL tokudb_analyze_in_background = @orig_global;
+SELECT @@global.tokudb_analyze_in_background;
+@@global.tokudb_analyze_in_background
+0
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_mode_basic.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_mode_basic.result
new file mode 100644
index 00000000000..e2a3059a5aa
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_mode_basic.result
@@ -0,0 +1,89 @@
+SET @orig_global = @@global.tokudb_analyze_mode;
+SELECT @orig_global;
+@orig_global
+TOKUDB_ANALYZE_STANDARD
+SET @orig_session = @@session.tokudb_analyze_mode;
+SELECT @orig_session;
+@orig_session
+TOKUDB_ANALYZE_STANDARD
+SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_standard';
+SELECT @@global.tokudb_analyze_mode;
+@@global.tokudb_analyze_mode
+TOKUDB_ANALYZE_STANDARD
+SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_recount_rows';
+SELECT @@global.tokudb_analyze_mode;
+@@global.tokudb_analyze_mode
+TOKUDB_ANALYZE_RECOUNT_ROWS
+SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_cancel';
+SELECT @@global.tokudb_analyze_mode;
+@@global.tokudb_analyze_mode
+TOKUDB_ANALYZE_CANCEL
+SET GLOBAL tokudb_analyze_mode = DEFAULT;
+SELECT @@global.tokudb_analyze_mode;
+@@global.tokudb_analyze_mode
+TOKUDB_ANALYZE_STANDARD
+SET GLOBAL tokudb_analyze_mode = '';
+ERROR 42000: Variable 'tokudb_analyze_mode' can't be set to the value of ''
+SELECT @@global.tokudb_analyze_mode;
+@@global.tokudb_analyze_mode
+TOKUDB_ANALYZE_STANDARD
+SET GLOBAL tokudb_analyze_mode = 'foobar';
+ERROR 42000: Variable 'tokudb_analyze_mode' can't be set to the value of 'foobar'
+SELECT @@global.tokudb_analyze_mode;
+@@global.tokudb_analyze_mode
+TOKUDB_ANALYZE_STANDARD
+SET GLOBAL tokudb_analyze_mode = 123;
+ERROR 42000: Variable 'tokudb_analyze_mode' can't be set to the value of '123'
+SELECT @@global.tokudb_analyze_mode;
+@@global.tokudb_analyze_mode
+TOKUDB_ANALYZE_STANDARD
+SET SESSION tokudb_analyze_mode = 'tokudb_analyze_standard';
+SELECT @@session.tokudb_analyze_mode;
+@@session.tokudb_analyze_mode
+TOKUDB_ANALYZE_STANDARD
+SET SESSION tokudb_analyze_mode = 'tokudb_analyze_recount_rows';
+SELECT @@session.tokudb_analyze_mode;
+@@session.tokudb_analyze_mode
+TOKUDB_ANALYZE_RECOUNT_ROWS
+SET SESSION tokudb_analyze_mode = 'tokudb_analyze_cancel';
+SELECT @@session.tokudb_analyze_mode;
+@@session.tokudb_analyze_mode
+TOKUDB_ANALYZE_CANCEL
+SET SESSION tokudb_analyze_mode = DEFAULT;
+SELECT @@session.tokudb_analyze_mode;
+@@session.tokudb_analyze_mode
+TOKUDB_ANALYZE_STANDARD
+SET SESSION tokudb_analyze_mode = '';
+ERROR 42000: Variable 'tokudb_analyze_mode' can't be set to the value of ''
+SELECT @@session.tokudb_analyze_mode;
+@@session.tokudb_analyze_mode
+TOKUDB_ANALYZE_STANDARD
+SET SESSION tokudb_analyze_mode = 'foobar';
+ERROR 42000: Variable 'tokudb_analyze_mode' can't be set to the value of 'foobar'
+SELECT @@session.tokudb_analyze_mode;
+@@session.tokudb_analyze_mode
+TOKUDB_ANALYZE_STANDARD
+SET SESSION tokudb_analyze_mode = 123;
+ERROR 42000: Variable 'tokudb_analyze_mode' can't be set to the value of '123'
+SELECT @@session.tokudb_analyze_mode;
+@@session.tokudb_analyze_mode
+TOKUDB_ANALYZE_STANDARD
+SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_standard';
+SET SESSION tokudb_analyze_mode = 'tokudb_analyze_recount_rows';
+SELECT @@global.tokudb_analyze_mode;
+@@global.tokudb_analyze_mode
+TOKUDB_ANALYZE_STANDARD
+SELECT @@session.tokudb_analyze_mode;
+@@session.tokudb_analyze_mode
+TOKUDB_ANALYZE_RECOUNT_ROWS
+SHOW VARIABLES LIKE 'tokudb_analyze_mode';
+Variable_name Value
+tokudb_analyze_mode TOKUDB_ANALYZE_RECOUNT_ROWS
+SET SESSION tokudb_analyze_mode = @orig_session;
+SELECT @@session.tokudb_analyze_mode;
+@@session.tokudb_analyze_mode
+TOKUDB_ANALYZE_STANDARD
+SET GLOBAL tokudb_analyze_mode = @orig_global;
+SELECT @@global.tokudb_analyze_mode;
+@@global.tokudb_analyze_mode
+TOKUDB_ANALYZE_STANDARD
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_throttle_basic.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_throttle_basic.result
new file mode 100644
index 00000000000..34317c7cb7b
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_throttle_basic.result
@@ -0,0 +1,61 @@
+SET @orig_global = @@global.tokudb_analyze_throttle;
+SELECT @orig_global;
+@orig_global
+0
+SET @orig_session = @@session.tokudb_analyze_throttle;
+SELECT @orig_session;
+@orig_session
+0
+SET GLOBAL tokudb_analyze_throttle = 10;
+SELECT @@global.tokudb_analyze_throttle;
+@@global.tokudb_analyze_throttle
+10
+SET GLOBAL tokudb_analyze_throttle = 0;
+SELECT @@global.tokudb_analyze_throttle;
+@@global.tokudb_analyze_throttle
+0
+SET GLOBAL tokudb_analyze_throttle = DEFAULT;
+SELECT @@global.tokudb_analyze_throttle;
+@@global.tokudb_analyze_throttle
+0
+SET GLOBAL tokudb_analyze_throttle = 'foobar';
+ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_throttle'
+SELECT @@global.tokudb_analyze_throttle;
+@@global.tokudb_analyze_throttle
+0
+SET SESSION tokudb_analyze_throttle = 10;
+SELECT @@session.tokudb_analyze_throttle;
+@@session.tokudb_analyze_throttle
+10
+SET SESSION tokudb_analyze_throttle = 0;
+SELECT @@session.tokudb_analyze_throttle;
+@@session.tokudb_analyze_throttle
+0
+SET SESSION tokudb_analyze_throttle = DEFAULT;
+SELECT @@session.tokudb_analyze_throttle;
+@@session.tokudb_analyze_throttle
+0
+SET SESSION tokudb_analyze_throttle = 'foobar';
+ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_throttle'
+SELECT @@session.tokudb_analyze_throttle;
+@@session.tokudb_analyze_throttle
+0
+SET GLOBAL tokudb_analyze_throttle = 12;
+SET SESSION tokudb_analyze_throttle = 13;
+SELECT @@global.tokudb_analyze_throttle;
+@@global.tokudb_analyze_throttle
+12
+SELECT @@session.tokudb_analyze_throttle;
+@@session.tokudb_analyze_throttle
+13
+SHOW VARIABLES LIKE 'tokudb_analyze_throttle';
+Variable_name Value
+tokudb_analyze_throttle 13
+SET SESSION tokudb_analyze_throttle = @orig_session;
+SELECT @@session.tokudb_analyze_throttle;
+@@session.tokudb_analyze_throttle
+0
+SET GLOBAL tokudb_analyze_throttle = @orig_global;
+SELECT @@global.tokudb_analyze_throttle;
+@@global.tokudb_analyze_throttle
+0
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_time_basic.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_time_basic.result
new file mode 100644
index 00000000000..2eac1fcc3a1
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_time_basic.result
@@ -0,0 +1,61 @@
+SET @orig_global = @@global.tokudb_analyze_time;
+SELECT @orig_global;
+@orig_global
+5
+SET @orig_session = @@session.tokudb_analyze_time;
+SELECT @orig_session;
+@orig_session
+5
+SET GLOBAL tokudb_analyze_time = 10;
+SELECT @@global.tokudb_analyze_time;
+@@global.tokudb_analyze_time
+10
+SET GLOBAL tokudb_analyze_time = 0;
+SELECT @@global.tokudb_analyze_time;
+@@global.tokudb_analyze_time
+0
+SET GLOBAL tokudb_analyze_time = DEFAULT;
+SELECT @@global.tokudb_analyze_time;
+@@global.tokudb_analyze_time
+5
+SET GLOBAL tokudb_analyze_time = 'foobar';
+ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_time'
+SELECT @@global.tokudb_analyze_time;
+@@global.tokudb_analyze_time
+5
+SET SESSION tokudb_analyze_time = 10;
+SELECT @@session.tokudb_analyze_time;
+@@session.tokudb_analyze_time
+10
+SET SESSION tokudb_analyze_time = 0;
+SELECT @@session.tokudb_analyze_time;
+@@session.tokudb_analyze_time
+0
+SET SESSION tokudb_analyze_time = DEFAULT;
+SELECT @@session.tokudb_analyze_time;
+@@session.tokudb_analyze_time
+5
+SET SESSION tokudb_analyze_time = 'foobar';
+ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_time'
+SELECT @@session.tokudb_analyze_time;
+@@session.tokudb_analyze_time
+5
+SET GLOBAL tokudb_analyze_time = 12;
+SET SESSION tokudb_analyze_time = 13;
+SELECT @@global.tokudb_analyze_time;
+@@global.tokudb_analyze_time
+12
+SELECT @@session.tokudb_analyze_time;
+@@session.tokudb_analyze_time
+13
+SHOW VARIABLES LIKE 'tokudb_analyze_time';
+Variable_name Value
+tokudb_analyze_time 13
+SET SESSION tokudb_analyze_time = @orig_session;
+SELECT @@session.tokudb_analyze_time;
+@@session.tokudb_analyze_time
+5
+SET GLOBAL tokudb_analyze_time = @orig_global;
+SELECT @@global.tokudb_analyze_time;
+@@global.tokudb_analyze_time
+5
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_auto_analyze.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_auto_analyze.result
new file mode 100644
index 00000000000..5e22bc489cb
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_auto_analyze.result
@@ -0,0 +1,61 @@
+SET @orig_global = @@global.tokudb_auto_analyze;
+SELECT @orig_global;
+@orig_global
+0
+SET @orig_session = @@session.tokudb_auto_analyze;
+SELECT @orig_session;
+@orig_session
+0
+SET GLOBAL tokudb_auto_analyze = 10;
+SELECT @@global.tokudb_auto_analyze;
+@@global.tokudb_auto_analyze
+10
+SET GLOBAL tokudb_auto_analyze = 0;
+SELECT @@global.tokudb_auto_analyze;
+@@global.tokudb_auto_analyze
+0
+SET GLOBAL tokudb_auto_analyze = DEFAULT;
+SELECT @@global.tokudb_auto_analyze;
+@@global.tokudb_auto_analyze
+0
+SET GLOBAL tokudb_auto_analyze = 'foobar';
+ERROR 42000: Incorrect argument type to variable 'tokudb_auto_analyze'
+SELECT @@global.tokudb_auto_analyze;
+@@global.tokudb_auto_analyze
+0
+SET SESSION tokudb_auto_analyze = 10;
+SELECT @@session.tokudb_auto_analyze;
+@@session.tokudb_auto_analyze
+10
+SET SESSION tokudb_auto_analyze = 0;
+SELECT @@session.tokudb_auto_analyze;
+@@session.tokudb_auto_analyze
+0
+SET SESSION tokudb_auto_analyze = DEFAULT;
+SELECT @@session.tokudb_auto_analyze;
+@@session.tokudb_auto_analyze
+0
+SET SESSION tokudb_auto_analyze = 'foobar';
+ERROR 42000: Incorrect argument type to variable 'tokudb_auto_analyze'
+SELECT @@session.tokudb_auto_analyze;
+@@session.tokudb_auto_analyze
+0
+SET GLOBAL tokudb_auto_analyze = 12;
+SET SESSION tokudb_auto_analyze = 13;
+SELECT @@global.tokudb_auto_analyze;
+@@global.tokudb_auto_analyze
+12
+SELECT @@session.tokudb_auto_analyze;
+@@session.tokudb_auto_analyze
+13
+SHOW VARIABLES LIKE 'tokudb_auto_analyze';
+Variable_name Value
+tokudb_auto_analyze 13
+SET SESSION tokudb_auto_analyze = @orig_session;
+SELECT @@session.tokudb_auto_analyze;
+@@session.tokudb_auto_analyze
+0
+SET GLOBAL tokudb_auto_analyze = @orig_global;
+SELECT @@global.tokudb_auto_analyze;
+@@global.tokudb_auto_analyze
+0
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_cardinality_scale_percent_basic.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_cardinality_scale_percent_basic.result
new file mode 100644
index 00000000000..cac5d8b0dc7
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_cardinality_scale_percent_basic.result
@@ -0,0 +1,36 @@
+SET @orig_global = @@global.tokudb_cardinality_scale_percent;
+SELECT @orig_global;
+@orig_global
+50
+SET GLOBAL tokudb_cardinality_scale_percent = 10;
+SELECT @@global.tokudb_cardinality_scale_percent;
+@@global.tokudb_cardinality_scale_percent
+10
+SET GLOBAL tokudb_cardinality_scale_percent = 0;
+SELECT @@global.tokudb_cardinality_scale_percent;
+@@global.tokudb_cardinality_scale_percent
+0
+SET GLOBAL tokudb_cardinality_scale_percent = DEFAULT;
+SELECT @@global.tokudb_cardinality_scale_percent;
+@@global.tokudb_cardinality_scale_percent
+50
+SET GLOBAL tokudb_cardinality_scale_percent = 'foobar';
+ERROR 42000: Incorrect argument type to variable 'tokudb_cardinality_scale_percent'
+SELECT @@global.tokudb_cardinality_scale_percent;
+@@global.tokudb_cardinality_scale_percent
+50
+SET GLOBAL tokudb_cardinality_scale_percent = 12;
+SET SESSION tokudb_cardinality_scale_percent = 13;
+ERROR HY000: Variable 'tokudb_cardinality_scale_percent' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@global.tokudb_cardinality_scale_percent;
+@@global.tokudb_cardinality_scale_percent
+12
+SELECT @@session.tokudb_cardinality_scale_percent;
+ERROR HY000: Variable 'tokudb_cardinality_scale_percent' is a GLOBAL variable
+SHOW VARIABLES LIKE 'tokudb_cardinality_scale_percent';
+Variable_name Value
+tokudb_cardinality_scale_percent 12
+SET GLOBAL tokudb_cardinality_scale_percent = @orig_global;
+SELECT @@global.tokudb_cardinality_scale_percent;
+@@global.tokudb_cardinality_scale_percent
+50
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_pk_insert_mode_basic.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_pk_insert_mode_basic.result
new file mode 100644
index 00000000000..268c4032626
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_pk_insert_mode_basic.result
@@ -0,0 +1,85 @@
+SET @orig_global = @@global.tokudb_pk_insert_mode;
+SELECT @orig_global;
+@orig_global
+1
+SET @orig_session = @@session.tokudb_pk_insert_mode;
+SELECT @orig_session;
+@orig_session
+1
+SET GLOBAL tokudb_pk_insert_mode = 10;
+Warnings:
+Warning 1292 Truncated incorrect tokudb_pk_insert_mode value: '10'
+Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases.
+SELECT @@global.tokudb_pk_insert_mode;
+@@global.tokudb_pk_insert_mode
+2
+SET GLOBAL tokudb_pk_insert_mode = 0;
+Warnings:
+Warning 131 Using tokudb_pk_insert_mode=0 is deprecated and the parameter may be removed in future releases. Only tokudb_pk_insert_mode=1|2 is allowed.Resettig the value to 1.
+SELECT @@global.tokudb_pk_insert_mode;
+@@global.tokudb_pk_insert_mode
+1
+SET GLOBAL tokudb_pk_insert_mode = DEFAULT;
+Warnings:
+Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases.
+SELECT @@global.tokudb_pk_insert_mode;
+@@global.tokudb_pk_insert_mode
+1
+SET GLOBAL tokudb_pk_insert_mode = 'foobar';
+ERROR 42000: Incorrect argument type to variable 'tokudb_pk_insert_mode'
+SELECT @@global.tokudb_pk_insert_mode;
+@@global.tokudb_pk_insert_mode
+1
+SET SESSION tokudb_pk_insert_mode = 10;
+Warnings:
+Warning 1292 Truncated incorrect tokudb_pk_insert_mode value: '10'
+Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases.
+SELECT @@session.tokudb_pk_insert_mode;
+@@session.tokudb_pk_insert_mode
+2
+SET SESSION tokudb_pk_insert_mode = 0;
+Warnings:
+Warning 131 Using tokudb_pk_insert_mode=0 is deprecated and the parameter may be removed in future releases. Only tokudb_pk_insert_mode=1|2 is allowed.Resettig the value to 1.
+SELECT @@session.tokudb_pk_insert_mode;
+@@session.tokudb_pk_insert_mode
+1
+SET SESSION tokudb_pk_insert_mode = DEFAULT;
+Warnings:
+Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases.
+SELECT @@session.tokudb_pk_insert_mode;
+@@session.tokudb_pk_insert_mode
+1
+SET SESSION tokudb_pk_insert_mode = 'foobar';
+ERROR 42000: Incorrect argument type to variable 'tokudb_pk_insert_mode'
+SELECT @@session.tokudb_pk_insert_mode;
+@@session.tokudb_pk_insert_mode
+1
+SET GLOBAL tokudb_pk_insert_mode = 12;
+Warnings:
+Warning 1292 Truncated incorrect tokudb_pk_insert_mode value: '12'
+Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases.
+SET SESSION tokudb_pk_insert_mode = 13;
+Warnings:
+Warning 1292 Truncated incorrect tokudb_pk_insert_mode value: '13'
+Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases.
+SELECT @@global.tokudb_pk_insert_mode;
+@@global.tokudb_pk_insert_mode
+2
+SELECT @@session.tokudb_pk_insert_mode;
+@@session.tokudb_pk_insert_mode
+2
+SHOW VARIABLES LIKE 'tokudb_pk_insert_mode';
+Variable_name Value
+tokudb_pk_insert_mode 2
+SET SESSION tokudb_pk_insert_mode = @orig_session;
+Warnings:
+Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases.
+SELECT @@session.tokudb_pk_insert_mode;
+@@session.tokudb_pk_insert_mode
+1
+SET GLOBAL tokudb_pk_insert_mode = @orig_global;
+Warnings:
+Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases.
+SELECT @@global.tokudb_pk_insert_mode;
+@@global.tokudb_pk_insert_mode
+1
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/suite.opt b/storage/tokudb/mysql-test/tokudb_sys_vars/t/suite.opt
new file mode 100644
index 00000000000..23511b05020
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/suite.opt
@@ -0,0 +1 @@
+$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_delete_fraction.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_delete_fraction.test
new file mode 100644
index 00000000000..d5bd382740f
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_delete_fraction.test
@@ -0,0 +1,56 @@
+--source include/have_tokudb.inc
+
+# Check the default value
+SET @orig_global = @@global.tokudb_analyze_delete_fraction;
+SELECT @orig_global;
+
+SET @orig_session = @@session.tokudb_analyze_delete_fraction;
+SELECT @orig_session;
+
+# Test global
+SET GLOBAL tokudb_analyze_delete_fraction = .5;
+SELECT @@global.tokudb_analyze_delete_fraction;
+
+SET GLOBAL tokudb_analyze_delete_fraction = 0;
+SELECT @@global.tokudb_analyze_delete_fraction;
+
+SET GLOBAL tokudb_analyze_delete_fraction = DEFAULT;
+SELECT @@global.tokudb_analyze_delete_fraction;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL tokudb_analyze_delete_fraction = 'foobar';
+SELECT @@global.tokudb_analyze_delete_fraction;
+
+SET GLOBAL tokudb_analyze_delete_fraction = 3.75;
+SELECT @@global.tokudb_analyze_delete_fraction;
+
+# Test session
+SET SESSION tokudb_analyze_delete_fraction = .5;
+SELECT @@session.tokudb_analyze_delete_fraction;
+
+SET SESSION tokudb_analyze_delete_fraction = 0;
+SELECT @@session.tokudb_analyze_delete_fraction;
+
+SET SESSION tokudb_analyze_delete_fraction = DEFAULT;
+SELECT @@session.tokudb_analyze_delete_fraction;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET SESSION tokudb_analyze_delete_fraction = 'foobar';
+SELECT @@session.tokudb_analyze_delete_fraction;
+
+SET SESSION tokudb_analyze_delete_fraction = 3.75;
+SELECT @@session.tokudb_analyze_delete_fraction;
+
+# both
+SET GLOBAL tokudb_analyze_delete_fraction = .2;
+SET SESSION tokudb_analyze_delete_fraction = .3;
+SELECT @@global.tokudb_analyze_delete_fraction;
+SELECT @@session.tokudb_analyze_delete_fraction;
+SHOW VARIABLES LIKE 'tokudb_analyze_delete_fraction';
+
+# Clean up
+SET SESSION tokudb_analyze_delete_fraction = @orig_session;
+SELECT @@session.tokudb_analyze_delete_fraction;
+
+SET GLOBAL tokudb_analyze_delete_fraction = @orig_global;
+SELECT @@global.tokudb_analyze_delete_fraction;
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_in_background_basic.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_in_background_basic.test
new file mode 100644
index 00000000000..dfb2a0e416d
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_in_background_basic.test
@@ -0,0 +1,80 @@
+--source include/have_tokudb.inc
+
+# Check the default value
+SET @orig_global = @@global.tokudb_analyze_in_background;
+SELECT @orig_global;
+
+SET @orig_session = @@session.tokudb_analyze_in_background;
+SELECT @orig_session;
+
+# Test global
+SET GLOBAL tokudb_analyze_in_background = 0;
+SELECT @@global.tokudb_analyze_in_background;
+
+SET GLOBAL tokudb_analyze_in_background = 1;
+SELECT @@global.tokudb_analyze_in_background;
+
+SET GLOBAL tokudb_analyze_in_background = DEFAULT;
+SELECT @@global.tokudb_analyze_in_background;
+
+SET GLOBAL tokudb_analyze_in_background = -6;
+SELECT @@global.tokudb_analyze_in_background;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL tokudb_analyze_in_background = 1.6;
+SELECT @@global.tokudb_analyze_in_background;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL tokudb_analyze_in_background = "T";
+SELECT @@global.tokudb_analyze_in_background;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL tokudb_analyze_in_background = "Y";
+SELECT @@global.tokudb_analyze_in_background;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL tokudb_analyze_in_background = 'foobar';
+SELECT @@global.tokudb_analyze_in_background;
+
+# Test session
+SET SESSION tokudb_analyze_in_background = 0;
+SELECT @@session.tokudb_analyze_in_background;
+
+SET SESSION tokudb_analyze_in_background = 1;
+SELECT @@session.tokudb_analyze_in_background;
+
+SET SESSION tokudb_analyze_in_background = DEFAULT;
+SELECT @@session.tokudb_analyze_in_background;
+
+SET SESSION tokudb_analyze_in_background = -6;
+SELECT @@session.tokudb_analyze_in_background;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET SESSION tokudb_analyze_in_background = 1.6;
+SELECT @@session.tokudb_analyze_in_background;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET SESSION tokudb_analyze_in_background = "T";
+SELECT @@session.tokudb_analyze_in_background;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET SESSION tokudb_analyze_in_background = "Y";
+SELECT @@session.tokudb_analyze_in_background;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET SESSION tokudb_analyze_in_background = 'foobar';
+SELECT @@session.tokudb_analyze_in_background;
+
+# both
+SET GLOBAL tokudb_analyze_in_background = 0;
+SET SESSION tokudb_analyze_in_background = 1;
+SELECT @@global.tokudb_analyze_in_background;
+SELECT @@session.tokudb_analyze_in_background;
+SHOW VARIABLES LIKE 'tokudb_analyze_in_background';
+
+# Clean up
+SET SESSION tokudb_analyze_in_background = @orig_session;
+SELECT @@session.tokudb_analyze_in_background;
+
+SET GLOBAL tokudb_analyze_in_background = @orig_global;
+SELECT @@global.tokudb_analyze_in_background;
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_mode_basic.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_mode_basic.test
new file mode 100644
index 00000000000..69def75bd3d
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_mode_basic.test
@@ -0,0 +1,72 @@
+--source include/have_tokudb.inc
+
+# Check the default value
+SET @orig_global = @@global.tokudb_analyze_mode;
+SELECT @orig_global;
+
+SET @orig_session = @@session.tokudb_analyze_mode;
+SELECT @orig_session;
+
+# Test global
+SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_standard';
+SELECT @@global.tokudb_analyze_mode;
+
+SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_recount_rows';
+SELECT @@global.tokudb_analyze_mode;
+
+SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_cancel';
+SELECT @@global.tokudb_analyze_mode;
+
+SET GLOBAL tokudb_analyze_mode = DEFAULT;
+SELECT @@global.tokudb_analyze_mode;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL tokudb_analyze_mode = '';
+SELECT @@global.tokudb_analyze_mode;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL tokudb_analyze_mode = 'foobar';
+SELECT @@global.tokudb_analyze_mode;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL tokudb_analyze_mode = 123;
+SELECT @@global.tokudb_analyze_mode;
+
+# Test session
+SET SESSION tokudb_analyze_mode = 'tokudb_analyze_standard';
+SELECT @@session.tokudb_analyze_mode;
+
+SET SESSION tokudb_analyze_mode = 'tokudb_analyze_recount_rows';
+SELECT @@session.tokudb_analyze_mode;
+
+SET SESSION tokudb_analyze_mode = 'tokudb_analyze_cancel';
+SELECT @@session.tokudb_analyze_mode;
+
+SET SESSION tokudb_analyze_mode = DEFAULT;
+SELECT @@session.tokudb_analyze_mode;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET SESSION tokudb_analyze_mode = '';
+SELECT @@session.tokudb_analyze_mode;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET SESSION tokudb_analyze_mode = 'foobar';
+SELECT @@session.tokudb_analyze_mode;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET SESSION tokudb_analyze_mode = 123;
+SELECT @@session.tokudb_analyze_mode;
+
+# both
+SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_standard';
+SET SESSION tokudb_analyze_mode = 'tokudb_analyze_recount_rows';
+SELECT @@global.tokudb_analyze_mode;
+SELECT @@session.tokudb_analyze_mode;
+SHOW VARIABLES LIKE 'tokudb_analyze_mode';
+
+# Clean up
+SET SESSION tokudb_analyze_mode = @orig_session;
+SELECT @@session.tokudb_analyze_mode;
+
+SET GLOBAL tokudb_analyze_mode = @orig_global;
+SELECT @@global.tokudb_analyze_mode;
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_throttle_basic.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_throttle_basic.test
new file mode 100644
index 00000000000..a3660b0626a
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_throttle_basic.test
@@ -0,0 +1,50 @@
+--source include/have_tokudb.inc
+
+# Check the default value
+SET @orig_global = @@global.tokudb_analyze_throttle;
+SELECT @orig_global;
+
+SET @orig_session = @@session.tokudb_analyze_throttle;
+SELECT @orig_session;
+
+# Test global
+SET GLOBAL tokudb_analyze_throttle = 10;
+SELECT @@global.tokudb_analyze_throttle;
+
+SET GLOBAL tokudb_analyze_throttle = 0;
+SELECT @@global.tokudb_analyze_throttle;
+
+SET GLOBAL tokudb_analyze_throttle = DEFAULT;
+SELECT @@global.tokudb_analyze_throttle;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL tokudb_analyze_throttle = 'foobar';
+SELECT @@global.tokudb_analyze_throttle;
+
+# Test session
+SET SESSION tokudb_analyze_throttle = 10;
+SELECT @@session.tokudb_analyze_throttle;
+
+SET SESSION tokudb_analyze_throttle = 0;
+SELECT @@session.tokudb_analyze_throttle;
+
+SET SESSION tokudb_analyze_throttle = DEFAULT;
+SELECT @@session.tokudb_analyze_throttle;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET SESSION tokudb_analyze_throttle = 'foobar';
+SELECT @@session.tokudb_analyze_throttle;
+
+# both
+SET GLOBAL tokudb_analyze_throttle = 12;
+SET SESSION tokudb_analyze_throttle = 13;
+SELECT @@global.tokudb_analyze_throttle;
+SELECT @@session.tokudb_analyze_throttle;
+SHOW VARIABLES LIKE 'tokudb_analyze_throttle';
+
+# Clean up
+SET SESSION tokudb_analyze_throttle = @orig_session;
+SELECT @@session.tokudb_analyze_throttle;
+
+SET GLOBAL tokudb_analyze_throttle = @orig_global;
+SELECT @@global.tokudb_analyze_throttle;
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_time_basic.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_time_basic.test
new file mode 100644
index 00000000000..3098934ee8c
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_time_basic.test
@@ -0,0 +1,50 @@
+--source include/have_tokudb.inc
+
+# Check the default value
+SET @orig_global = @@global.tokudb_analyze_time;
+SELECT @orig_global;
+
+SET @orig_session = @@session.tokudb_analyze_time;
+SELECT @orig_session;
+
+# Test global
+SET GLOBAL tokudb_analyze_time = 10;
+SELECT @@global.tokudb_analyze_time;
+
+SET GLOBAL tokudb_analyze_time = 0;
+SELECT @@global.tokudb_analyze_time;
+
+SET GLOBAL tokudb_analyze_time = DEFAULT;
+SELECT @@global.tokudb_analyze_time;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL tokudb_analyze_time = 'foobar';
+SELECT @@global.tokudb_analyze_time;
+
+# Test session
+SET SESSION tokudb_analyze_time = 10;
+SELECT @@session.tokudb_analyze_time;
+
+SET SESSION tokudb_analyze_time = 0;
+SELECT @@session.tokudb_analyze_time;
+
+SET SESSION tokudb_analyze_time = DEFAULT;
+SELECT @@session.tokudb_analyze_time;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET SESSION tokudb_analyze_time = 'foobar';
+SELECT @@session.tokudb_analyze_time;
+
+# both
+SET GLOBAL tokudb_analyze_time = 12;
+SET SESSION tokudb_analyze_time = 13;
+SELECT @@global.tokudb_analyze_time;
+SELECT @@session.tokudb_analyze_time;
+SHOW VARIABLES LIKE 'tokudb_analyze_time';
+
+# Clean up
+SET SESSION tokudb_analyze_time = @orig_session;
+SELECT @@session.tokudb_analyze_time;
+
+SET GLOBAL tokudb_analyze_time = @orig_global;
+SELECT @@global.tokudb_analyze_time;
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_auto_analyze.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_auto_analyze.test
new file mode 100644
index 00000000000..d9998508ae1
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_auto_analyze.test
@@ -0,0 +1,50 @@
+--source include/have_tokudb.inc
+
+# Check the default value
+SET @orig_global = @@global.tokudb_auto_analyze;
+SELECT @orig_global;
+
+SET @orig_session = @@session.tokudb_auto_analyze;
+SELECT @orig_session;
+
+# Test global
+SET GLOBAL tokudb_auto_analyze = 10;
+SELECT @@global.tokudb_auto_analyze;
+
+SET GLOBAL tokudb_auto_analyze = 0;
+SELECT @@global.tokudb_auto_analyze;
+
+SET GLOBAL tokudb_auto_analyze = DEFAULT;
+SELECT @@global.tokudb_auto_analyze;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL tokudb_auto_analyze = 'foobar';
+SELECT @@global.tokudb_auto_analyze;
+
+# Test session
+SET SESSION tokudb_auto_analyze = 10;
+SELECT @@session.tokudb_auto_analyze;
+
+SET SESSION tokudb_auto_analyze = 0;
+SELECT @@session.tokudb_auto_analyze;
+
+SET SESSION tokudb_auto_analyze = DEFAULT;
+SELECT @@session.tokudb_auto_analyze;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET SESSION tokudb_auto_analyze = 'foobar';
+SELECT @@session.tokudb_auto_analyze;
+
+# both
+SET GLOBAL tokudb_auto_analyze = 12;
+SET SESSION tokudb_auto_analyze = 13;
+SELECT @@global.tokudb_auto_analyze;
+SELECT @@session.tokudb_auto_analyze;
+SHOW VARIABLES LIKE 'tokudb_auto_analyze';
+
+# Clean up
+SET SESSION tokudb_auto_analyze = @orig_session;
+SELECT @@session.tokudb_auto_analyze;
+
+SET GLOBAL tokudb_auto_analyze = @orig_global;
+SELECT @@global.tokudb_auto_analyze;
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_cardinality_scale_percent_basic.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_cardinality_scale_percent_basic.test
new file mode 100644
index 00000000000..83063f04248
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_cardinality_scale_percent_basic.test
@@ -0,0 +1,32 @@
+--source include/have_tokudb.inc
+
+# Check the default value
+SET @orig_global = @@global.tokudb_cardinality_scale_percent;
+SELECT @orig_global;
+
+# Test global
+SET GLOBAL tokudb_cardinality_scale_percent = 10;
+SELECT @@global.tokudb_cardinality_scale_percent;
+
+SET GLOBAL tokudb_cardinality_scale_percent = 0;
+SELECT @@global.tokudb_cardinality_scale_percent;
+
+SET GLOBAL tokudb_cardinality_scale_percent = DEFAULT;
+SELECT @@global.tokudb_cardinality_scale_percent;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL tokudb_cardinality_scale_percent = 'foobar';
+SELECT @@global.tokudb_cardinality_scale_percent;
+
+# both
+SET GLOBAL tokudb_cardinality_scale_percent = 12;
+-- error ER_GLOBAL_VARIABLE
+SET SESSION tokudb_cardinality_scale_percent = 13;
+SELECT @@global.tokudb_cardinality_scale_percent;
+-- error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.tokudb_cardinality_scale_percent;
+SHOW VARIABLES LIKE 'tokudb_cardinality_scale_percent';
+
+# Clean up
+SET GLOBAL tokudb_cardinality_scale_percent = @orig_global;
+SELECT @@global.tokudb_cardinality_scale_percent;
diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_pk_insert_mode_basic.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_pk_insert_mode_basic.test
new file mode 100644
index 00000000000..1669c7842a9
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_pk_insert_mode_basic.test
@@ -0,0 +1,51 @@
+--source include/have_tokudb.inc
+--enable_warnings
+
+# Check the default value
+SET @orig_global = @@global.tokudb_pk_insert_mode;
+SELECT @orig_global;
+
+SET @orig_session = @@session.tokudb_pk_insert_mode;
+SELECT @orig_session;
+
+# Test global
+SET GLOBAL tokudb_pk_insert_mode = 10;
+SELECT @@global.tokudb_pk_insert_mode;
+
+SET GLOBAL tokudb_pk_insert_mode = 0;
+SELECT @@global.tokudb_pk_insert_mode;
+
+SET GLOBAL tokudb_pk_insert_mode = DEFAULT;
+SELECT @@global.tokudb_pk_insert_mode;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL tokudb_pk_insert_mode = 'foobar';
+SELECT @@global.tokudb_pk_insert_mode;
+
+# Test session
+SET SESSION tokudb_pk_insert_mode = 10;
+SELECT @@session.tokudb_pk_insert_mode;
+
+SET SESSION tokudb_pk_insert_mode = 0;
+SELECT @@session.tokudb_pk_insert_mode;
+
+SET SESSION tokudb_pk_insert_mode = DEFAULT;
+SELECT @@session.tokudb_pk_insert_mode;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET SESSION tokudb_pk_insert_mode = 'foobar';
+SELECT @@session.tokudb_pk_insert_mode;
+
+# both
+SET GLOBAL tokudb_pk_insert_mode = 12;
+SET SESSION tokudb_pk_insert_mode = 13;
+SELECT @@global.tokudb_pk_insert_mode;
+SELECT @@session.tokudb_pk_insert_mode;
+SHOW VARIABLES LIKE 'tokudb_pk_insert_mode';
+
+# Clean up
+SET SESSION tokudb_pk_insert_mode = @orig_session;
+SELECT @@session.tokudb_pk_insert_mode;
+
+SET GLOBAL tokudb_pk_insert_mode = @orig_global;
+SELECT @@global.tokudb_pk_insert_mode;