diff options
Diffstat (limited to 'sql/table_cache.h')
-rw-r--r-- | sql/table_cache.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sql/table_cache.h b/sql/table_cache.h index 7b7fb239131..6da6a667792 100644 --- a/sql/table_cache.h +++ b/sql/table_cache.h @@ -40,6 +40,7 @@ extern void tdc_unlock_share(TABLE_SHARE *share); extern TABLE_SHARE *tdc_acquire_share(THD *thd, const char *db, const char *table_name, const char *key, uint key_length, + my_hash_value_type hash_value, uint flags, TABLE **out_table); extern void tdc_release_share(TABLE_SHARE *share); extern bool tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type, @@ -47,13 +48,14 @@ extern bool tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type, bool kill_delayed_threads); extern int tdc_wait_for_old_version(THD *thd, const char *db, const char *table_name, - ulong wait_timeout, uint deadlock_weight); + ulong wait_timeout, uint deadlock_weight, + ulong refresh_version= ULONG_MAX); extern ulong tdc_refresh_version(void); -extern void tdc_increment_refresh_version(void); +extern ulong tdc_increment_refresh_version(void); extern void tdc_assign_new_table_id(TABLE_SHARE *share); extern uint tc_records(void); -extern void tc_purge(void); +extern void tc_purge(bool mark_flushed= false); extern void tc_add_table(THD *thd, TABLE *table); extern bool tc_release_table(TABLE *table); @@ -87,7 +89,9 @@ static inline TABLE_SHARE *tdc_acquire_share(THD *thd, const char *db, const char *key, uint key_length, uint flags) { - return tdc_acquire_share(thd, db, table_name, key, key_length, flags, 0); + return tdc_acquire_share(thd, db, table_name, key, key_length, + my_hash_sort(&my_charset_bin, (uchar*) key, + key_length), flags, 0); } @@ -119,7 +123,8 @@ static inline TABLE_SHARE *tdc_acquire_share_shortlived(THD *thd, TABLE_LIST *tl { const char *key; uint key_length= get_table_def_key(tl, &key); - return tdc_acquire_share(thd, tl->db, tl->table_name, key, key_length, flags); + return tdc_acquire_share(thd, tl->db, tl->table_name, key, key_length, + tl->mdl_request.key.tc_hash_value(), flags, 0); } |