• unknown's avatar
    Bug #20195: INSERT DELAYED with auto_increment is assigned wrong values · 5645198f
    unknown authored
    The INSERT DELAYED should not maintain its own private auto-increment
    counter, because this is assuming that other threads cannot insert
    into the table while the INSERT DELAYED thread is inserting, which is
    a wrong assumption.
    
    So the start of processing of a batch of INSERT rows in the 
    INSERT DELAYED thread must be treated as a start of a new statement
    and cached next_insert_id must be cleared.
    
    
    mysql-test/r/delayed.result:
      test suite for the bug
    mysql-test/t/delayed.test:
      test suite for the bug
    sql/sql_insert.cc:
      Reset auto-increment cacheing before processing
      the next batch of inserts in the handler thread
    5645198f
sql_insert.cc 83.5 KB