summaryrefslogtreecommitdiff
path: root/mysql-test/t/having.test
diff options
context:
space:
mode:
authormonty@narttu.mysql.fi <>2003-05-19 16:35:49 +0300
committermonty@narttu.mysql.fi <>2003-05-19 16:35:49 +0300
commitdd2b7918cdd5e0e643cff0305542ccd4aa8f1b6b (patch)
tree6025913cf3d482ba0783bf3420f7341c10cd574a /mysql-test/t/having.test
parent524878e9358706ffb5908677c746a9060c66ad32 (diff)
parentfc0df599dc72408419e80a5f1d3e07dc5f0fec88 (diff)
downloadmariadb-git-dd2b7918cdd5e0e643cff0305542ccd4aa8f1b6b.tar.gz
Merge with 4.0.13
Diffstat (limited to 'mysql-test/t/having.test')
-rw-r--r--mysql-test/t/having.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index 4bd56400f98..7d5fbee011f 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -64,3 +64,13 @@ select Fld1, max(Fld2) from t1 group by Fld1 having avg(Fld2) is not null;
select Fld1, max(Fld2) from t1 group by Fld1 having std(Fld2) is not null;
select Fld1, max(Fld2) from t1 group by Fld1 having variance(Fld2) is not null;
drop table t1;
+
+#
+# Test problem with count(distinct) in having
+#
+create table t1 (id int not null, qty int not null);
+insert into t1 values (1,2),(1,3),(2,4),(2,5);
+select id, sum(qty) as sqty from t1 group by id having sqty>2;
+select sum(qty) as sqty from t1 group by id having count(id) > 0;
+select sum(qty) as sqty from t1 group by id having count(distinct id) > 0;
+drop table t1;