• Sergei Petrunia's avatar
    MDEV-8299: MyISAM or Aria table gets corrupted after EXPLAIN INSERT and INSERT · a7dd24cd
    Sergei Petrunia authored
    [EXPLAIN] INSERT .. SELECT creates a select_insert object.
    select_insert calls handler->start_bulk_insert() during
    initialization.
    
    For MyISAM/Aria this requires that a matching call to
    handler->end_bulk_insert() call is made.
    
    Regular INSERT .. SELECT accomplishes this by calling either
    select_result->send_eof() or select_result->abort_result_set().
    
    EXPLAIN INSERT ... SELECT didn't call either, which resulted in
    improper de-initializaiton of handler object. Make it call
    abort_result_set(), which invokes handler->end_bulk_insert().
    a7dd24cd
explain_non_select.result 10.3 KB