• Igor Babaev's avatar
    Fixed the bug mdev-12788. · 5e9d6511
    Igor Babaev authored
    In some rare cases queries with UNION ALL
    using a derived table specified by
    a grouping select with a subquery in WHERE and
    impossible HAVING detected after constant row
    substitution could hang.
    The cause was not a proper return from the
    function subselect_single_select_engine::exec()
    in the case when the subquery was not optimized
    beforehand and the optimization performed
    in this function requested for a change of the
    subquery engine. This was fixed.
    Also a change was applied that avoided execution
    of a subquery if impossible having was detected
    for the main query at the optimization stage.
    5e9d6511
sql_select.cc 855 KB