diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-02-17 11:00:51 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-02-17 11:00:51 +0100 |
commit | 84651126c0f101ea762eec0eb4045f533a00e96d (patch) | |
tree | 1bba1d0079b08cb10fe69e03942cd5f254dc735e /mysql-test/t/distinct.test | |
parent | 1fa5183241e5a8e8e91690f0c35d676e9f3334ca (diff) | |
parent | f7c8dd6bc7bb6d46d1ae2b6fdb47227429387e33 (diff) | |
download | mariadb-git-84651126c0f101ea762eec0eb4045f533a00e96d.tar.gz |
MySQL-5.5.36 merge
(without few incorrect bugfixes and with 1250 files where only a copyright year was changed)
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 |