• Aleksey Midenkov's avatar
    MDEV-25555 Server crashes in tree_record_pos after INPLACE-recreating index on HEAP table · 5cae401b
    Aleksey Midenkov authored
    Drop and add same key is considered rename (look ALTER_RENAME_INDEX in
    fill_alter_inplace_info()). But in this case order of keys may be
    changed, because mysql_prepare_alter_table() yet does not know about
    rename and treats 2 operations: drop and add.
    
    In that case we disable inplace algorithm for such engines as Memory,
    MyISAM and Aria with ALTER_INDEX_ORDER flag. These engines have no
    specialized check_if_supported_inplace_alter() and default
    handler::check_if_supported_inplace_alter() sees an unknown flag and
    returns HA_ALTER_INPLACE_NOT_SUPPORTED.
    
    ha_innobase::check_if_supported_inplace_alter() works differently and
    inplace is not disabled (with the help of modified
    INNOBASE_INPLACE_IGNORE). add_drop_v_cols fork was also tweaked as it
    wrongly failed with MSG_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN
    when it seen ALTER_INDEX_ORDER.
    
    No-op operation must be still no-op no matter of ALTER_INDEX_ORDER
    presence, so we tweek its condition as well.
    5cae401b
handler.h 188 KB