diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-06-16 00:35:57 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-06-22 12:56:33 +0200 |
commit | 3f240bff80b51458c85cd8a8b5616872f21fa033 (patch) | |
tree | 0238dc8236784e693868eb0fe0007fa176c223ba /storage/myisam | |
parent | b6ce68f450ce06db989febf4dc3e2428d6400dd7 (diff) | |
download | mariadb-git-3f240bff80b51458c85cd8a8b5616872f21fa033.tar.gz |
MDEV-13097 Online alter of a partitioned MyISAM table with auto_increment
MyISAM only allows online alter if autoincrement didn't change.
MyISAM detects that by comparing new autoinc value from create_info,
with the old one, stored in MYI. But in partitioned tables,
create_info->auto_increment_value is for the whole table, max of
autoinc values of individual MYI partitions. So *some* MYI partitions
will inevitably think that alter table changes auto_increment value
and will deny online alter.
Fix: only compare autoinc values, if the user has used AUTO_INCREMENT
in the ALTER TABLE statement.
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/ha_myisam.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index b335d360379..82bcbdb12a9 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -2266,7 +2266,8 @@ bool ha_myisam::check_if_incompatible_data(HA_CREATE_INFO *create_info, { uint options= table->s->db_options_in_use; - if (create_info->auto_increment_value != stats.auto_increment_value || + if ((create_info->used_fields & HA_CREATE_USED_AUTO && + create_info->auto_increment_value != stats.auto_increment_value) || create_info->data_file_name != data_file_name || create_info->index_file_name != index_file_name || table_changes == IS_EQUAL_NO || |