summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-08-20 14:55:49 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-08-21 11:38:33 +0300
commitddaebdd21006a6ef418a161bce919c5e850109dc (patch)
treea16537ca5a5dfa0d41568870551aff33a8edd56e /storage
parent1a3c77e524e87e8f4151d31cd9c3112df6de218f (diff)
downloadmariadb-git-ddaebdd21006a6ef418a161bce919c5e850109dc.tar.gz
dict_table_open_on_index_id(): Remove a redundant parameter
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/btr/btr0scrub.cc7
-rw-r--r--storage/innobase/dict/dict0load.cc19
-rw-r--r--storage/innobase/include/dict0dict.h7
3 files changed, 4 insertions, 29 deletions
diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc
index 376a106bf8a..bb1e5276a12 100644
--- a/storage/innobase/btr/btr0scrub.cc
+++ b/storage/innobase/btr/btr0scrub.cc
@@ -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 */
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index ae5bbac9118..a8ed8dd3e29 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -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;
}
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index cdcdef75917..fbaef118b70 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -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. */