Skip to content

Commit ae6cc54

Browse files
committed
5.6.28-76.1
1 parent dcc501a commit ae6cc54

14 files changed

+997
-182
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
create table t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
2+
create table t1a(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
3+
create table t1b(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
4+
create table t1c(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
5+
select @@session.tokudb_backup_last_error;
6+
@@session.tokudb_backup_last_error
7+
0
8+
select @@session.tokudb_backup_last_error_string;
9+
@@session.tokudb_backup_last_error_string
10+
NULL
11+
20
12+
set session tokudb_backup_exclude='(t1a|t1c)+';
13+
select @@session.tokudb_backup_last_error;
14+
@@session.tokudb_backup_last_error
15+
0
16+
select @@session.tokudb_backup_last_error_string;
17+
@@session.tokudb_backup_last_error_string
18+
NULL
19+
10
20+
set session tokudb_backup_exclude='t1[abc]+';
21+
select @@session.tokudb_backup_last_error;
22+
@@session.tokudb_backup_last_error
23+
0
24+
select @@session.tokudb_backup_last_error_string;
25+
@@session.tokudb_backup_last_error_string
26+
NULL
27+
5
28+
drop table t1;
29+
drop table t1a;
30+
drop table t1b;
31+
drop table t1c;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
create table t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
2+
set session tokudb_backup_dir='/aint/no/way/this/exists/here';
3+
ERROR 42000: Variable 'tokudb_backup_dir' can't be set to the value of '/aint/no/way/this/exists/here'
4+
select @@session.tokudb_backup_last_error;
5+
@@session.tokudb_backup_last_error
6+
2
7+
select @@session.tokudb_backup_last_error_string;
8+
@@session.tokudb_backup_last_error_string
9+
Could not get real path for /aint/no/way/this/exists/here
10+
set session tokudb_backup_last_error_string='this should not crash the server';
11+
select @@session.tokudb_backup_last_error_string;
12+
@@session.tokudb_backup_last_error_string
13+
this should not crash the server
14+
set session tokudb_backup_dir='/aint/no/way/this/exists/here';
15+
ERROR 42000: Variable 'tokudb_backup_dir' can't be set to the value of '/aint/no/way/this/exists/here'
16+
select @@session.tokudb_backup_last_error_string;
17+
@@session.tokudb_backup_last_error_string
18+
Could not get real path for /aint/no/way/this/exists/here
19+
set session tokudb_backup_last_error_string = @old_backup_last_error_string;
20+
drop table t1;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$TOKUDB_OPT $TOKUDB_LOAD_ADD $TOKUDB_BACKUP_OPT $TOKUDB_BACKUP_LOAD_ADD --loose-tokudb-check-jemalloc=0
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# This test is to specifically test the TokuDB backup excluse functionality.
2+
# This is _not_ an illustration of how to exclude tables from a TokuDB backup,
3+
# if you exclude TokuDB database files in this way, you will have a useless
4+
# backup.
5+
source include/have_tokudb_backup.inc;
6+
7+
disable_query_log;
8+
9+
set @old_backup_exclude = @@session.tokudb_backup_exclude;
10+
11+
enable_query_log;
12+
13+
# This should create 20 files prefixed with '_test_t1'
14+
create table t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
15+
create table t1a(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
16+
create table t1b(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
17+
create table t1c(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
18+
19+
# This should not filter any files
20+
disable_query_log;
21+
--exec mkdir $MYSQLTEST_VARDIR/tmp/backup
22+
--eval set session tokudb_backup_dir='$MYSQLTEST_VARDIR/tmp/backup'
23+
enable_query_log;
24+
25+
select @@session.tokudb_backup_last_error;
26+
select @@session.tokudb_backup_last_error_string;
27+
28+
# 20 files should be in the backup set
29+
--exec ls $MYSQLTEST_VARDIR/tmp/backup/mysql_data_dir | grep -c _test_t1
30+
31+
--exec rm -rf $MYSQLTEST_VARDIR/tmp/backup
32+
33+
34+
# This should filter all files for the t1a and t1c tables
35+
set session tokudb_backup_exclude='(t1a|t1c)+';
36+
37+
disable_query_log;
38+
--exec mkdir $MYSQLTEST_VARDIR/tmp/backup
39+
--eval set session tokudb_backup_dir='$MYSQLTEST_VARDIR/tmp/backup'
40+
enable_query_log;
41+
42+
select @@session.tokudb_backup_last_error;
43+
select @@session.tokudb_backup_last_error_string;
44+
45+
# 10 files should be in the backup set
46+
--exec ls $MYSQLTEST_VARDIR/tmp/backup/mysql_data_dir | grep -c _test_t1
47+
48+
--exec rm -rf $MYSQLTEST_VARDIR/tmp/backup
49+
50+
# This should filter all files for the t1a, t1b, and t1c tables
51+
set session tokudb_backup_exclude='t1[abc]+';
52+
53+
disable_query_log;
54+
--exec mkdir $MYSQLTEST_VARDIR/tmp/backup
55+
--eval set session tokudb_backup_dir='$MYSQLTEST_VARDIR/tmp/backup'
56+
enable_query_log;
57+
58+
select @@session.tokudb_backup_last_error;
59+
select @@session.tokudb_backup_last_error_string;
60+
61+
# 5 files should be in the backup set
62+
--exec ls $MYSQLTEST_VARDIR/tmp/backup/mysql_data_dir | grep -c _test_t1
63+
64+
--exec rm -rf $MYSQLTEST_VARDIR/tmp/backup
65+
66+
drop table t1;
67+
drop table t1a;
68+
drop table t1b;
69+
drop table t1c;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This test validates that the plugin will not crash if a user sets
2+
# tokudb_backup_last_error_string after performing a backup.
3+
source include/have_tokudb_backup.inc;
4+
5+
disable_query_log;
6+
7+
set @old_backup_last_error_string = @@session.tokudb_backup_last_error_string;
8+
9+
enable_query_log;
10+
11+
create table t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb';
12+
13+
# this should fail and set the error string since the dummy directory
14+
# doesn't exist
15+
--error ER_WRONG_VALUE_FOR_VAR
16+
--eval set session tokudb_backup_dir='/aint/no/way/this/exists/here'
17+
18+
select @@session.tokudb_backup_last_error;
19+
select @@session.tokudb_backup_last_error_string;
20+
21+
set session tokudb_backup_last_error_string='this should not crash the server';
22+
select @@session.tokudb_backup_last_error_string;
23+
24+
# this should fail again and set the error string since the dummy directory
25+
# doesn't exist
26+
--error ER_WRONG_VALUE_FOR_VAR
27+
--eval set session tokudb_backup_dir='/aint/no/way/this/exists/here'
28+
select @@session.tokudb_backup_last_error_string;
29+
30+
set session tokudb_backup_last_error_string = @old_backup_last_error_string;
31+
32+
drop table t1;
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# test for TokuDB clustering keys.
2+
# test assumes that a table 't1' exists with the following columns:
3+
# a int, b int, c int, d int
4+
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);
5+
6+
7+
#normal queries
8+
9+
# ignore rows column
10+
--replace_column 9 NULL;
11+
explain select * from t1 where a > 5;
12+
select * from t1 where a > 5;
13+
14+
# ignore rows column
15+
--replace_column 9 NULL;
16+
explain select * from t1 where b > 30;
17+
select * from t1 where b > 30;
18+
19+
# ignore rows column
20+
--replace_column 9 NULL;
21+
explain select * from t1 where c > 750;
22+
select * from t1 where c > 750;
23+
24+
#covering indexes
25+
26+
# ignore rows column
27+
--replace_column 9 NULL;
28+
explain select a from t1 where a > 8;
29+
select a from t1 where a > 8;
30+
31+
# ignore rows column
32+
--replace_column 9 NULL;
33+
explain select a,b from t1 where b > 30;
34+
select a,b from t1 where b > 30;
35+
36+
# ignore rows column
37+
--replace_column 9 NULL;
38+
explain select a,b from t1 where c > 750;
39+
select a,c from t1 where c > 750;
40+
41+
42+
alter table t1 add clustering index bdca(b,d,c,a);
43+
insert into t1 values (10,10,10,10);
44+
alter table t1 drop index bdca;
45+
46+
alter table t1 drop primary key;
47+
# ignore rows column
48+
--replace_column 9 NULL;
49+
explain select * from t1 where a > 5;
50+
select * from t1 where a > 5;
51+
52+
# ignore rows column
53+
--replace_column 9 NULL;
54+
explain select * from t1 where b > 30;
55+
select * from t1 where b > 30;
56+
57+
# ignore rows column
58+
--replace_column 9 NULL;
59+
explain select * from t1 where c > 750;
60+
select * from t1 where c > 750;
61+
62+
#covering indexes
63+
64+
# ignore rows column
65+
--replace_column 9 NULL;
66+
explain select b from t1 where b > 30;
67+
select b from t1 where b > 30;
68+
69+
# ignore rows column
70+
--replace_column 9 NULL;
71+
explain select b from t1 where c > 750;
72+
select c from t1 where c > 750;
73+
74+
alter table t1 add e varchar(20);
75+
76+
alter table t1 add primary key (a,b,c);
77+
78+
# ignore rows column
79+
--replace_column 9 NULL;
80+
explain select * from t1 where a > 5;
81+
select * from t1 where a > 5;
82+
83+
# ignore rows column
84+
--replace_column 9 NULL;
85+
explain select * from t1 where b > 30;
86+
select * from t1 where b > 30;
87+
88+
# ignore rows column
89+
--replace_column 9 NULL;
90+
explain select * from t1 where c > 750;
91+
select * from t1 where c > 750;
92+
93+
#covering indexes
94+
95+
# ignore rows column
96+
--replace_column 9 NULL;
97+
explain select a from t1 where a > 8;
98+
select a from t1 where a > 8;
99+
100+
# ignore rows column
101+
--replace_column 9 NULL;
102+
explain select a,b from t1 where b > 30;
103+
select a,b from t1 where b > 30;
104+
105+
# ignore rows column
106+
--replace_column 9 NULL;
107+
explain select a,b from t1 where c > 750;
108+
select a,c from t1 where c > 750;
109+
110+
111+
alter table t1 drop primary key;
112+
# ignore rows column
113+
--replace_column 9 NULL;
114+
explain select * from t1 where a > 5;
115+
select * from t1 where a > 5;
116+
117+
# ignore rows column
118+
--replace_column 9 NULL;
119+
explain select * from t1 where b > 30;
120+
select * from t1 where b > 30;
121+
122+
# ignore rows column
123+
--replace_column 9 NULL;
124+
explain select * from t1 where c > 750;
125+
select * from t1 where c > 750;
126+
127+
#covering indexes
128+
# ignore rows column
129+
--replace_column 9 NULL;
130+
explain select b from t1 where b > 30;
131+
select b from t1 where b > 30;
132+
133+
# ignore rows column
134+
--replace_column 9 NULL;
135+
explain select b from t1 where c > 750;
136+
select c from t1 where c > 750;
137+
138+

0 commit comments

Comments
 (0)