diff options
Diffstat (limited to 'mysql-test/t/having.test')
-rw-r--r-- | mysql-test/t/having.test | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index 0f6be0b0ec6..1682fe5b874 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -729,6 +729,23 @@ HAVING UPPER(`column_1`) LIKE '8%'; drop table t1; --echo # +--echo # mdev-14368: grouping query with alias for aggregate function in HAVING +--echo # when sql_mode = 'ONLY_FULL_GROUP_BY' + + +set @save_sql_mode= @@sql_mode; +set sql_mode = 'ONLY_FULL_GROUP_BY'; + +create table t1(a int); +insert t1 values (4),(1),(2),(1), (3),(4); + +SELECT a, COUNT(a) as ct FROM t1 GROUP BY a HAVING ct>0; + +set sql_mode=@save_sql_mode; + +drop table t1; + +--echo # --echo # Bug mdev-5160: two-way join with HAVING over the second table --echo # |