diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-02-16 19:44:10 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-02-16 19:44:10 +0100 |
commit | ae6cc54a4ae6a0764330a6a1c42baae4ec34442f (patch) | |
tree | 7fb7a9a9405935fe4d0f1bfe6823e50c8f16d500 /mysql-test/suite | |
parent | dcc501aec364f27f03aabfd5db6d5362a966be86 (diff) | |
download | mariadb-git-ae6cc54a4ae6a0764330a6a1c42baae4ec34442f.tar.gz |
5.6.28-76.1
Diffstat (limited to 'mysql-test/suite')
-rw-r--r-- | mysql-test/suite/tokudb.backup/r/tokudb_backup_exclude.result | 31 | ||||
-rw-r--r-- | mysql-test/suite/tokudb.backup/r/tokudb_backup_set_last_error.result | 20 | ||||
-rw-r--r-- | mysql-test/suite/tokudb.backup/t/suite.opt | 1 | ||||
-rw-r--r-- | mysql-test/suite/tokudb.backup/t/tokudb_backup_exclude.test | 69 | ||||
-rw-r--r-- | mysql-test/suite/tokudb.backup/t/tokudb_backup_set_last_error.test | 32 | ||||
-rw-r--r-- | mysql-test/suite/tokudb/include/cluster_key.inc | 138 | ||||
-rw-r--r-- | mysql-test/suite/tokudb/r/cluster_key.result | 36 | ||||
-rw-r--r-- | mysql-test/suite/tokudb/r/cluster_key_part.result | 652 | ||||
-rw-r--r-- | mysql-test/suite/tokudb/t/cluster_key.test | 138 | ||||
-rw-r--r-- | mysql-test/suite/tokudb/t/cluster_key_part.test | 48 | ||||
-rw-r--r-- | mysql-test/suite/tokudb/t/disabled.def | 1 |
11 files changed, 992 insertions, 174 deletions
diff --git a/mysql-test/suite/tokudb.backup/r/tokudb_backup_exclude.result b/mysql-test/suite/tokudb.backup/r/tokudb_backup_exclude.result new file mode 100644 index 00000000000..0bec62e54f6 --- /dev/null +++ b/mysql-test/suite/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/mysql-test/suite/tokudb.backup/r/tokudb_backup_set_last_error.result b/mysql-test/suite/tokudb.backup/r/tokudb_backup_set_last_error.result new file mode 100644 index 00000000000..e1baf8418ad --- /dev/null +++ b/mysql-test/suite/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/mysql-test/suite/tokudb.backup/t/suite.opt b/mysql-test/suite/tokudb.backup/t/suite.opt new file mode 100644 index 00000000000..e52bd6327e0 --- /dev/null +++ b/mysql-test/suite/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/mysql-test/suite/tokudb.backup/t/tokudb_backup_exclude.test b/mysql-test/suite/tokudb.backup/t/tokudb_backup_exclude.test new file mode 100644 index 00000000000..a0ff5152f66 --- /dev/null +++ b/mysql-test/suite/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/mysql-test/suite/tokudb.backup/t/tokudb_backup_set_last_error.test b/mysql-test/suite/tokudb.backup/t/tokudb_backup_set_last_error.test new file mode 100644 index 00000000000..18fc8cc5efb --- /dev/null +++ b/mysql-test/suite/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/mysql-test/suite/tokudb/include/cluster_key.inc b/mysql-test/suite/tokudb/include/cluster_key.inc new file mode 100644 index 00000000000..dff54c432fb --- /dev/null +++ b/mysql-test/suite/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 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; +# 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/mysql-test/suite/tokudb/r/cluster_key.result b/mysql-test/suite/tokudb/r/cluster_key.result index b2a01b1e14d..9e008b5eb42 100644 --- a/mysql-test/suite/tokudb/r/cluster_key.result +++ b/mysql-test/suite/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), clustering key(b), key (c))engine=tokudb; +create table t1(a int, b int, c int, d int, primary key(a,b,c), clustering key(b), 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 +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 @@ -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 range b b 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 range 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 +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 @@ -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 +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 @@ -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 range b b 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 range 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 +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 @@ -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/mysql-test/suite/tokudb/r/cluster_key_part.result b/mysql-test/suite/tokudb/r/cluster_key_part.result index cd8fc340314..6df54cac05a 100644 --- a/mysql-test/suite/tokudb/r/cluster_key_part.result +++ b/mysql-test/suite/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/mysql-test/suite/tokudb/t/cluster_key.test b/mysql-test/suite/tokudb/t/cluster_key.test index 55420c85285..9fbd33f6a99 100644 --- a/mysql-test/suite/tokudb/t/cluster_key.test +++ b/mysql-test/suite/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), clustering key(b), key (c))engine=tokudb; +create table t1(a int, b int, c int, d int, primary key(a,b,c), clustering key(b), 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); +--source ../include/cluster_key.inc - -#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 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; -# 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; - -drop table t1;
\ No newline at end of file +drop table t1; diff --git a/mysql-test/suite/tokudb/t/cluster_key_part.test b/mysql-test/suite/tokudb/t/cluster_key_part.test index ed84404616e..b875b71fe00 100644 --- a/mysql-test/suite/tokudb/t/cluster_key_part.test +++ b/mysql-test/suite/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), 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; +SHOW CREATE TABLE t; -alter table t add clustering key(y); +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 CLUSTERING KEY(y); + +SHOW CREATE 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); + +--source ../include/cluster_key.inc + +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); + +--source ../include/cluster_key.inc + +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); + +--source ../include/cluster_key.inc + +DROP TABLE t1; diff --git a/mysql-test/suite/tokudb/t/disabled.def b/mysql-test/suite/tokudb/t/disabled.def index f65151ecd54..36e63bddab0 100644 --- a/mysql-test/suite/tokudb/t/disabled.def +++ b/mysql-test/suite/tokudb/t/disabled.def @@ -2,7 +2,6 @@ mvcc-19: tokutek mvcc-20: tokutek mvcc-27: tokutek storage_engine_default: tokudb is not the default storage engine -cluster_key_part : https://tokutek.atlassian.net/browse/DB-720 fast_update_blobs : https://tokutek.atlassian.net/browse/DB-871 fast_update_blobs_fixed_varchar : https://tokutek.atlassian.net/browse/DB-871 fast_update_blobs_with_varchar : https://tokutek.atlassian.net/browse/DB-871 |