summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-09-27 14:29:22 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-09-27 14:29:22 +0300
commitd874cdecccc4c4702e4e78bd551e72e99453021a (patch)
tree17deeec8dc1637d8e79dd42b785ce6c812b93ad7
parent718fcee0a30e8c4e818e9f24946fa2c2def62734 (diff)
downloadmariadb-git-d874cdecccc4c4702e4e78bd551e72e99453021a.tar.gz
dict_load_table(): Remove constant parameter cached=true
Spotted by Thirunarayanan Balathandayuthapani.
-rw-r--r--storage/innobase/dict/dict0dict.cc2
-rw-r--r--storage/innobase/dict/dict0load.cc25
-rw-r--r--storage/innobase/handler/ha_innodb.cc2
-rw-r--r--storage/innobase/handler/handler0alter.cc2
-rw-r--r--storage/innobase/include/dict0load.h7
-rw-r--r--storage/innobase/include/dict0priv.ic2
-rw-r--r--storage/innobase/row/row0mysql.cc6
7 files changed, 14 insertions, 32 deletions
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 7103ee974d7..58c9cfb3178 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -1159,7 +1159,7 @@ dict_table_open_on_name(
table = dict_table_check_if_in_cache_low(table_name);
if (table == NULL) {
- table = dict_load_table(table_name, true, ignore_err);
+ table = dict_load_table(table_name, ignore_err);
}
ut_ad(!table || table->cached);
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index 6900d62b225..fc7436e97c8 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -69,7 +69,6 @@ NULL. These tables must be subsequently loaded so that all the foreign
key constraints are loaded into memory.
@param[in] name Table name in the db/tablename format
-@param[in] cached true=add to cache, false=do not
@param[in] ignore_err Error to be ignored when loading table
and its index definition
@param[out] fk_tables Related table names that must also be
@@ -82,7 +81,6 @@ static
dict_table_t*
dict_load_table_one(
const table_name_t& name,
- bool cached,
dict_err_ignore_t ignore_err,
dict_names_t& fk_tables);
@@ -2777,17 +2775,12 @@ the cluster definition if the table is a member in a cluster. Also loads
all foreign key constraints where the foreign key is in the table or where
a foreign key references columns in this table.
@param[in] name Table name in the dbname/tablename format
-@param[in] cached true=add to cache, false=do not
@param[in] ignore_err Error to be ignored when loading
table and its index definition
@return table, NULL if does not exist; if the table is stored in an
.ibd file, but the file does not exist, then we set the file_unreadable
flag in the table object we return. */
-dict_table_t*
-dict_load_table(
- const char* name,
- bool cached,
- dict_err_ignore_t ignore_err)
+dict_table_t* dict_load_table(const char* name, dict_err_ignore_t ignore_err)
{
dict_names_t fk_list;
dict_table_t* result;
@@ -2802,12 +2795,12 @@ dict_load_table(
if (!result) {
result = dict_load_table_one(const_cast<char*>(name),
- cached, ignore_err, fk_list);
+ ignore_err, fk_list);
while (!fk_list.empty()) {
if (!dict_table_check_if_in_cache_low(fk_list.front()))
dict_load_table_one(
const_cast<char*>(fk_list.front()),
- cached, ignore_err, fk_list);
+ ignore_err, fk_list);
fk_list.pop_front();
}
}
@@ -2898,7 +2891,6 @@ NULL. These tables must be subsequently loaded so that all the foreign
key constraints are loaded into memory.
@param[in] name Table name in the db/tablename format
-@param[in] cached true=add to cache, false=do not
@param[in] ignore_err Error to be ignored when loading table
and its index definition
@param[out] fk_tables Related table names that must also be
@@ -2911,7 +2903,6 @@ static
dict_table_t*
dict_load_table_one(
const table_name_t& name,
- bool cached,
dict_err_ignore_t ignore_err,
dict_names_t& fk_tables)
{
@@ -2998,11 +2989,7 @@ err_exit:
dict_load_virtual(table, heap);
- if (cached) {
- dict_table_add_to_cache(table, TRUE, heap);
- } else {
- dict_table_add_system_columns(table, heap);
- }
+ dict_table_add_to_cache(table, TRUE, heap);
mem_heap_empty(heap);
@@ -3048,7 +3035,7 @@ err_exit:
of the error condition, since the user may want to dump data from the
clustered index. However we load the foreign key information only if
all indexes were loaded. */
- if (!cached || !table->is_readable()) {
+ 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, NULL,
@@ -3229,7 +3216,7 @@ check_rec:
/* Load the table definition to memory */
char* table_name = mem_heap_strdupl(
heap, (char*) field, len);
- table = dict_load_table(table_name, true, ignore_err);
+ table = dict_load_table(table_name, ignore_err);
}
}
}
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index fb3673acf4a..5ff36aa9c24 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -12694,7 +12694,7 @@ int create_table_info_t::create_table(bool create_fk)
DICT_ERR_IGNORE_NONE,
fk_tables);
while (err == DB_SUCCESS && !fk_tables.empty()) {
- dict_load_table(fk_tables.front(), true,
+ dict_load_table(fk_tables.front(),
DICT_ERR_IGNORE_NONE);
fk_tables.pop_front();
}
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index ef7938afec3..9ed13f5ac0d 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -7446,7 +7446,7 @@ innobase_update_foreign_cache(
also be loaded. */
while (err == DB_SUCCESS && !fk_tables.empty()) {
dict_table_t* table = dict_load_table(
- fk_tables.front(), true, DICT_ERR_IGNORE_NONE);
+ fk_tables.front(), DICT_ERR_IGNORE_NONE);
if (table == NULL) {
err = DB_TABLE_NOT_FOUND;
diff --git a/storage/innobase/include/dict0load.h b/storage/innobase/include/dict0load.h
index 8d5c039a0d5..79440533ab2 100644
--- a/storage/innobase/include/dict0load.h
+++ b/storage/innobase/include/dict0load.h
@@ -110,17 +110,12 @@ the cluster definition if the table is a member in a cluster. Also loads
all foreign key constraints where the foreign key is in the table or where
a foreign key references columns in this table.
@param[in] name Table name in the dbname/tablename format
-@param[in] cached true=add to cache, false=do not
@param[in] ignore_err Error to be ignored when loading
table and its index definition
@return table, NULL if does not exist; if the table is stored in an
.ibd file, but the file does not exist, then we set the file_unreadable
flag in the table object we return. */
-dict_table_t*
-dict_load_table(
- const char* name,
- bool cached,
- dict_err_ignore_t ignore_err);
+dict_table_t* dict_load_table(const char* name, dict_err_ignore_t ignore_err);
/***********************************************************************//**
Loads a table object based on the table id.
diff --git a/storage/innobase/include/dict0priv.ic b/storage/innobase/include/dict0priv.ic
index f717ddd313a..7b584c7e1cb 100644
--- a/storage/innobase/include/dict0priv.ic
+++ b/storage/innobase/include/dict0priv.ic
@@ -55,7 +55,7 @@ dict_table_get_low(
}
if (table == NULL) {
- table = dict_load_table(table_name, true, DICT_ERR_IGNORE_NONE);
+ table = dict_load_table(table_name, DICT_ERR_IGNORE_NONE);
}
ut_ad(!table || table->cached);
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 1ecd0f7f94b..fe2a012c323 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -2671,7 +2671,7 @@ row_mysql_drop_garbage_tables()
btr_pcur_store_position(&pcur, &mtr);
btr_pcur_commit_specify_mtr(&pcur, &mtr);
- if (dict_load_table(table_name, true,
+ if (dict_load_table(table_name,
DICT_ERR_IGNORE_DROP)) {
row_drop_table_for_mysql(
table_name, trx,
@@ -3198,7 +3198,7 @@ row_drop_table_from_cache(
dict_table_remove_from_cache(table);
- if (dict_load_table(tablename, true, DICT_ERR_IGNORE_FK_NOKEY)) {
+ if (dict_load_table(tablename, DICT_ERR_IGNORE_FK_NOKEY)) {
ib::error() << "Not able to remove table "
<< ut_get_name(trx, tablename)
<< " from the dictionary cache!";
@@ -4576,7 +4576,7 @@ end:
dict_mem_table_fill_foreign_vcol_set(table);
while (!fk_tables.empty()) {
- dict_load_table(fk_tables.front(), true,
+ dict_load_table(fk_tables.front(),
DICT_ERR_IGNORE_NONE);
fk_tables.pop_front();
}