diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/group_by.result | 12 | ||||
-rw-r--r-- | mysql-test/t/group_by.test | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 200cbc29b08..7b104996769 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -30,6 +30,13 @@ Documentation 0 Host communication 0 kkkkkkkkkkk lllllllllll 3 Test Procedures 0 +value description COUNT(bug_id) +BBBBBBBBBBBBB - conversion 2 +BBBBBBBBBBBBB - eeeeeeeee 0 +BBBBBBBBBBBBB - generic 2 +Documentation 0 +Host communication 0 +Test Procedures 0 1+1 a count(*) 2 a 0 1+1 a count(*) @@ -40,6 +47,11 @@ userid count(*) 3 3 2 1 1 2 +userid count(*) +3 3 +1 2 +userid count(*) +3 3 table type possible_keys key key_len ref rows Extra t1 range spID spID 5 NULL 2 where used; Using index; Using temporary table type possible_keys key key_len ref rows Extra diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index dfbb2f325a9..c3e4f34b0fa 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -206,6 +206,7 @@ INSERT INTO t2 VALUES ('Web Interface','AAAAAAAA-AAA','id0001','',''); INSERT INTO t2 VALUES ('Host communication','AAAAA','id0001','',''); select value,description,bug_id from t2 left join t1 on t2.program=t1.product and t2.value=t1.component where program="AAAAA"; select value,description,COUNT(bug_id) from t2 left join t1 on t2.program=t1.product and t2.value=t1.component where program="AAAAA" group by value; +select value,description,COUNT(bug_id) from t2 left join t1 on t2.program=t1.product and t2.value=t1.component where program="AAAAA" group by value having COUNT(bug_id) IN (0,2); drop table t1,t2; @@ -234,6 +235,8 @@ CREATE TABLE t1 ( INSERT INTO t1 VALUES (1,1,1),(2,2,2),(2,1,1),(3,3,3),(4,3,3),(5,3,3); explain select userid,count(*) from t1 group by userid desc; select userid,count(*) from t1 group by userid desc; +select userid,count(*) from t1 group by userid desc having (count(*)+1) IN (4,3); +select userid,count(*) from t1 group by userid desc having 3 IN (1,COUNT(*)); explain select spid,count(*) from t1 where spid between 1 and 2 group by spid desc; explain select spid,count(*) from t1 where spid between 1 and 2 group by spid; select spid,count(*) from t1 where spid between 1 and 2 group by spid; |