diff options
Diffstat (limited to 'mysql-test/t/distinct.test')
-rw-r--r-- | mysql-test/t/distinct.test | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test index 71643a25c5a..952609be7e0 100644 --- a/mysql-test/t/distinct.test +++ b/mysql-test/t/distinct.test @@ -750,4 +750,42 @@ INSERT INTO t1 VALUES (1111, 2222), (3333, 4444); SELECT DISTINCT CONCAT(a,b) AS c FROM t1 ORDER BY 1; DROP TABLE t1; +--echo # +--echo # Bug#16539979 BASIC SELECT COUNT(DISTINCT ID) IS BROKEN. +--echo # Bug#17867117 ERROR RESULT WHEN "COUNT + DISTINCT + CASE WHEN" NEED MERGE_WALK +--echo # + +SET @tmp_table_size_save= @@tmp_table_size; +SET @@tmp_table_size= 1024; + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8); +INSERT INTO t1 SELECT a+8 FROM t1; +INSERT INTO t1 SELECT a+16 FROM t1; +INSERT INTO t1 SELECT a+32 FROM t1; +INSERT INTO t1 SELECT a+64 FROM t1; +INSERT INTO t1 VALUE(NULL); +SELECT COUNT(DISTINCT a) FROM t1; +SELECT COUNT(DISTINCT (a+0)) FROM t1; +DROP TABLE t1; + +create table tb( +id int auto_increment primary key, +v varchar(32)) +engine=myisam charset=gbk; +insert into tb(v) values("aaa"); +insert into tb(v) (select v from tb); +insert into tb(v) (select v from tb); +insert into tb(v) (select v from tb); +insert into tb(v) (select v from tb); +insert into tb(v) (select v from tb); +insert into tb(v) (select v from tb); + +update tb set v=concat(v, id); +select count(distinct case when id<=64 then id end) from tb; +select count(distinct case when id<=63 then id end) from tb; +drop table tb; + +SET @@tmp_table_size= @tmp_table_size_save; + --echo End of 5.5 tests |