Commit 5db67c72 authored by Igor Babaev's avatar Igor Babaev

Fixed LP bug #939866.

The field key_cache_mem_size of the KEY_CACHE structure must be
initialized in the function init_key_cache() and updated in the
function resize_key_cache().
parent 6a72fbe3
......@@ -5945,6 +5945,10 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
((PARTITIONED_KEY_CACHE_CB *) keycache_cb)->partitions :
0;
DBUG_ASSERT(partitions <= MAX_KEY_CACHE_PARTITIONS);
keycache->key_cache_mem_size=
keycache->partitions ?
((PARTITIONED_KEY_CACHE_CB *) keycache_cb)->key_cache_mem_size :
((SIMPLE_KEY_CACHE_CB *) keycache_cb)->key_cache_mem_size;
if (blocks > 0)
keycache->can_be_used= 1;
return blocks;
......@@ -6008,6 +6012,11 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
((PARTITIONED_KEY_CACHE_CB *)(keycache->keycache_cb))->partitions;
}
keycache->key_cache_mem_size=
keycache->partitions ?
((PARTITIONED_KEY_CACHE_CB *)(keycache->keycache_cb))->key_cache_mem_size :
((SIMPLE_KEY_CACHE_CB *)(keycache->keycache_cb))->key_cache_mem_size;
keycache->can_be_used= (blocks >= 0);
}
return blocks;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment