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
4insert 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;
11explain select * from t1 where a > 5;
12select * from t1 where a > 5;
13
14# ignore rows column
15--replace_column 9 NULL;
16explain select * from t1 where b > 30;
17select * from t1 where b > 30;
18
19# ignore rows column
20--replace_column 9 NULL;
21explain select * from t1 where c > 750;
22select * from t1 where c > 750;
23
24#covering indexes
25
26# ignore rows column
27--replace_column 9 NULL;
28explain select a from t1 where a > 8;
29select a from t1 where a > 8;
30
31# ignore rows column
32--replace_column 9 NULL;
33explain select a,b from t1 where b > 30;
34select a,b from t1 where b > 30;
35
36# ignore rows column
37--replace_column 9 NULL;
38explain select a,b from t1 where c > 750;
39select a,c from t1 where c > 750;
40
41
42alter table t1 add index bdca(b,d,c,a) clustering=yes;
43insert into t1 values (10,10,10,10);
44alter table t1 drop index bdca;
45
46alter table t1 drop primary key;
47# ignore rows column
48--replace_column 9 NULL;
49explain select * from t1 where a > 5;
50select * from t1 where a > 5;
51
52# ignore rows column
53--replace_column 9 NULL;
54explain select * from t1 where b > 30;
55select * from t1 where b > 30;
56
57# ignore rows column
58--replace_column 9 NULL;
59explain select * from t1 where c > 750;
60select * from t1 where c > 750;
61
62#covering indexes
63
64# ignore rows column
65--replace_column 9 NULL;
66explain select b from t1 where b > 30;
67select b from t1 where b > 30;
68
69# ignore rows column
70--replace_column 9 NULL;
71explain select b from t1 where c > 750;
72select c from t1 where c > 750;
73
74alter table t1 add e varchar(20);
75
76alter table t1 add primary key (a,b,c);
77
78# ignore rows column
79--replace_column 9 NULL;
80explain select * from t1 where a > 5;
81select * from t1 where a > 5;
82
83# ignore rows column
84--replace_column 9 NULL;
85explain select * from t1 where b > 30;
86select * from t1 where b > 30;
87
88# ignore rows column
89--replace_column 9 NULL;
90explain select * from t1 where c > 750;
91select * from t1 where c > 750;
92
93#covering indexes
94
95# ignore rows column
96--replace_column 9 NULL;
97explain select a from t1 where a > 8;
98select a from t1 where a > 8;
99
100# ignore rows column
101--replace_column 9 NULL;
102explain select a,b from t1 where b > 30;
103select a,b from t1 where b > 30;
104
105# ignore rows column
106--replace_column 9 NULL;
107explain select a,b from t1 where c > 750;
108select a,c from t1 where c > 750;
109
110
111alter table t1 drop primary key;
112# ignore rows column
113--replace_column 9 NULL;
114explain select * from t1 where a > 5;
115select * from t1 where a > 5;
116
117# ignore rows column
118--replace_column 9 NULL;
119explain select * from t1 where b > 30;
120select * from t1 where b > 30;
121
122# ignore rows column
123--replace_column 9 NULL;
124explain select * from t1 where c > 750;
125select * from t1 where c > 750;
126
127#covering indexes
128# ignore rows column
129--replace_column 9 NULL;
130explain select b from t1 where b > 30;
131select b from t1 where b > 30;
132
133# ignore rows column
134--replace_column 9 NULL;
135explain select b from t1 where c > 750;
136select c from t1 where c > 750;
137
138
139