• Igor Babaev's avatar
    MDEV-29139 Crash when using ANY predicand with redundant subquery in GROUP BY clause · bd935a41
    Igor Babaev authored
    This bug could cause a crash of the server when executing queries containing
    ANY/ALL predicands with redundant subqueries in GROUP BY clauses.
    These subqueries are eliminated by remove_redundant_subquery_clause()
    together with elimination of GROUP BY list containing these subqueries.
    However the references to the elements of the GROUP BY remained in the
    JOIN::all_fields list of the right operand of of the ALL/ANY predicand.
    Later these references confused make_aggr_tables_info() when forming
    proper execution structures after ALL/ANY predicands had been replaced
    with expressions containing MIN/MAX set functions.
    The patch just removes these references from JOIN::all_fields list used
    by the subquery of the ALL/ANY predicand when its GROUP BY clause is
    eliminated.
    
    Approved by Oleksandr Byelkin <sanja@mariadb.com>
    bd935a41
subselect4.result 115 KB