diff options
author | unknown <igor@rurik.mysql.com> | 2006-01-07 23:00:06 -0800 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2006-01-07 23:00:06 -0800 |
commit | 770e0e8118065a27c1e9583b1707864ab4c3120c (patch) | |
tree | 4b770f750dd504114956bf8b90f322d623837a39 /mysql-test/t/having.test | |
parent | f577d864cdac14d9a5cf7714b3506bab7688b1c7 (diff) | |
download | mariadb-git-770e0e8118065a27c1e9583b1707864ab4c3120c.tar.gz |
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.
Diffstat (limited to 'mysql-test/t/having.test')
-rw-r--r-- | mysql-test/t/having.test | 12 |
1 files changed, 12 insertions, 0 deletions
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 |