mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug#39494 : key_buffer_size > 4GB does not work on 64 bit Windows
Cache size is truncated via 32bit ulong in ha_init_key_cache() and ha_resize_key_cache() This change fixes the cast to size_t instead of ulong. This cast is safe, because key_buffer_size parameter is limited to SIZE_T_MAX
This commit is contained in:
@ -3627,7 +3627,7 @@ 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);
|
||||||
ulong tmp_buff_size= (ulong) key_cache->param_buff_size;
|
size_t tmp_buff_size= (size_t) key_cache->param_buff_size;
|
||||||
uint tmp_block_size= (uint) 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;
|
||||||
@ -3651,7 +3651,7 @@ int ha_resize_key_cache(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;
|
size_t tmp_buff_size= (size_t) key_cache->param_buff_size;
|
||||||
long tmp_block_size= (long) key_cache->param_block_size;
|
long tmp_block_size= (long) 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;
|
||||||
|
Reference in New Issue
Block a user