Commit ae6cc54a authored by Sergei Golubchik's avatar Sergei Golubchik

5.6.28-76.1

parent dcc501ae
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;
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;
$TOKUDB_OPT $TOKUDB_LOAD_ADD $TOKUDB_BACKUP_OPT $TOKUDB_BACKUP_LOAD_ADD --loose-tokudb-check-jemalloc=0
# 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;
# 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;
# 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;
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
......
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;
......@@ -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;
......@@ -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;
......@@ -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
......
SET(TOKUDB_VERSION 5.6.27-76.0)
SET(TOKUDB_VERSION 5.6.28-76.1)
# PerconaFT only supports x86-64 and cmake-2.8.9+
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND
NOT CMAKE_VERSION VERSION_LESS "2.8.9")
......
......@@ -113,11 +113,11 @@ All source code and test contributions must be provided under a [BSD 2-Clause][b
License
-------
PerconaFT is available under the GPL version 2, and AGPL version 3, with slight modifications.
PerconaFT is available under the GPL version 2, and AGPL version 3.
See [COPYING.AGPLv3][agpllicense],
[COPYING.GPLv2][gpllicense], and
[PATENTS][patents].
[agpllicense]: http://github.com/Perona/PerconaFT/blob/master/COPYING.AGPLv3
[gpllicense]: http://github.com/Perona/PerconaFT/blob/master/COPYING.GPLv2
[patents]: http://github.com/Perona/PerconaFT/blob/master/PATENTS
[agpllicense]: http://github.com/Percona/PerconaFT/blob/master/COPYING.AGPLv3
[gpllicense]: http://github.com/Percona/PerconaFT/blob/master/COPYING.GPLv2
[patents]: http://github.com/Percona/PerconaFT/blob/master/PATENTS
......@@ -837,9 +837,6 @@ class ha_tokudb : public handler {
bool primary_key_is_clustered() {
return true;
}
bool supports_clustered_keys() {
return true;
}
int cmp_ref(const uchar * ref1, const uchar * ref2);
bool check_if_incompatible_data(HA_CREATE_INFO * info, uint table_changes);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment