Commit d874cdec authored by Marko Mäkelä's avatar Marko Mäkelä

dict_load_table(): Remove constant parameter cached=true

Spotted by Thirunarayanan Balathandayuthapani.
parent 718fcee0
...@@ -1159,7 +1159,7 @@ dict_table_open_on_name( ...@@ -1159,7 +1159,7 @@ dict_table_open_on_name(
table = dict_table_check_if_in_cache_low(table_name); table = dict_table_check_if_in_cache_low(table_name);
if (table == NULL) { 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); ut_ad(!table || table->cached);
......
...@@ -69,7 +69,6 @@ NULL. These tables must be subsequently loaded so that all the foreign ...@@ -69,7 +69,6 @@ NULL. These tables must be subsequently loaded so that all the foreign
key constraints are loaded into memory. key constraints are loaded into memory.
@param[in] name Table name in the db/tablename format @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 @param[in] ignore_err Error to be ignored when loading table
and its index definition and its index definition
@param[out] fk_tables Related table names that must also be @param[out] fk_tables Related table names that must also be
...@@ -82,7 +81,6 @@ static ...@@ -82,7 +81,6 @@ static
dict_table_t* dict_table_t*
dict_load_table_one( dict_load_table_one(
const table_name_t& name, const table_name_t& name,
bool cached,
dict_err_ignore_t ignore_err, dict_err_ignore_t ignore_err,
dict_names_t& fk_tables); dict_names_t& fk_tables);
...@@ -2777,17 +2775,12 @@ the cluster definition if the table is a member in a cluster. Also loads ...@@ -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 all foreign key constraints where the foreign key is in the table or where
a foreign key references columns in this table. a foreign key references columns in this table.
@param[in] name Table name in the dbname/tablename format @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 @param[in] ignore_err Error to be ignored when loading
table and its index definition table and its index definition
@return table, NULL if does not exist; if the table is stored in an @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 .ibd file, but the file does not exist, then we set the file_unreadable
flag in the table object we return. */ flag in the table object we return. */
dict_table_t* dict_table_t* dict_load_table(const char* name, dict_err_ignore_t ignore_err)
dict_load_table(
const char* name,
bool cached,
dict_err_ignore_t ignore_err)
{ {
dict_names_t fk_list; dict_names_t fk_list;
dict_table_t* result; dict_table_t* result;
...@@ -2802,12 +2795,12 @@ dict_load_table( ...@@ -2802,12 +2795,12 @@ dict_load_table(
if (!result) { if (!result) {
result = dict_load_table_one(const_cast<char*>(name), result = dict_load_table_one(const_cast<char*>(name),
cached, ignore_err, fk_list); ignore_err, fk_list);
while (!fk_list.empty()) { while (!fk_list.empty()) {
if (!dict_table_check_if_in_cache_low(fk_list.front())) if (!dict_table_check_if_in_cache_low(fk_list.front()))
dict_load_table_one( dict_load_table_one(
const_cast<char*>(fk_list.front()), const_cast<char*>(fk_list.front()),
cached, ignore_err, fk_list); ignore_err, fk_list);
fk_list.pop_front(); fk_list.pop_front();
} }
} }
...@@ -2898,7 +2891,6 @@ NULL. These tables must be subsequently loaded so that all the foreign ...@@ -2898,7 +2891,6 @@ NULL. These tables must be subsequently loaded so that all the foreign
key constraints are loaded into memory. key constraints are loaded into memory.
@param[in] name Table name in the db/tablename format @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 @param[in] ignore_err Error to be ignored when loading table
and its index definition and its index definition
@param[out] fk_tables Related table names that must also be @param[out] fk_tables Related table names that must also be
...@@ -2911,7 +2903,6 @@ static ...@@ -2911,7 +2903,6 @@ static
dict_table_t* dict_table_t*
dict_load_table_one( dict_load_table_one(
const table_name_t& name, const table_name_t& name,
bool cached,
dict_err_ignore_t ignore_err, dict_err_ignore_t ignore_err,
dict_names_t& fk_tables) dict_names_t& fk_tables)
{ {
...@@ -2998,11 +2989,7 @@ dict_load_table_one( ...@@ -2998,11 +2989,7 @@ dict_load_table_one(
dict_load_virtual(table, heap); dict_load_virtual(table, heap);
if (cached) { dict_table_add_to_cache(table, TRUE, heap);
dict_table_add_to_cache(table, TRUE, heap);
} else {
dict_table_add_system_columns(table, heap);
}
mem_heap_empty(heap); mem_heap_empty(heap);
...@@ -3048,7 +3035,7 @@ dict_load_table_one( ...@@ -3048,7 +3035,7 @@ dict_load_table_one(
of the error condition, since the user may want to dump data from the 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 clustered index. However we load the foreign key information only if
all indexes were loaded. */ all indexes were loaded. */
if (!cached || !table->is_readable()) { if (!table->is_readable()) {
/* Don't attempt to load the indexes from disk. */ /* Don't attempt to load the indexes from disk. */
} else if (err == DB_SUCCESS) { } else if (err == DB_SUCCESS) {
err = dict_load_foreigns(table->name.m_name, NULL, err = dict_load_foreigns(table->name.m_name, NULL,
...@@ -3229,7 +3216,7 @@ dict_load_table_on_id( ...@@ -3229,7 +3216,7 @@ dict_load_table_on_id(
/* Load the table definition to memory */ /* Load the table definition to memory */
char* table_name = mem_heap_strdupl( char* table_name = mem_heap_strdupl(
heap, (char*) field, len); heap, (char*) field, len);
table = dict_load_table(table_name, true, ignore_err); table = dict_load_table(table_name, ignore_err);
} }
} }
} }
......
...@@ -12694,7 +12694,7 @@ int create_table_info_t::create_table(bool create_fk) ...@@ -12694,7 +12694,7 @@ int create_table_info_t::create_table(bool create_fk)
DICT_ERR_IGNORE_NONE, DICT_ERR_IGNORE_NONE,
fk_tables); fk_tables);
while (err == DB_SUCCESS && !fk_tables.empty()) { while (err == DB_SUCCESS && !fk_tables.empty()) {
dict_load_table(fk_tables.front(), true, dict_load_table(fk_tables.front(),
DICT_ERR_IGNORE_NONE); DICT_ERR_IGNORE_NONE);
fk_tables.pop_front(); fk_tables.pop_front();
} }
......
...@@ -7446,7 +7446,7 @@ innobase_update_foreign_cache( ...@@ -7446,7 +7446,7 @@ innobase_update_foreign_cache(
also be loaded. */ also be loaded. */
while (err == DB_SUCCESS && !fk_tables.empty()) { while (err == DB_SUCCESS && !fk_tables.empty()) {
dict_table_t* table = dict_load_table( 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) { if (table == NULL) {
err = DB_TABLE_NOT_FOUND; err = DB_TABLE_NOT_FOUND;
......
...@@ -110,17 +110,12 @@ the cluster definition if the table is a member in a cluster. Also loads ...@@ -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 all foreign key constraints where the foreign key is in the table or where
a foreign key references columns in this table. a foreign key references columns in this table.
@param[in] name Table name in the dbname/tablename format @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 @param[in] ignore_err Error to be ignored when loading
table and its index definition table and its index definition
@return table, NULL if does not exist; if the table is stored in an @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 .ibd file, but the file does not exist, then we set the file_unreadable
flag in the table object we return. */ flag in the table object we return. */
dict_table_t* dict_table_t* dict_load_table(const char* name, dict_err_ignore_t ignore_err);
dict_load_table(
const char* name,
bool cached,
dict_err_ignore_t ignore_err);
/***********************************************************************//** /***********************************************************************//**
Loads a table object based on the table id. Loads a table object based on the table id.
......
...@@ -55,7 +55,7 @@ dict_table_get_low( ...@@ -55,7 +55,7 @@ dict_table_get_low(
} }
if (table == NULL) { 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); ut_ad(!table || table->cached);
......
...@@ -2671,7 +2671,7 @@ row_mysql_drop_garbage_tables() ...@@ -2671,7 +2671,7 @@ row_mysql_drop_garbage_tables()
btr_pcur_store_position(&pcur, &mtr); btr_pcur_store_position(&pcur, &mtr);
btr_pcur_commit_specify_mtr(&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)) { DICT_ERR_IGNORE_DROP)) {
row_drop_table_for_mysql( row_drop_table_for_mysql(
table_name, trx, table_name, trx,
...@@ -3198,7 +3198,7 @@ row_drop_table_from_cache( ...@@ -3198,7 +3198,7 @@ row_drop_table_from_cache(
dict_table_remove_from_cache(table); 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 " ib::error() << "Not able to remove table "
<< ut_get_name(trx, tablename) << ut_get_name(trx, tablename)
<< " from the dictionary cache!"; << " from the dictionary cache!";
...@@ -4576,7 +4576,7 @@ row_rename_table_for_mysql( ...@@ -4576,7 +4576,7 @@ row_rename_table_for_mysql(
dict_mem_table_fill_foreign_vcol_set(table); dict_mem_table_fill_foreign_vcol_set(table);
while (!fk_tables.empty()) { while (!fk_tables.empty()) {
dict_load_table(fk_tables.front(), true, dict_load_table(fk_tables.front(),
DICT_ERR_IGNORE_NONE); DICT_ERR_IGNORE_NONE);
fk_tables.pop_front(); fk_tables.pop_front();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment