• Sergei Petrunia's avatar
    MDEV-7823: Server crashes in next_depth_first_tab on nested IN clauses with SQ inside · d443d70d
    Sergei Petrunia authored
    Consider a query with subquery in form t.key=(select ...). Suppose, the
    parent query uses this equality for ref access.
    It will attempt to evaluate the subquery in get_best_combination(),
    right before the join->join_tab[...] array is filled.  The problem was
    that subquery optimization will attempt to look at parent's join->join_tab
    to check how many times subquery will be executed (and crash).
    
    Fixed by not doing that when the subquery is constant (non-constant
    subqueries are only be evaluated during join execution, so they are not
    affected)
    d443d70d
opt_subselect.cc 192 KB