• mariadb-DebarunBanerjee's avatar
    MDEV-18288 Transportable Tablespaces leave AUTO_INCREMENT in mismatched state,... · 66bb229e
    mariadb-DebarunBanerjee authored
    MDEV-18288 Transportable Tablespaces leave AUTO_INCREMENT in mismatched state, causing INSERT errors in newly imported tables when .cfg is not used.
    
    During import, if cfg file is not specified, we don't update the autoinc
    field in innodb dictionary object dict_table_t. The next insert tries to
    insert from the starting position of auto increment and fails.
    
    It can be observed that the issue is resolved once server is restarted
    as the persistent value is read correctly from PAGE_ROOT_AUTO_INC from
    index root page. The patch fixes the issue by reading the the auto
    increment value directly from PAGE_ROOT_AUTO_INC during import if cfg
    file is not specified.
    
    Test Fix:
    
    1. import_bugs.test: Embedded mode warning has absolute path. Regular
    expression replacement in test.
    
    2. full_crc32_import.test: Table level auto increment mismatch after
    import. It was using the auto increment data from the table prior to
    discard and import which is not right. This value has cached auto
    increment value higher than the actual inserted value and value stored
    in PAGE_ROOT_AUTO_INC. Updated the result file and added validation for
    checking the maximum value of auto increment column.
    66bb229e
full_crc32_import.test 6.68 KB