Bug #36705 key_buffer_size of >= 2G allocates all availabel virtual memory on 64-bit wondo.

temporary variables of 'long' types were used to store ulong values,
that causes init_key_cache to receive distorted parameters
parent c1f35308
...@@ -2350,8 +2350,8 @@ int ha_init_key_cache(const char *name, KEY_CACHE *key_cache) ...@@ -2350,8 +2350,8 @@ int ha_init_key_cache(const char *name, KEY_CACHE *key_cache)
if (!key_cache->key_cache_inited) if (!key_cache->key_cache_inited)
{ {
pthread_mutex_lock(&LOCK_global_system_variables); pthread_mutex_lock(&LOCK_global_system_variables);
long tmp_buff_size= (long) key_cache->param_buff_size; ulong tmp_buff_size= (ulong) key_cache->param_buff_size;
long tmp_block_size= (long) key_cache->param_block_size; uint tmp_block_size= (uint) key_cache->param_block_size;
uint division_limit= key_cache->param_division_limit; uint division_limit= key_cache->param_division_limit;
uint age_threshold= key_cache->param_age_threshold; uint age_threshold= key_cache->param_age_threshold;
pthread_mutex_unlock(&LOCK_global_system_variables); pthread_mutex_unlock(&LOCK_global_system_variables);
......
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