• Sergei Petrunia's avatar
    MDEV-24925: Server crashes in Item_subselect::init_expr_cache_tracker · 393cf51c
    Sergei Petrunia authored
    The optimizer removes redundant GROUP BY operations. If GROUP BY element
    is a subselect, it is "eliminated".
    
    However one must not eliminate the item if it is used both in the select
    list and in the GROUP BY, like so:
    
      select (select ... ) as SUBQ from ... group by SUBQ
    
    Do not eliminate such items.
    393cf51c
sql_select.cc 910 KB