• Sergey Glukhov's avatar
    Bug#54416 MAX from JOIN with HAVING returning NULL with 5.1 and Empty set · 3c39a562
    Sergey Glukhov authored
    The problem there is that HAVING condition evaluates const
    parts of condition despite the condition has references
    on aggregate functions. Table t1 became const tables
    after make_join_statistics and table1.pk = 1, HAVING is
    transformed into MAX(1) < 7 and taken away from HAVING.
    The fix is to skip evaluation of HAVING conts parts if
    HAVING condition has references on aggregate functions.
    3c39a562
having.result 15.8 KB