Commit 55bb279c authored by Marko Mäkelä's avatar Marko Mäkelä

Correctly resolve the conflict around commit_cache_norebuild()

parent 69e55227
...@@ -233,7 +233,6 @@ ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x); ...@@ -233,7 +233,6 @@ ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x);
SET SESSION FOREIGN_KEY_CHECKS = ON; SET SESSION FOREIGN_KEY_CHECKS = ON;
ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f); ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f);
Warnings: Warnings:
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
Warning 1088 failed to load FOREIGN KEY constraints Warning 1088 failed to load FOREIGN KEY constraints
ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f); ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
Warnings: Warnings:
......
...@@ -9084,9 +9084,10 @@ after a successful commit_try_norebuild() call. ...@@ -9084,9 +9084,10 @@ after a successful commit_try_norebuild() call.
@param ctx In-place ALTER TABLE context for the current partition @param ctx In-place ALTER TABLE context for the current partition
@param table the TABLE before the ALTER @param table the TABLE before the ALTER
@param trx Data dictionary transaction @param trx Data dictionary transaction
(will be started and committed, for DROP INDEX) */ (will be started and committed, for DROP INDEX)
@return whether all replacements were found for dropped indexes */
inline MY_ATTRIBUTE((nonnull)) inline MY_ATTRIBUTE((nonnull))
void bool
commit_cache_norebuild( commit_cache_norebuild(
/*===================*/ /*===================*/
Alter_inplace_info* ha_alter_info, Alter_inplace_info* ha_alter_info,
...@@ -9099,6 +9100,8 @@ commit_cache_norebuild( ...@@ -9099,6 +9100,8 @@ commit_cache_norebuild(
DBUG_ASSERT(ctx->new_table->space != fil_system.temp_space); DBUG_ASSERT(ctx->new_table->space != fil_system.temp_space);
DBUG_ASSERT(!ctx->new_table->is_temporary()); DBUG_ASSERT(!ctx->new_table->is_temporary());
bool found = true;
if (ctx->page_compression_level) { if (ctx->page_compression_level) {
DBUG_ASSERT(ctx->new_table->space != fil_system.sys_space); DBUG_ASSERT(ctx->new_table->space != fil_system.sys_space);
ctx->new_table->flags &= ctx->new_table->flags &=
...@@ -9201,7 +9204,7 @@ commit_cache_norebuild( ...@@ -9201,7 +9204,7 @@ commit_cache_norebuild(
if (!dict_foreign_replace_index( if (!dict_foreign_replace_index(
index->table, ctx->col_names, index)) { index->table, ctx->col_names, index)) {
ut_a(!ctx->prebuilt->trx->check_foreigns); found = false;
} }
/* Mark the index dropped /* Mark the index dropped
...@@ -9253,7 +9256,7 @@ commit_cache_norebuild( ...@@ -9253,7 +9256,7 @@ commit_cache_norebuild(
: NULL; : NULL;
DBUG_ASSERT((ctx->new_table->fts == NULL) DBUG_ASSERT((ctx->new_table->fts == NULL)
== (ctx->new_table->fts_doc_id_index == NULL)); == (ctx->new_table->fts_doc_id_index == NULL));
DBUG_VOID_RETURN; DBUG_RETURN(found);
} }
/** Adjust the persistent statistics after non-rebuilding ALTER TABLE. /** Adjust the persistent statistics after non-rebuilding ALTER TABLE.
...@@ -9868,13 +9871,11 @@ ha_innobase::commit_inplace_alter_table( ...@@ -9868,13 +9871,11 @@ ha_innobase::commit_inplace_alter_table(
bool fk_fail = innobase_update_foreign_cache( bool fk_fail = innobase_update_foreign_cache(
ctx, m_user_thd) != DB_SUCCESS; ctx, m_user_thd) != DB_SUCCESS;
commit_cache_norebuild(ha_alter_info, ctx, if (!commit_cache_norebuild(ha_alter_info, ctx, table,
table, trx); trx)) {
innobase_rename_or_enlarge_columns_cache( fk_fail = true;
ha_alter_info, table, ctx->new_table); }
#ifdef MYSQL_RENAME_INDEX
rename_indexes_in_cache(ctx, ha_alter_info);
#endif
if (fk_fail && m_prebuilt->trx->check_foreigns) { if (fk_fail && m_prebuilt->trx->check_foreigns) {
goto foreign_fail; goto foreign_fail;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment