• Sergei Petrunia's avatar
    MDEV-25380: JSON_TABLE: Assertion `join->best_read < double(1.797...) fails · 4a10dd02
    Sergei Petrunia authored
    The query used a subquery of this form:
    
    SELECT ...
    WHERE
       EXISTS( SELECT ...
               FROM JSON_TABLE(outer_ref, ..) as JT
               WHERE trivial_correlation_cond)
    
    EXISTS-to-IN conversion code was unable to see that the subquery will
    still be correlated after the trivial_correlation is removed, which
    eventually caused a crash due to inability to construct a query plan.
    
    Fixed by making Item_subselect::walk() also walk arguments of Table
    Functions.
    4a10dd02
item_subselect.cc 200 KB