Skip to content

Commit d874cde

Browse files
committed
dict_load_table(): Remove constant parameter cached=true
Spotted by Thirunarayanan Balathandayuthapani.
1 parent 718fcee commit d874cde

File tree

7 files changed

+14
-32
lines changed

7 files changed

+14
-32
lines changed

storage/innobase/dict/dict0dict.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ dict_table_open_on_name(
11591159
table = dict_table_check_if_in_cache_low(table_name);
11601160

11611161
if (table == NULL) {
1162-
table = dict_load_table(table_name, true, ignore_err);
1162+
table = dict_load_table(table_name, ignore_err);
11631163
}
11641164

11651165
ut_ad(!table || table->cached);

storage/innobase/dict/dict0load.cc

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ NULL. These tables must be subsequently loaded so that all the foreign
6969
key constraints are loaded into memory.
7070
7171
@param[in] name Table name in the db/tablename format
72-
@param[in] cached true=add to cache, false=do not
7372
@param[in] ignore_err Error to be ignored when loading table
7473
and its index definition
7574
@param[out] fk_tables Related table names that must also be
@@ -82,7 +81,6 @@ static
8281
dict_table_t*
8382
dict_load_table_one(
8483
const table_name_t& name,
85-
bool cached,
8684
dict_err_ignore_t ignore_err,
8785
dict_names_t& fk_tables);
8886

@@ -2777,17 +2775,12 @@ the cluster definition if the table is a member in a cluster. Also loads
27772775
all foreign key constraints where the foreign key is in the table or where
27782776
a foreign key references columns in this table.
27792777
@param[in] name Table name in the dbname/tablename format
2780-
@param[in] cached true=add to cache, false=do not
27812778
@param[in] ignore_err Error to be ignored when loading
27822779
table and its index definition
27832780
@return table, NULL if does not exist; if the table is stored in an
27842781
.ibd file, but the file does not exist, then we set the file_unreadable
27852782
flag in the table object we return. */
2786-
dict_table_t*
2787-
dict_load_table(
2788-
const char* name,
2789-
bool cached,
2790-
dict_err_ignore_t ignore_err)
2783+
dict_table_t* dict_load_table(const char* name, dict_err_ignore_t ignore_err)
27912784
{
27922785
dict_names_t fk_list;
27932786
dict_table_t* result;
@@ -2802,12 +2795,12 @@ dict_load_table(
28022795

28032796
if (!result) {
28042797
result = dict_load_table_one(const_cast<char*>(name),
2805-
cached, ignore_err, fk_list);
2798+
ignore_err, fk_list);
28062799
while (!fk_list.empty()) {
28072800
if (!dict_table_check_if_in_cache_low(fk_list.front()))
28082801
dict_load_table_one(
28092802
const_cast<char*>(fk_list.front()),
2810-
cached, ignore_err, fk_list);
2803+
ignore_err, fk_list);
28112804
fk_list.pop_front();
28122805
}
28132806
}
@@ -2898,7 +2891,6 @@ NULL. These tables must be subsequently loaded so that all the foreign
28982891
key constraints are loaded into memory.
28992892
29002893
@param[in] name Table name in the db/tablename format
2901-
@param[in] cached true=add to cache, false=do not
29022894
@param[in] ignore_err Error to be ignored when loading table
29032895
and its index definition
29042896
@param[out] fk_tables Related table names that must also be
@@ -2911,7 +2903,6 @@ static
29112903
dict_table_t*
29122904
dict_load_table_one(
29132905
const table_name_t& name,
2914-
bool cached,
29152906
dict_err_ignore_t ignore_err,
29162907
dict_names_t& fk_tables)
29172908
{
@@ -2998,11 +2989,7 @@ dict_load_table_one(
29982989

29992990
dict_load_virtual(table, heap);
30002991

3001-
if (cached) {
3002-
dict_table_add_to_cache(table, TRUE, heap);
3003-
} else {
3004-
dict_table_add_system_columns(table, heap);
3005-
}
2992+
dict_table_add_to_cache(table, TRUE, heap);
30062993

30072994
mem_heap_empty(heap);
30082995

@@ -3048,7 +3035,7 @@ dict_load_table_one(
30483035
of the error condition, since the user may want to dump data from the
30493036
clustered index. However we load the foreign key information only if
30503037
all indexes were loaded. */
3051-
if (!cached || !table->is_readable()) {
3038+
if (!table->is_readable()) {
30523039
/* Don't attempt to load the indexes from disk. */
30533040
} else if (err == DB_SUCCESS) {
30543041
err = dict_load_foreigns(table->name.m_name, NULL,
@@ -3229,7 +3216,7 @@ dict_load_table_on_id(
32293216
/* Load the table definition to memory */
32303217
char* table_name = mem_heap_strdupl(
32313218
heap, (char*) field, len);
3232-
table = dict_load_table(table_name, true, ignore_err);
3219+
table = dict_load_table(table_name, ignore_err);
32333220
}
32343221
}
32353222
}

storage/innobase/handler/ha_innodb.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12694,7 +12694,7 @@ int create_table_info_t::create_table(bool create_fk)
1269412694
DICT_ERR_IGNORE_NONE,
1269512695
fk_tables);
1269612696
while (err == DB_SUCCESS && !fk_tables.empty()) {
12697-
dict_load_table(fk_tables.front(), true,
12697+
dict_load_table(fk_tables.front(),
1269812698
DICT_ERR_IGNORE_NONE);
1269912699
fk_tables.pop_front();
1270012700
}

storage/innobase/handler/handler0alter.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7446,7 +7446,7 @@ innobase_update_foreign_cache(
74467446
also be loaded. */
74477447
while (err == DB_SUCCESS && !fk_tables.empty()) {
74487448
dict_table_t* table = dict_load_table(
7449-
fk_tables.front(), true, DICT_ERR_IGNORE_NONE);
7449+
fk_tables.front(), DICT_ERR_IGNORE_NONE);
74507450

74517451
if (table == NULL) {
74527452
err = DB_TABLE_NOT_FOUND;

storage/innobase/include/dict0load.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,12 @@ the cluster definition if the table is a member in a cluster. Also loads
110110
all foreign key constraints where the foreign key is in the table or where
111111
a foreign key references columns in this table.
112112
@param[in] name Table name in the dbname/tablename format
113-
@param[in] cached true=add to cache, false=do not
114113
@param[in] ignore_err Error to be ignored when loading
115114
table and its index definition
116115
@return table, NULL if does not exist; if the table is stored in an
117116
.ibd file, but the file does not exist, then we set the file_unreadable
118117
flag in the table object we return. */
119-
dict_table_t*
120-
dict_load_table(
121-
const char* name,
122-
bool cached,
123-
dict_err_ignore_t ignore_err);
118+
dict_table_t* dict_load_table(const char* name, dict_err_ignore_t ignore_err);
124119

125120
/***********************************************************************//**
126121
Loads a table object based on the table id.

storage/innobase/include/dict0priv.ic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ dict_table_get_low(
5555
}
5656

5757
if (table == NULL) {
58-
table = dict_load_table(table_name, true, DICT_ERR_IGNORE_NONE);
58+
table = dict_load_table(table_name, DICT_ERR_IGNORE_NONE);
5959
}
6060

6161
ut_ad(!table || table->cached);

storage/innobase/row/row0mysql.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,7 +2671,7 @@ row_mysql_drop_garbage_tables()
26712671
btr_pcur_store_position(&pcur, &mtr);
26722672
btr_pcur_commit_specify_mtr(&pcur, &mtr);
26732673

2674-
if (dict_load_table(table_name, true,
2674+
if (dict_load_table(table_name,
26752675
DICT_ERR_IGNORE_DROP)) {
26762676
row_drop_table_for_mysql(
26772677
table_name, trx,
@@ -3198,7 +3198,7 @@ row_drop_table_from_cache(
31983198

31993199
dict_table_remove_from_cache(table);
32003200

3201-
if (dict_load_table(tablename, true, DICT_ERR_IGNORE_FK_NOKEY)) {
3201+
if (dict_load_table(tablename, DICT_ERR_IGNORE_FK_NOKEY)) {
32023202
ib::error() << "Not able to remove table "
32033203
<< ut_get_name(trx, tablename)
32043204
<< " from the dictionary cache!";
@@ -4576,7 +4576,7 @@ row_rename_table_for_mysql(
45764576
dict_mem_table_fill_foreign_vcol_set(table);
45774577

45784578
while (!fk_tables.empty()) {
4579-
dict_load_table(fk_tables.front(), true,
4579+
dict_load_table(fk_tables.front(),
45804580
DICT_ERR_IGNORE_NONE);
45814581
fk_tables.pop_front();
45824582
}

0 commit comments

Comments
 (0)