mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
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.
This commit is contained in:
@ -13307,7 +13307,8 @@ static int
|
|||||||
join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
|
join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
|
||||||
{
|
{
|
||||||
reg1 uint i;
|
reg1 uint i;
|
||||||
uint length,blobs,size;
|
uint length, blobs;
|
||||||
|
size_t size;
|
||||||
CACHE_FIELD *copy,**blob_ptr;
|
CACHE_FIELD *copy,**blob_ptr;
|
||||||
JOIN_CACHE *cache;
|
JOIN_CACHE *cache;
|
||||||
JOIN_TAB *join_tab;
|
JOIN_TAB *join_tab;
|
||||||
@ -13423,7 +13424,7 @@ store_record_in_cache(JOIN_CACHE *cache)
|
|||||||
length=cache->length;
|
length=cache->length;
|
||||||
if (cache->blobs)
|
if (cache->blobs)
|
||||||
length+=used_blob_length(cache->blob_ptr);
|
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;
|
cache->ptr_record=cache->records;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -13469,7 +13470,7 @@ store_record_in_cache(JOIN_CACHE *cache)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
cache->pos=pos;
|
cache->pos=pos;
|
||||||
return last_record || (uint) (cache->end -pos) < cache->length;
|
return last_record || (size_t) (cache->end - pos) < cache->length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user