summaryrefslogtreecommitdiff
path: root/mysql-test/r/having.result
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-02-26 16:06:31 +0300
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-02-26 16:06:31 +0300
commit84766b060a09ae3709fcd17cadc16c982c0d3a78 (patch)
treed57dcac492c1a0c330c28bcf82a1d33db6111e5b /mysql-test/r/having.result
parenta7dd42b57db41efc174b640f20bf9aff02f88415 (diff)
parent03561d35e30807e841c8544a6f5c07d708c6acbd (diff)
downloadmariadb-git-84766b060a09ae3709fcd17cadc16c982c0d3a78.tar.gz
Manual merge from mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts: Text conflict in scripts/Makefile.am Text conflict in sql/share/Makefile.am
Diffstat (limited to 'mysql-test/r/having.result')
-rw-r--r--mysql-test/r/having.result20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index f0b934ebd3a..28e798f5475 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -430,4 +430,24 @@ SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL;
b COUNT(DISTINCT a)
NULL 1
DROP TABLE t1;
+#
+# Bug#50995 Having clause on subquery result produces incorrect results.
+#
+CREATE TABLE t1
+(
+id1 INT,
+id2 INT NOT NULL,
+INDEX id1(id2)
+);
+INSERT INTO t1 SET id1=1, id2=1;
+INSERT INTO t1 SET id1=2, id2=1;
+INSERT INTO t1 SET id1=3, id2=1;
+SELECT t1.id1,
+(SELECT 0 FROM DUAL
+WHERE t1.id1=t1.id1) AS amount FROM t1
+WHERE t1.id2 = 1
+HAVING amount > 0
+ORDER BY t1.id1;
+id1 amount
+DROP TABLE t1;
End of 5.0 tests