diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2008-11-19 16:02:38 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2008-11-19 16:02:38 +0100 |
commit | 09ac30f679146ac874acfeaac7f790fe21946f6d (patch) | |
tree | bb93018a4645aefcb0ad08b3cddaedccc5a8408b /sql/handler.cc | |
parent | 36c4b37b16f5f44c97aae330856b742fa708b85f (diff) | |
download | mariadb-git-09ac30f679146ac874acfeaac7f790fe21946f6d.tar.gz |
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
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 6d5c0c93f75..47c2ff40119 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3627,7 +3627,7 @@ int ha_init_key_cache(const char *name, KEY_CACHE *key_cache) if (!key_cache->key_cache_inited) { 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 division_limit= key_cache->param_division_limit; 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) { 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; uint division_limit= key_cache->param_division_limit; uint age_threshold= key_cache->param_age_threshold; |