From 2dbeebdb16436e3c2723cd483aaf21d93de799d6 Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 16 Feb 2018 10:56:03 +0200 Subject: Changed static const in Alter_info and Alter_online_info to defines Main reason was to make it easier to print the above structures in a debugger. Additional benefits is that I was able to use same defines for both structures, which simplifes some code. Most of the code is just removing Alter_info:: and Alter_inplace_info:: from alter table flags. Following renames was done: HA_ALTER_FLAGS -> alter_table_operations CHANGE_CREATE_OPTION -> ALTER_CHANGE_CREATE_OPTION Alter_info::ADD_INDEX -> ALTER_ADD_INDEX DROP_INDEX -> ALTER_DROP_INDEX ADD_UNIQUE_INDEX -> ALTER_ADD_UNIQUE_INDEX DROP_UNIQUE_INDEx -> ALTER_DROP_UNIQUE_INDEX ADD_PK_INDEX -> ALTER_ADD_PK_INDEX DROP_PK_INDEX -> ALTER_DROP_PK_INDEX Alter_info:ALTER_ADD_COLUMN -> ALTER_PARSE_ADD_COLUMN Alter_info:ALTER_DROP_COLUMN -> ALTER_PARSE_DROP_COLUMN Alter_inplace_info::ADD_INDEX -> ALTER_ADD_NON_UNIQUE_NON_PRIM_INDEX Alter_inplace_info::DROP_INDEX -> ALTER_DROP_NON_UNIQUE_NON_PRIM_INDEX Other things: - Added typedef alter_table_operatons for alter table flags - DROP CHECK CONSTRAINT can now be done online - Added checks for Aria tables in alter_table_online.test - alter_table_flags now takes an ulonglong as argument. - Don't support online operations if checksum option is used. - sql_lex.cc doesn't add ALTER_ADD_INDEX if index is not created --- sql/sql_admin.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sql/sql_admin.cc') diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 4cff69060d1..65f1f2d6627 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -339,7 +339,7 @@ static bool open_only_one_table(THD* thd, TABLE_LIST* table, to differentiate from ALTER TABLE...CHECK PARTITION on which view is not allowed. */ - if (lex->alter_info.flags & Alter_info::ALTER_ADMIN_PARTITION || + if (lex->alter_info.flags & ALTER_ADMIN_PARTITION || !is_view_operator_func) { table->required_type= TABLE_TYPE_NORMAL; @@ -562,7 +562,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, */ Alter_info *alter_info= &lex->alter_info; - if (alter_info->flags & Alter_info::ALTER_ADMIN_PARTITION) + if (alter_info->flags & ALTER_ADMIN_PARTITION) { if (!table->table->part_info) { @@ -1002,7 +1002,7 @@ send_result_message: Alter_info *alter_info= &lex->alter_info; protocol->store(STRING_WITH_LEN("note"), system_charset_info); - if (alter_info->flags & Alter_info::ALTER_ADMIN_PARTITION) + if (alter_info->flags & ALTER_ADMIN_PARTITION) { protocol->store(STRING_WITH_LEN( "Table does not support optimize on partitions. All partitions " @@ -1049,7 +1049,7 @@ send_result_message: Reset the ALTER_ADMIN_PARTITION bit in alter_info->flags to force analyze on all partitions. */ - alter_info->flags &= ~(Alter_info::ALTER_ADMIN_PARTITION); + alter_info->flags &= ~(ALTER_ADMIN_PARTITION); result_code= table->table->file->ha_analyze(thd, check_opt); if (result_code == HA_ADMIN_ALREADY_DONE) result_code= HA_ADMIN_OK; -- cgit v1.2.1