1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fixed bug #14274: a query with a having clause containing only set function returned a wrong result set.

This commit is contained in:
igor@rurik.mysql.com
2006-01-07 23:00:06 -08:00
parent f7d6fa6f17
commit 05947d9916
3 changed files with 26 additions and 1 deletions

View File

@ -128,3 +128,16 @@ id description c
1 test 0
2 test2 0
drop table t1,t2,t3;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (3), (4), (1), (3), (1);
SELECT SUM(a) FROM t1 GROUP BY a HAVING SUM(a)>0;
SUM(a)
2
6
4
SELECT SUM(a) FROM t1 GROUP BY a HAVING SUM(a);
SUM(a)
2
6
4
DROP TABLE t1;

View File

@ -123,4 +123,16 @@ group by a.id, a.description
having (a.description is not null) and (c=0);
drop table t1,t2,t3;
#
# Bug #14274: HAVING clause containing only set function
#
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (3), (4), (1), (3), (1);
SELECT SUM(a) FROM t1 GROUP BY a HAVING SUM(a)>0;
SELECT SUM(a) FROM t1 GROUP BY a HAVING SUM(a);
DROP TABLE t1;
# End of 4.1 tests