#At file:///G:/bzr/mysql-5.1/4gb/
2719 Vladislav Vaintroub 2008-11-19
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
modified:
sql/handler.cc
=== modified file 'sql/handler.cc'
--- a/sql/handler.cc 2008-11-06 14:18:25 +0000
+++ b/sql/handler.cc 2008-11-19 15:02:38 +0000
@@ -3627,7 +3627,7 @@ int ha_init_key_cache(const char *name,
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_c
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;