summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb/t/cluster_tokudb_bug_993_2.test
blob: 3d66b785fb797163816eecd11e9921005b708120 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--source include/have_tokudb.inc
SET DEFAULT_STORAGE_ENGINE='tokudb';
#
# Bug #22169: Crash with count(distinct)
#
--echo *** Bug #22169 ***

--disable_warnings
DROP TABLE IF EXISTS z1;
--enable_warnings

create table z1 (a int, b int, c int, d int, e int, primary key (c,d), key (a,b) clustering=yes);

insert into z1 values (1,1,1,1,1), (1,2,3,4,5), (3,4,1,100,1),(3,4,1,2,3),(3,5,1,21,1),(7,8,4,2,6),(9,10,34,3,2);
insert into z1 values (-1,-1,-1,-1,-1), (-1,-2,-3,-4,-5), (-3,-4,-1,-100,-1),(-3,-4,-1,-2,-3),(-3,-5,-1,-21,-1),(-7,-8,-4,-2,-6),(-9,-10,-34,-3,-2);



#let $1 = 2048;
#SET @a=1;
#while ($1)
#{
#  insert into z1 values (@a * -100, @a*-200, @a*-300, @a*-400, @a*-500);
#  dec $1;
#  SET @a = @a+1;
#}



select * from z1 group by a,b;


explain select a,b from z1 where a < 1;
select max(a) from z1 where a < 1;

explain select a,b from z1 where a < 9;
select max(a) from z1 where a < 9;

explain select a,b from z1 where a < 7;
select max(a) from z1 where a < 7;

explain select a,b from z1 where a < 3;
select max(a) from z1 where a < 3;

explain select max(b) from z1 where a = 1;
select max(b) from z1 where a = 1;

explain select max(b) from z1 where a = 3;
select max(b) from z1 where a = 3;

explain select max(b) from z1 where a = 9;
select max(b) from z1 where a = 9;

DROP TABLE z1;