summaryrefslogtreecommitdiff
path: root/mysql-test/t/having.test
diff options
context:
space:
mode:
authormonty@tik.mysql.fi <>2002-03-02 09:51:24 +0200
committermonty@tik.mysql.fi <>2002-03-02 09:51:24 +0200
commit9d9bcf25e7d6dccd531bea72f68f3317324ea051 (patch)
tree7c46a4aab7560f176209fe10d40e1ec2df488a46 /mysql-test/t/having.test
parentc639329afbde2bd9d59b488d43dde355c1c54678 (diff)
downloadmariadb-git-9d9bcf25e7d6dccd531bea72f68f3317324ea051.tar.gz
Fix sorting of NULL values (Should always be first)
Fix problem with HAVING and MAX() IS NOT NULL
Diffstat (limited to 'mysql-test/t/having.test')
-rw-r--r--mysql-test/t/having.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index fff5415976c..8dd7606d82b 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -48,3 +48,15 @@ GROUP BY e.id
HAVING chr_strand= -1 and end >= 0
AND start <= 999660;
drop table t1,t2;
+
+#
+# Test problem with having and MAX() IS NOT NULL
+#
+
+CREATE TABLE t1 (Fld1 int(11) default NULL,Fld2 int(11) default NULL);
+INSERT INTO t1 VALUES (1,10),(1,20),(2,NULL),(2,NULL),(3,50);
+select Fld1, max(Fld2) as q from t1 group by Fld1 having q is not null;
+select Fld1, max(Fld2) from t1 group by Fld1 having max(Fld2) is not null;
+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;
+drop table t1;