diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2019-12-20 20:33:29 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2020-04-03 13:01:21 +0400 |
commit | 54c03cb4f073b4c3140e75d1747798bace96fdba (patch) | |
tree | a043afe5fda8f43c1795659216d3a9de0b0003af /sql/table_cache.cc | |
parent | 02619ed73bc303e511bb8df3df67120e47886ffb (diff) | |
download | mariadb-git-54c03cb4f073b4c3140e75d1747798bace96fdba.tar.gz |
Cleanup mysql_inplace_alter_table()
Removed redundant tdc_remove_table(TDC_RT_REMOVE_ALL). Share was marked
flushed by preceding wait_while_table_is_used() and eventually flushed by
close_all_tables_for_name().
Part of MDEV-17882 - Cleanup refresh version
Diffstat (limited to 'sql/table_cache.cc')
-rw-r--r-- | sql/table_cache.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/table_cache.cc b/sql/table_cache.cc index ec5fd0ca0c7..bdc15909432 100644 --- a/sql/table_cache.cc +++ b/sql/table_cache.cc @@ -776,6 +776,23 @@ void tdc_unlock_share(TDC_element *element) } +int tdc_share_is_cached(THD *thd, const char *db, const char *table_name) +{ + char key[MAX_DBKEY_LENGTH]; + + if (unlikely(fix_thd_pins(thd))) + return -1; + + if (lf_hash_search(&tdc_hash, thd->tdc_hash_pins, (uchar*) key, + tdc_create_key(key, db, table_name))) + { + lf_hash_search_unpin(thd->tdc_hash_pins); + return 1; + } + return 0; +} + + /* Get TABLE_SHARE for a table. |