• Varun Gupta's avatar
    MDEV-24779: main.subselect fails in buildbot with --ps-protocol · 7e9a6b7f
    Varun Gupta authored
    Follow-up fix to commit 26f50335(MDEV-23449)
    The GROUP BY clause inside IN/ALL/ANY subquery is removed
    when there is no aggregate function or HAVING clause in the subquery.
    
    When the GROUP BY clause is removed, a subquery can also be removed
    if it part of the GROUP BY clause. This is done inside the function
    remove_redundant_subquery_clauses. Here we walk over the GROUP BY list
    and remove a subselect from its unit via the callback function
    eliminate_subselect_processor.
    
    The issue here was that when the query was being re-executed it was trying
    to reinitialize the select that was removed as stated above.
    This is not required, so the fix would be to remove select_lex
    both from tree lex structure and the global list of nodes so that
    we don't do the reinitialization again.
    7e9a6b7f
ps.result 158 KB