summaryrefslogtreecommitdiff
path: root/sql/table_cache.h
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2019-12-17 16:25:15 +0400
committerSergey Vojtovich <svoj@mariadb.org>2020-04-03 13:01:21 +0400
commit7a947614fbf8b925ae3df70ec8df80c745eafd4c (patch)
treed462b7218559c2e7855a6019ffc382f003f1f889 /sql/table_cache.h
parent06fae75859821fe36f68eb2d77f007f014143282 (diff)
downloadmariadb-git-7a947614fbf8b925ae3df70ec8df80c745eafd4c.tar.gz
Split tdc_remove_table()
TDC_RT_REMOVE_ALL -> tdc_remove_table(). Some occurrences replaced with TDC_element::flush() (whenver TABLE_SHARE is available). TDC_RT_REMOVE_NOT_OWN[_KEEP_SHARE] -> TDC_element::flush(). These modes assume that current thread owns TABLE_SHARE reference, which means we can avoid hash lookup and flush unused TABLE instances directly. TDC_RT_REMOVE_UNUSED -> TDC_element::flush_unused(). Only [ab]used by mysql_admin_table() currently. Should be removed eventually. Part of MDEV-17882 - Cleanup refresh version
Diffstat (limited to 'sql/table_cache.h')
-rw-r--r--sql/table_cache.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/sql/table_cache.h b/sql/table_cache.h
index cf880b7d9b4..bffb782849c 100644
--- a/sql/table_cache.h
+++ b/sql/table_cache.h
@@ -54,17 +54,13 @@ struct TDC_element
/** Avoid false sharing between TDC_element and free_tables */
char pad[CPU_LEVEL1_DCACHE_LINESIZE];
Share_free_tables free_tables[1];
-};
-
-enum enum_tdc_remove_table_type
-{
- TDC_RT_REMOVE_ALL,
- TDC_RT_REMOVE_NOT_OWN,
- TDC_RT_REMOVE_UNUSED,
- TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE
+ inline void wait_for_refs(uint my_refs);
+ void flush(THD *thd, bool mark_flushed);
+ void flush_unused(bool mark_flushed);
};
+
extern ulong tdc_size;
extern ulong tc_size;
extern uint32 tc_instances;
@@ -81,8 +77,7 @@ int tdc_share_is_cached(THD *thd, const char *db, const char *table_name);
extern TABLE_SHARE *tdc_acquire_share(THD *thd, TABLE_LIST *tl, uint flags,
TABLE **out_table= 0);
extern void tdc_release_share(TABLE_SHARE *share);
-extern bool tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type,
- const char *db, const char *table_name);
+void tdc_remove_table(THD *thd, const char *db, const char *table_name);
extern int tdc_wait_for_old_version(THD *thd, const char *db,
const char *table_name,