Skip to content

Commit

Permalink
dict_table_open_on_index_id(): Remove a redundant parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Aug 21, 2019
1 parent 1a3c77e commit ddaebdd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
7 changes: 1 addition & 6 deletions storage/innobase/btr/btr0scrub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -632,13 +632,8 @@ btr_scrub_get_table_and_index(
scrub_data->current_table = NULL;
}

/* argument to dict_table_open_on_index_id */
bool dict_locked = true;

/* open table based on index_id */
dict_table_t* table = dict_table_open_on_index_id(
index_id,
dict_locked);
dict_table_t* table = dict_table_open_on_index_id(index_id);

if (table != NULL) {
/* mark table as being scrubbed */
Expand Down
19 changes: 2 additions & 17 deletions storage/innobase/dict/dict0load.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3810,29 +3810,14 @@ dict_load_table_id_on_index_id(
return(found);
}

UNIV_INTERN
dict_table_t*
dict_table_open_on_index_id(
/*========================*/
index_id_t index_id, /*!< in: index id */
bool dict_locked) /*!< in: dict locked */
dict_table_t* dict_table_open_on_index_id(index_id_t index_id)
{
if (!dict_locked) {
mutex_enter(&dict_sys->mutex);
}

ut_ad(mutex_own(&dict_sys->mutex));
table_id_t table_id;
dict_table_t * table = NULL;
if (dict_load_table_id_on_index_id(index_id, &table_id)) {
bool local_dict_locked = true;
table = dict_table_open_on_id(table_id,
local_dict_locked,
table = dict_table_open_on_id(table_id, true,
DICT_TABLE_OP_LOAD_TABLESPACE);
}

if (!dict_locked) {
mutex_exit(&dict_sys->mutex);
}
return table;
}
7 changes: 1 addition & 6 deletions storage/innobase/include/dict0dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,7 @@ dict_table_open_on_id(
/**********************************************************************//**
Returns a table object based on table id.
@return table, NULL if does not exist */
UNIV_INTERN
dict_table_t*
dict_table_open_on_index_id(
/*==================*/
table_id_t table_id, /*!< in: table id */
bool dict_locked) /*!< in: TRUE=data dictionary locked */
dict_table_t* dict_table_open_on_index_id(index_id_t index_id)
__attribute__((warn_unused_result));
/********************************************************************//**
Decrements the count of open handles to a table. */
Expand Down

0 comments on commit ddaebdd

Please sign in to comment.