Debian Codegraph @

mysql-test/suite/innodb/t/innodb-agregate.test

raw
1 --source include/have_innodb.inc
2
3 #
4 # MDEV-9667: Server hangs after select count(distinct name) from t2 where a=8366 and b>=5 and b<=5;
5 #
6
7 create table t2 (a smallint(6) not null, b int(10) not null, name varchar(20), primary key(a,b), key(name)) engine=InnoDB;
8
9 insert into t2 values (8355,3,"sanja"),(8355,4,"wlad"),(8366,5, "lawrin"),(8366,6,"markusjm");
10
11 select count(distinct name) from t2 where a=8366 and b>=5 and b<=5;
12 select count(distinct name) from t2 where a=8366 and b=5;
13 select count(distinct name) from t2 where a=8366 and b between 5 and 5.5;
14 select sum(distinct a) from t2 where a=8366 and b>=5 and b<=5;
15 select sum(distinct a) from t2 where a=8366 and b=5;
16 select sum(distinct a) from t2 where a=8366 and b between 5 and 5.5;
17
18 drop table t2;