• unknown's avatar
    Bug #31794: no syntax error on SELECT id FROM t HAVING count(*)>2 · 660eb5bb
    unknown authored
    The HAVING clause is subject to the same rules as the SELECT list
    about using aggregated and non-aggregated columns.
    But this was not enforced when processing implicit grouping from
    using aggregate functions.
    Fixed by performing the same checks for HAVING as for SELECT.
    
    
    mysql-test/r/func_group.result:
      Bug #31794: test case
    mysql-test/t/func_group.test:
      Bug #31794: test case
    sql/sql_select.cc:
      Bug #31794: Check HAVING in addition to SELECT list
    660eb5bb
func_group.test 29.6 KB