diff options
-rw-r--r-- | sql/backup.cc | 2 | ||||
-rw-r--r-- | sql/sql_base.cc | 12 | ||||
-rw-r--r-- | sql/sql_base.h | 2 | ||||
-rw-r--r-- | sql/table_cache.cc | 6 | ||||
-rw-r--r-- | sql/table_cache.h | 2 |
5 files changed, 10 insertions, 14 deletions
diff --git a/sql/backup.cc b/sql/backup.cc index 5976506cf92..1a0341ad9a4 100644 --- a/sql/backup.cc +++ b/sql/backup.cc @@ -204,7 +204,7 @@ static bool backup_flush(THD *thd) Free unused tables and table shares so that mariabackup knows what is safe to copy */ - tc_purge(false); + tc_purge(); tdc_purge(true); DBUG_RETURN(0); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 48cc72b312b..60e2b9957a4 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -311,13 +311,9 @@ OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *db, const char *wild) /** Close all tables that are not in use in table definition cache - - @param purge_flag Argument for tc_purge. true if we should force all - shares to be deleted. false if it's enough to just - evict those that are not in use. */ -void purge_tables(bool purge_flag) +void purge_tables() { /* Force close of all open tables. @@ -331,7 +327,7 @@ void purge_tables(bool purge_flag) Get rid of all unused TABLE and TABLE_SHARE instances. By doing this we automatically close all tables which were marked as "old". */ - tc_purge(purge_flag); + tc_purge(); /* Free table shares which were not freed implicitly by loop above. */ tdc_purge(true); } @@ -360,7 +356,7 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables, if (!tables) { /* Free tables that are not used */ - purge_tables(false); + purge_tables(); if (!wait_for_refresh) DBUG_RETURN(false); } @@ -561,7 +557,7 @@ bool flush_tables(THD *thd, flush_tables_type flag) flush_tables_error_handler error_handler; DBUG_ENTER("flush_tables"); - purge_tables(false); /* Flush unused tables and shares */ + purge_tables(); /* Flush unused tables and shares */ /* Loop over all shares and collect shares that have open tables diff --git a/sql/sql_base.h b/sql/sql_base.h index 211993c41ac..6b641a90212 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -299,7 +299,7 @@ void close_log_table(THD *thd, Open_tables_backup *backup); bool close_cached_tables(THD *thd, TABLE_LIST *tables, bool wait_for_refresh, ulong timeout); -void purge_tables(bool purge_flag); +void purge_tables(); bool flush_tables(THD *thd, flush_tables_type flag); bool close_cached_connection_tables(THD *thd, LEX_CSTRING *connect_string); void close_all_tables_for_name(THD *thd, TABLE_SHARE *share, diff --git a/sql/table_cache.cc b/sql/table_cache.cc index 4b88be421fe..8e5c3a8471d 100644 --- a/sql/table_cache.cc +++ b/sql/table_cache.cc @@ -323,12 +323,12 @@ static my_bool tc_purge_callback(TDC_element *element, tc_purge_arg *arg) } -void tc_purge(bool mark_flushed) +void tc_purge() { tc_purge_arg argument; TABLE *table; - argument.mark_flushed= mark_flushed; + argument.mark_flushed= false; tdc_iterate(0, (my_hash_walk_action) tc_purge_callback, &argument); while ((table= argument.purge_tables.pop_front())) intern_close_table(table); @@ -655,7 +655,7 @@ void tdc_start_shutdown(void) tdc_size= 0; tc_size= 0; /* Free all cached but unused TABLEs and TABLE_SHAREs. */ - purge_tables(true); + purge_tables(); } DBUG_VOID_RETURN; } diff --git a/sql/table_cache.h b/sql/table_cache.h index 175f25a5e28..f971c377992 100644 --- a/sql/table_cache.h +++ b/sql/table_cache.h @@ -91,7 +91,7 @@ extern int tdc_iterate(THD *thd, my_hash_walk_action action, void *argument, bool no_dups= false); extern uint tc_records(void); -extern void tc_purge(bool mark_flushed= false); +extern void tc_purge(); extern void tc_add_table(THD *thd, TABLE *table); extern void tc_release_table(TABLE *table); extern TABLE *tc_acquire_table(THD *thd, TDC_element *element); |