• Marko Mäkelä's avatar
    MDEV-14016 Allow instant ADD COLUMN, ADD INDEX, LOCK=NONE · 6402ca78
    Marko Mäkelä authored
    Ideally, we would move some code from
    ha_innobase::prepare_inplace_alter_table() to
    ha_innobase::check_if_supported_inplace_alter(),
    but the API does not really allow us to return errors; it can
    only inform which forms of ALGORITHM and LOCK are allowed.
    
    So, we have to duplicate some logic between the "check" and "prepare"
    phases. We do the duplication by calling common functions.
    
    instant_alter_column_possible(): Check if instant column operation
    is possible. Invoked from both
    ha_innobase::check_if_supported_inplace_alter() and
    prepare_inplace_alter_table_dict().
    
    ha_innobase::check_if_supported_inplace_alter(): Before refusing
    certain operations if FULLTEXT INDEX exist, check if instant ALTER TABLE
    is possible and return early if it is the case.
    
    prepare_inplace_alter_table_dict(): Before checking the limitations
    on FULLTEXT INDEX, check if instant ALTER TABLE is possible, and suppress
    the checks if it is the case. If instant ADD COLUMN is used when the
    table already contains FULLTEXT INDEX, do account for a
    hidden FTS_DOC_ID_INDEX in a debug assertion.
    6402ca78
alter_spatial_index.result 37.9 KB