@@ -9084,9 +9084,10 @@ after a successful commit_try_norebuild() call.
9084
9084
@param ctx In-place ALTER TABLE context for the current partition
9085
9085
@param table the TABLE before the ALTER
9086
9086
@param trx Data dictionary transaction
9087
- (will be started and committed, for DROP INDEX) */
9087
+ (will be started and committed, for DROP INDEX)
9088
+ @return whether all replacements were found for dropped indexes */
9088
9089
inline MY_ATTRIBUTE ((nonnull))
9089
- void
9090
+ bool
9090
9091
commit_cache_norebuild(
9091
9092
/* ===================*/
9092
9093
Alter_inplace_info* ha_alter_info,
@@ -9099,6 +9100,8 @@ commit_cache_norebuild(
9099
9100
DBUG_ASSERT (ctx->new_table ->space != fil_system.temp_space );
9100
9101
DBUG_ASSERT (!ctx->new_table ->is_temporary ());
9101
9102
9103
+ bool found = true ;
9104
+
9102
9105
if (ctx->page_compression_level ) {
9103
9106
DBUG_ASSERT (ctx->new_table ->space != fil_system.sys_space );
9104
9107
ctx->new_table ->flags &=
@@ -9201,7 +9204,7 @@ commit_cache_norebuild(
9201
9204
9202
9205
if (!dict_foreign_replace_index (
9203
9206
index->table , ctx->col_names , index)) {
9204
- ut_a (!ctx-> prebuilt -> trx -> check_foreigns ) ;
9207
+ found = false ;
9205
9208
}
9206
9209
9207
9210
/* Mark the index dropped
@@ -9253,7 +9256,7 @@ commit_cache_norebuild(
9253
9256
: NULL ;
9254
9257
DBUG_ASSERT ((ctx->new_table ->fts == NULL )
9255
9258
== (ctx->new_table ->fts_doc_id_index == NULL ));
9256
- DBUG_VOID_RETURN ;
9259
+ DBUG_RETURN (found) ;
9257
9260
}
9258
9261
9259
9262
/* * Adjust the persistent statistics after non-rebuilding ALTER TABLE.
@@ -9868,13 +9871,11 @@ ha_innobase::commit_inplace_alter_table(
9868
9871
bool fk_fail = innobase_update_foreign_cache (
9869
9872
ctx, m_user_thd) != DB_SUCCESS;
9870
9873
9871
- commit_cache_norebuild (ha_alter_info, ctx,
9872
- table, trx);
9873
- innobase_rename_or_enlarge_columns_cache (
9874
- ha_alter_info, table, ctx->new_table );
9875
- #ifdef MYSQL_RENAME_INDEX
9876
- rename_indexes_in_cache (ctx, ha_alter_info);
9877
- #endif
9874
+ if (!commit_cache_norebuild (ha_alter_info, ctx, table,
9875
+ trx)) {
9876
+ fk_fail = true ;
9877
+ }
9878
+
9878
9879
if (fk_fail && m_prebuilt->trx ->check_foreigns ) {
9879
9880
goto foreign_fail;
9880
9881
}
0 commit comments