• Marko Mäkelä's avatar
    MDEV-20117: Fix another scenario · ea2b19de
    Marko Mäkelä authored
    Thanks to Eugene Kosov for noting that the fix is incomplete.
    It turns out that on instant DROP/reorder column (MDEV-15562),
    we must always write the metadata record, even though the table
    was empty. Alternatively, we should guarantee that all undo
    log records for the table have been purged. (Attempting to do
    that by updating table_id leads to other problems; see
    commit 1b31d885.)
    
    It would be tempting to remove dict_index_t::clear_instant_alter()
    altogether, but it turns that we need that when the instant ALTER TABLE
    operation of a first-time DROP COLUMN is being rolled back.
    
    innobase_instant_try(): Clarify a comment. Purge never calls
    dict_index_t::clear_instant_alter(), but it may invoke
    dict_index_t::clear_instant_add(). On first-time instant DROP/reorder,
    always write a metadata record, even if the table is empty.
    ea2b19de
handler0alter.cc 317 KB