1
0
mirror of https://github.com/MariaDB/server.git synced 2025-10-12 12:25:37 +03:00

MDEV-13301 Optimize DROP INDEX, ADD INDEX into RENAME INDEX

Just rename index in data dictionary and in InnoDB cache when it's possible.
Introduce ALTER_INDEX_RENAME for that purpose so that engines can optimize
such operation.

Unused code between macro MYSQL_RENAME_INDEX was removed.

compare_keys_but_name(): compare index definitions except for index names

Alter_inplace_info::rename_keys:
ha_innobase_inplace_ctx::rename_keys: vector of rename indexes

fill_alter_inplace_info():: fills Alter_inplace_info::rename_keys
This commit is contained in:
Eugene Kosov
2019-03-14 17:28:20 +03:00
committed by Sergei Golubchik
parent 5d8ca98997
commit 3a3d5ba235
13 changed files with 820 additions and 170 deletions

View File

@@ -4775,6 +4775,29 @@ handler::check_if_supported_inplace_alter(TABLE *altered_table,
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
}
Alter_inplace_info::Alter_inplace_info(HA_CREATE_INFO *create_info_arg,
Alter_info *alter_info_arg,
KEY *key_info_arg, uint key_count_arg,
partition_info *modified_part_info_arg,
bool ignore_arg)
: create_info(create_info_arg),
alter_info(alter_info_arg),
key_info_buffer(key_info_arg),
key_count(key_count_arg),
index_drop_count(0),
index_drop_buffer(nullptr),
index_add_count(0),
index_add_buffer(nullptr),
rename_keys(current_thd->mem_root),
handler_ctx(nullptr),
group_commit_ctx(nullptr),
handler_flags(0),
modified_part_info(modified_part_info_arg),
ignore(ignore_arg),
online(false),
unsupported_reason(nullptr)
{}
void Alter_inplace_info::report_unsupported_error(const char *not_supported,
const char *try_instead) const
{