• Marko Mäkelä's avatar
    MDEV-18295 IMPORT TABLESPACE fails with instant-altered tables · 4e7ee166
    Marko Mäkelä authored
    When importing a tablespace, we must initialize dummy DEFAULT NULL
    values for any instantly added columns in order to avoid a debug
    assertion failure when PageConverter::update_records() invokes
    rec_get_offsets(). Finally, when the operation completes, we must
    evict and reload the table definition, so that the correct
    default values for instantly added columns will be loaded.
    
    ha_innobase::discard_or_import_tablespace(): On successful
    IMPORT TABLESPACE, evict and reload the table definition,
    so that btr_cur_instant_init() will load the correct metadata.
    
    PageConverter::update_index_page(): Fill in dummy DEFAULT NULL values
    for instantly added columns. These will be replaced upon the
    completion of the operation by evicting and reloading the metadata.
    
    row_discard_tablespace(): Invoke dict_table_t::remove_instant().
    After DISCARD TABLESPACE, the table is no longer in "instant ALTER"
    format, because there is no data file attached.
    4e7ee166
instant_alter_import.test 1.47 KB