From 770e0e8118065a27c1e9583b1707864ab4c3120c Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 Jan 2006 23:00:06 -0800 Subject: Fixed bug #14274: a query with a having clause containing only set function returned a wrong result set. mysql-test/r/having.result: Added a test case for bug #14274. mysql-test/t/having.test: Added a test case for bug #14274. sql/sql_select.cc: Fixed bug #14274: a query with a having clause containing only set function returned a wrong result set. It happened because processing of the set functions in having started with a call of the split_sum_func method, instead of the split_sum_func2 method. --- mysql-test/t/having.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/t/having.test') diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index 920a3b752ab..3dd9ace6a1b 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -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 -- cgit v1.2.1