diff options
author | unknown <dkatz@damien-katzs-computer.local> | 2007-07-27 16:26:26 -0400 |
---|---|---|
committer | unknown <dkatz@damien-katzs-computer.local> | 2007-07-27 16:26:26 -0400 |
commit | 575fea4a981a7fa0ff8a3b8d0978be5928afc8e9 (patch) | |
tree | 7bcedc4125347e72fd76dc429f3d23721dd633ba /sql/sql_select.cc | |
parent | 37b6be0806a6350f63c5d60965f24923506d72ef (diff) | |
download | mariadb-git-575fea4a981a7fa0ff8a3b8d0978be5928afc8e9.tar.gz |
Bug #29419 "Specifying a join_buffer > 4GB on 64 bit machines not possible."
Use size_t instead of uint when calculating join buffer size, because uint can be overflown on 64-bit platforms and join_buffer_size > 4 GB.
The test case for this bug is a part of the test suite for bug #5731.
sql/sql_select.cc:
Use size_t instead of uint when calculating join buffer size, because uint can be overflown on 64-bit platforms and join_buffer_size > 4G.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index d8bf8466f58..89bdd22a3de 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -13014,7 +13014,8 @@ static int join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count) { reg1 uint i; - uint length,blobs,size; + uint length, blobs; + size_t size; CACHE_FIELD *copy,**blob_ptr; JOIN_CACHE *cache; JOIN_TAB *join_tab; @@ -13130,7 +13131,7 @@ store_record_in_cache(JOIN_CACHE *cache) length=cache->length; if (cache->blobs) length+=used_blob_length(cache->blob_ptr); - if ((last_record=(length+cache->length > (uint) (cache->end - pos)))) + if ((last_record= (length + cache->length > (size_t) (cache->end - pos)))) cache->ptr_record=cache->records; /* @@ -13176,7 +13177,7 @@ store_record_in_cache(JOIN_CACHE *cache) } } cache->pos=pos; - return last_record || (uint) (cache->end -pos) < cache->length; + return last_record || (size_t) (cache->end - pos) < cache->length; } |