• unknown's avatar
    Fixed bug in restoring auto-increment value in case of duplicate key with insert or update · ab0fa111
    unknown authored
    Fixed bug when calculating max_key_length that caused some ALTER TABLE to fail if MAX_ROWS was used.
    Use maria_block_size instead of MARIA_MIN_KEY_BLOCK_LENGTH
    Fixed bug when scanning table with BLOCK format for repair; If table was > bitmap coverage one page block was read twice which caused a lot of duplicate key errors
    Could not repeat Bug#34106 "auto_increment is reset to 1 when table is recovered from crash" after this patch.
    
    NOTE: This is an incompatible change, so one must do maria_chk -r on ones old Maria tables!
    Sorry, but this was needed to fix the bug with max_key_length and to be able to handle bigger key files with smaller key references
    
    
    cmd-line-utils/readline/readline.c:
      Fixed compiler warnings
    mysql-test/r/maria.result:
      Added more test of auto-increment handling
    mysql-test/t/maria.test:
      Added more test of auto-increment handling
    mysys/my_pread.c:
      Fixed wrong test
      Removed not needed tests (error is always 1 if readbytes != Count)
    mysys/my_read.c:
      Fixed wrong test
    storage/maria/ha_maria.cc:
      Disable LOAD INDEX until I got Sanja's extension to pagecache interface
    storage/maria/ma_blockrec.c:
      Ensure that info->last_auto_increment is reset properly
    storage/maria/ma_check.c:
      Fixed wrong printing of row number in case of duplicate key for --safe-repair
      Safety fix in recreate table so that Column numbers are given to maria_create() in original order
      Added missing HA_OPEN_FOR_REPAIR to maria_open()
      Fixed bug when scanning table with BLOCK format for repair; If table was > bitmap coverage one page block was read twice which caused a lot of duplicate key errors
    storage/maria/ma_create.c:
      Use correct value for how much free space there is on a key page
      Remember some missing table option when doing re-create.
      Removed optimization where last packed fields is unpacked; Caused problems for re-create.
    storage/maria/ma_delete.c:
      Ensure that info->last_auto_increment is reset properly
      Fix for update to restore autoincrement value on duplicate key
    storage/maria/ma_key_recover.c:
      Moved handling of restoring value of auto-increment in case of duplicate key from clr to undo
      This ensures the restoring works both for insert and update and also that this is symetrical to how the auto_increment value is stored
    storage/maria/ma_key_recover.h:
      Added new prototype
    storage/maria/ma_loghandler.c:
      Added hook to write_hook_for_undo_key_delete()
    storage/maria/ma_open.c:
      Fixed wrong calculation of max_key_file_length
    storage/maria/ma_page.c:
      Use maria_block_size instead of MARIA_MIN_KEY_BLOCK_LENGTH
      Increase internal buffer (safety fix)
    storage/maria/ma_search.c:
      Use maria_block_size instead of MARIA_MIN_KEY_BLOCK_LENGTH
      Note that this is an incompatible change, so one must do maria_chk -r on ones old Maria tables (sorry)
    storage/maria/ma_update.c:
      Ensure that info->last_auto_increment is reset properly
    storage/maria/ma_write.c:
      Ensure that info->last_auto_increment is reset properly
      Fix for update to restore autoincrement value on duplicate key
    storage/maria/maria_chk.c:
      Allow small page_buffer_size
      Fixed printing for --describe to better fit into 80 characters
    storage/maria/maria_def.h:
      Added comments
    ab0fa111
ma_page.c 11.2 KB