MDEV-36038 ALTER TABLE…SEQUENCE does not work correctly with InnoDB

mysql_alter_table(): Consider ha_sequence::storage_ht() when determining
if the storage engine changed.

ha_sequence::check_if_supported_inplace_alter(): A new function, to
ensure that ha_innobase::check_if_supported_inplace_alter() will be
called on ALTER TABLE name_of_sequence SEQUENCE=0.

ha_innobase::check_if_supported_inplace_alter(): For any change of
the SEQUENCE attribute, always return HA_ALTER_INPLACE_NOT_SUPPORTED,
forcing ALGORITHM=COPY.
This commit is contained in:
Marko Mäkelä 2025-02-18 17:01:44 +02:00 committed by Sergei Golubchik
commit 5ebff6e15a
7 changed files with 65 additions and 1 deletions

View file

@ -2049,6 +2049,12 @@ ha_innobase::check_if_supported_inplace_alter(
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
}
if (ha_alter_info->create_info->used_fields
& HA_CREATE_USED_SEQUENCE) {
ha_alter_info->unsupported_reason = "SEQUENCE";
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
}
update_thd();
if (!m_prebuilt->table->space) {
@ -6317,6 +6323,8 @@ prepare_inplace_alter_table_dict(
DBUG_ASSERT(!ctx->add_index);
DBUG_ASSERT(!ctx->add_key_numbers);
DBUG_ASSERT(!ctx->num_to_add_index);
DBUG_ASSERT(!(ha_alter_info->create_info->used_fields
& HA_CREATE_USED_SEQUENCE));
user_table = ctx->new_table;