diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-07-27 15:04:04 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-07-27 15:04:04 +0300 |
commit | fd9ca2a742abe2e91b2b77e70915dec7bd3cd7e1 (patch) | |
tree | a1dd480724f4b4e8a4f359a456eb90c412e6e505 /sql/sql_alter.cc | |
parent | 4968fdbcef1c2d62ed525dffac153cf9f8eb1913 (diff) | |
download | mariadb-git-fd9ca2a742abe2e91b2b77e70915dec7bd3cd7e1.tar.gz |
MDEV-23295 ROW_FORMAT mismatch in instant ALTER TABLE
An instant ADD/DROP/reorder column could create a dummy table
object with the wrong ROW_FORMAT when innodb_default_row_format
was changed between CREATE TABLE and ALTER TABLE.
prepare_inplace_alter_table_dict(): If we had promised that
ALGORITHM=INPLACE is supported, we must preserve the ROW_FORMAT.
dict_table_t::prepare_instant(): Add debug assertions to catch
ROW_FORMAT mismatch.
The rest of the changes are related to adding
Alter_inplace_info::inplace_supported to cache the return value of
handler::check_if_supported_inplace_alter().
Diffstat (limited to 'sql/sql_alter.cc')
-rw-r--r-- | sql/sql_alter.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc index 5ea835f1737..21c79a046a5 100644 --- a/sql/sql_alter.cc +++ b/sql/sql_alter.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - Copyright (c) 2016, 2018, MariaDB Corporation + Copyright (c) 2016, 2020, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -127,10 +127,10 @@ const char* Alter_info::lock() const } -bool Alter_info::supports_algorithm(THD *thd, enum_alter_inplace_result result, +bool Alter_info::supports_algorithm(THD *thd, const Alter_inplace_info *ha_alter_info) { - switch (result) { + switch (ha_alter_info->inplace_supported) { case HA_ALTER_INPLACE_EXCLUSIVE_LOCK: case HA_ALTER_INPLACE_SHARED_LOCK: case HA_ALTER_INPLACE_NO_LOCK: @@ -171,10 +171,10 @@ bool Alter_info::supports_algorithm(THD *thd, enum_alter_inplace_result result, } -bool Alter_info::supports_lock(THD *thd, enum_alter_inplace_result result, +bool Alter_info::supports_lock(THD *thd, const Alter_inplace_info *ha_alter_info) { - switch (result) { + switch (ha_alter_info->inplace_supported) { case HA_ALTER_INPLACE_EXCLUSIVE_LOCK: // If SHARED lock and no particular algorithm was requested, use COPY. if (requested_lock == Alter_info::ALTER_TABLE_LOCK_SHARED && |