diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index b93b5f8edbc..ce31721bd72 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -2495,7 +2495,7 @@ corrupted: if (!table->is_readable()) { /* Don't attempt to load the indexes from disk. */ } else if (err == DB_SUCCESS) { - err = dict_load_foreigns(table->name.m_name, nullptr, false, + err = dict_load_foreigns(table->name.m_name, nullptr, 0, true, ignore_err, fk_tables); if (err != DB_SUCCESS) { @@ -3045,8 +3045,6 @@ dict_load_foreigns( const char* table_name, /*!< in: table name */ const char** col_names, /*!< in: column names, or NULL to use table->col_names */ - bool uncommitted, /*!< in: use READ UNCOMMITTED - transaction isolation level */ trx_id_t trx_id, /*!< in: DDL transaction id, or 0 to check recursive load of tables @@ -3161,7 +3159,7 @@ loop: /* Load the foreign constraint definition to the dictionary cache */ err = len < sizeof fk_id - ? dict_load_foreign(table_name, uncommitted, col_names, trx_id, + ? dict_load_foreign(table_name, false, col_names, trx_id, check_recursive, check_charsets, {fk_id, len}, ignore_err, fk_tables) : DB_CORRUPTION; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 9a276a8511d..3594b31140c 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -12826,7 +12826,7 @@ int create_table_info_t::create_table(bool create_fk) if (err == DB_SUCCESS) { /* Check that also referencing constraints are ok */ dict_names_t fk_tables; - err = dict_load_foreigns(m_table_name, nullptr, false, + err = dict_load_foreigns(m_table_name, nullptr, m_trx->id, true, DICT_ERR_IGNORE_NONE, fk_tables); while (err == DB_SUCCESS && !fk_tables.empty()) { diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index f17747be3e3..fa86a920dd8 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -9881,7 +9881,7 @@ innobase_update_foreign_cache( dict_names_t fk_tables; err = dict_load_foreigns(user_table->name.m_name, - ctx->col_names, false, 1, true, + ctx->col_names, 1, true, DICT_ERR_IGNORE_NONE, fk_tables); @@ -9892,7 +9892,7 @@ innobase_update_foreign_cache( loaded with "foreign_key checks" off, so let's retry the loading with charset_check is off */ err = dict_load_foreigns(user_table->name.m_name, - ctx->col_names, false, 1, false, + ctx->col_names, 1, false, DICT_ERR_IGNORE_NONE, fk_tables); diff --git a/storage/innobase/include/dict0load.h b/storage/innobase/include/dict0load.h index 3a64adf923c..a94823b4a86 100644 --- a/storage/innobase/include/dict0load.h +++ b/storage/innobase/include/dict0load.h @@ -89,8 +89,6 @@ dict_load_foreigns( const char* table_name, /*!< in: table name */ const char** col_names, /*!< in: column names, or NULL to use table->col_names */ - bool uncommitted, /*!< in: use READ UNCOMMITTED - transaction isolation level */ trx_id_t trx_id, /*!< in: DDL transaction id, or 0 to check recursive load of tables diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 0e982f59545..10fe321a702 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -2869,7 +2869,7 @@ row_rename_table_for_mysql( dict_names_t fk_tables; err = dict_load_foreigns( - new_name, nullptr, false, trx->id, + new_name, nullptr, trx->id, !old_is_tmp || trx->check_foreigns, use_fk ? DICT_ERR_IGNORE_NONE