Kouhei Sutou
null+****@clear*****
Tue Jul 22 23:54:41 JST 2014
Kouhei Sutou 2014-07-22 23:54:41 +0900 (Tue, 22 Jul 2014) New Revision: 60b934bbd6c60f5337c7118f905c729bc788281d https://github.com/mroonga/mroonga/commit/60b934bbd6c60f5337c7118f905c729bc788281d Message: storage: support multiple operations in one "ALTER TABLE" TODO: Add test cases for the case. Modified files: ha_mroonga.cpp Modified: ha_mroonga.cpp (+13 -9) =================================================================== --- ha_mroonga.cpp 2014-07-22 23:52:06 +0900 (19e8c08) +++ ha_mroonga.cpp 2014-07-22 23:54:41 +0900 (c3cc009) @@ -13701,22 +13701,26 @@ bool ha_mroonga::storage_inplace_alter_table( Alter_inplace_info::DROP_UNIQUE_INDEX | Alter_inplace_info::ADD_PK_INDEX | Alter_inplace_info::DROP_PK_INDEX; + if (ha_alter_info->handler_flags & index_related_flags) { + have_error = storage_inplace_alter_table_index(altered_table, ha_alter_info); + } + Alter_inplace_info::HA_ALTER_FLAGS add_column_related_flags = Alter_inplace_info::ADD_COLUMN; + if (!have_error && ha_alter_info->handler_flags & add_column_related_flags) { + have_error = storage_inplace_alter_table_add_column(altered_table, ha_alter_info); + } + Alter_inplace_info::HA_ALTER_FLAGS drop_column_related_flags = Alter_inplace_info::DROP_COLUMN; + if (!have_error && ha_alter_info->handler_flags & drop_column_related_flags) { + have_error = storage_inplace_alter_table_drop_column(altered_table, ha_alter_info); + } + Alter_inplace_info::HA_ALTER_FLAGS rename_column_related_flags = Alter_inplace_info::ALTER_COLUMN_NAME; - if (ha_alter_info->handler_flags & index_related_flags) { - have_error = storage_inplace_alter_table_index(altered_table, ha_alter_info); - } else if (ha_alter_info->handler_flags & add_column_related_flags) { - have_error = storage_inplace_alter_table_add_column(altered_table, ha_alter_info); - } else if (ha_alter_info->handler_flags & drop_column_related_flags) { - have_error = storage_inplace_alter_table_drop_column(altered_table, ha_alter_info); - } else if (ha_alter_info->handler_flags & rename_column_related_flags) { + if (!have_error & ha_alter_info->handler_flags & rename_column_related_flags) { have_error = storage_inplace_alter_table_rename_column(altered_table, ha_alter_info); - } else { - have_error = true; } DBUG_RETURN(have_error); -------------- next part -------------- HTML����������������������������... 다운로드