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

@ -11534,7 +11534,8 @@ do_continue:;
- Neither old or new engine uses files from another engine
The above is mainly true for the sequence and the partition engine.
*/
engine_changed= ((new_table->file->ht != table->file->ht) &&
engine_changed= ((new_table->file->storage_ht() !=
table->file->storage_ht()) &&
((!(new_table->file->ha_table_flags() & HA_FILE_BASED) ||
!(table->file->ha_table_flags() & HA_FILE_BASED))) &&
!(table->file->ha_table_flags() & HA_REUSES_FILE_NAMES) &&