diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2015-12-29 14:37:54 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2016-02-26 18:35:14 +0400 |
commit | d3af8942350e87d809fdf4d9453d5210ada2d3d1 (patch) | |
tree | 7dbf2a1fb6a998b0af3db7df0fc38f871ee191e6 /sql/table_cache.cc | |
parent | 90c9641a8ad968e5bebf823a8977a490d40616bf (diff) | |
download | mariadb-git-d3af8942350e87d809fdf4d9453d5210ada2d3d1.tar.gz |
MDEV-9488 - Table cache cleanups
tdc_assign_new_table_id() does not relate to table cache, move it out of
table_cache.cc.
Diffstat (limited to 'sql/table_cache.cc')
-rw-r--r-- | sql/table_cache.cc | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/sql/table_cache.cc b/sql/table_cache.cc index 2dd368a1945..19e8250f99d 100644 --- a/sql/table_cache.cc +++ b/sql/table_cache.cc @@ -67,7 +67,6 @@ I_P_List <TDC_element, I_P_List_fast_push_back<TDC_element> > unused_shares; static int64 tdc_version; /* Increments on each reload */ -static int64 last_table_id; static bool tdc_inited; static int32 tc_count; /**< Number of TABLE objects in table cache. */ @@ -1091,56 +1090,3 @@ int tdc_iterate(THD *thd, my_hash_walk_action action, void *argument, } return res; } - - -/* - Function to assign a new table map id to a table share. - - PARAMETERS - - share - Pointer to table share structure - - DESCRIPTION - - We are intentionally not checking that share->mutex is locked - since this function should only be called when opening a table - share and before it is entered into the table definition cache - (meaning that it cannot be fetched by another thread, even - accidentally). - - PRE-CONDITION(S) - - share is non-NULL - last_table_id_lock initialized (tdc_inited) - - POST-CONDITION(S) - - share->table_map_id is given a value that with a high certainty is - not used by any other table (the only case where a table id can be - reused is on wrap-around, which means more than 4 billion table - share opens have been executed while one table was open all the - time). - - share->table_map_id is not ~0UL. -*/ - -void tdc_assign_new_table_id(TABLE_SHARE *share) -{ - ulong tid; - DBUG_ENTER("assign_new_table_id"); - DBUG_ASSERT(share); - DBUG_ASSERT(tdc_inited); - - /* - There is one reserved number that cannot be used. Remember to - change this when 6-byte global table id's are introduced. - */ - do - { - tid= my_atomic_add64_explicit(&last_table_id, 1, MY_MEMORY_ORDER_RELAXED); - } while (unlikely(tid == ~0UL)); - - share->table_map_id= tid; - DBUG_PRINT("info", ("table_id= %lu", share->table_map_id)); - DBUG_VOID_RETURN; -} |