diff options
author | Igor Babaev <igor@askmonty.org> | 2012-02-25 17:10:07 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2012-02-25 17:10:07 -0800 |
commit | 5db67c721afaa114b036b410096a6876f92371cf (patch) | |
tree | f7ce22bfe16e58bf285a87574c3e51dd3c4351ba /mysys | |
parent | 6a72fbe3968befc63baa3cfed6f0deb76c0b8937 (diff) | |
download | mariadb-git-5db67c721afaa114b036b410096a6876f92371cf.tar.gz |
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().
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/mf_keycache.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index a038061d9d0..e0d495ce8e0 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -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; |