Skip to content

Commit

Permalink
MDEV-29440 fixup: Clean up dict_load_foreigns()
Browse files Browse the repository at this point in the history
dict_load_foreigns(): Remove the constant parameter uncommitted=false.
The parameter only had to be added to dict_load_foreign().

Spotted by Alexey Midenkov
  • Loading branch information
dr-m committed Oct 5, 2022
1 parent fe449af commit b0c7b43
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
6 changes: 2 additions & 4 deletions storage/innobase/dict/dict0load.cc
Expand Up @@ -2495,7 +2495,7 @@ static dict_table_t *dict_load_table_one(const span<const char> &name,
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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -3161,7 +3159,7 @@ dict_load_foreigns(
/* 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;
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/handler/ha_innodb.cc
Expand Up @@ -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()) {
Expand Down
4 changes: 2 additions & 2 deletions storage/innobase/handler/handler0alter.cc
Expand Up @@ -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);

Expand All @@ -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);

Expand Down
2 changes: 0 additions & 2 deletions storage/innobase/include/dict0load.h
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/row/row0mysql.cc
Expand Up @@ -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
Expand Down

0 comments on commit b0c7b43

Please sign in to comment.