summaryrefslogtreecommitdiff
path: root/sql/table_cache.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2015-03-04 11:01:32 +0400
committerSergey Vojtovich <svoj@mariadb.org>2015-03-04 13:34:53 +0400
commitf4f37533a09b9776e8d5ac3f3a27957f553c9043 (patch)
treed9f0babc06421f7fa9c1d0a67eb73c821da2cd26 /sql/table_cache.cc
parent5c6aa4dea00c4e289491dfa717a25b56ec9441c2 (diff)
downloadmariadb-git-f4f37533a09b9776e8d5ac3f3a27957f553c9043.tar.gz
Replaced lf-hash element_size hack with initializer function.
Diffstat (limited to 'sql/table_cache.cc')
-rw-r--r--sql/table_cache.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/table_cache.cc b/sql/table_cache.cc
index 9a75cafb30e..2dd368a1945 100644
--- a/sql/table_cache.cc
+++ b/sql/table_cache.cc
@@ -432,7 +432,7 @@ void tdc_init(void)
&my_charset_bin);
tdc_hash.alloc.constructor= TDC_element::lf_alloc_constructor;
tdc_hash.alloc.destructor= TDC_element::lf_alloc_destructor;
- tdc_hash.element_size= offsetof(TDC_element, version);
+ tdc_hash.initializer= (lf_hash_initializer) TDC_element::lf_hash_initializer;
DBUG_VOID_RETURN;
}
@@ -616,7 +616,7 @@ retry:
while (!(element= (TDC_element*) lf_hash_search_using_hash_value(&tdc_hash,
thd->tdc_hash_pins, hash_value, (uchar*) key, key_length)))
{
- TDC_element tmp(key, key_length);
+ LEX_STRING tmp= { const_cast<char*>(key), key_length };
int res= lf_hash_insert(&tdc_hash, thd->tdc_hash_pins, (uchar*) &tmp);
if (res == -1)
@@ -628,7 +628,6 @@ retry:
thd->tdc_hash_pins, hash_value, (uchar*) key, key_length);
lf_hash_search_unpin(thd->tdc_hash_pins);
DBUG_ASSERT(element);
- element->assert_clean_share();
if (!(share= alloc_table_share(db, table_name, key, key_length)))
{