• Gleb Shchepa's avatar
    Bug #37894: Assertion in init_read_record_seq in handler.h line 1444 · 27f4c34b
    Gleb Shchepa authored
    Select with a "NULL NOT IN" condition containing complex
    subselect from the same table as in the outer select failed
    with an assertion.
    
    
    The failure was caused by a concatenation of circumstances:
    1) an inner select was optimized by make_join_statistics to use
       the QUICK_RANGE_SELECT access method (that implies an index
       scan of the table);
    2) a subselect was independent (constant) from the outer select;
    3) a condition was pushed down into inner select.
    
    During the evaluation of a constant IN expression an optimizer
    temporary changed the access method from index scan to table
    scan, but an engine handler was already initialized for index
    access by make_join_statistics. That caused an assertion.
    
    
    Unnecessary index initialization has been removed from
    the QUICK_RANGE_SELECT::init method (QUICK_RANGE_SELECT::reset
    reinvokes this initialization).
    27f4c34b
subselect3.test 17.6 KB