From 8d4e8b567a518e52e975a4bdcb5748bca1ebf99a Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Wed, 9 Jul 2003 22:33:26 +0300 Subject: [PATCH] Test case for bug #807 --- mysql-test/r/group_by.result | 11 +++++++++++ mysql-test/t/group_by.test | 2 ++ 2 files changed, 13 insertions(+) diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 67e6bec09f6..f89cb8a6792 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -585,4 +585,15 @@ select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(q id sqty cqty 1 5 2 2 9 2 +select count(*), case interval(qty,2,3,4,5,6,7,8) when -1 then NULL when 0 then "zero" when 1 then "one" when 2 then "two" end as category from t1 group by category; +count(*) category +2 NULL +1 one +1 two +select count(*), interval(qty,2,3,4,5,6,7,8) as category from t1 group by category; +count(*) category +1 1 +1 2 +1 3 +1 4 drop table t1; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 67f4eb580a6..df99bc2a9dc 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -420,4 +420,6 @@ select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(q select id, sum(qty) as sqty from t1 group by id having sqty>2 and count(qty)>1; select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sqty>2 and cqty>1; select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(qty)>2 and count(qty)>1; +select count(*), case interval(qty,2,3,4,5,6,7,8) when -1 then NULL when 0 then "zero" when 1 then "one" when 2 then "two" end as category from t1 group by category; +select count(*), interval(qty,2,3,4,5,6,7,8) as category from t1 group by category; drop table t1;