mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Merge 5.3 -> 5.3-subqueries-mwl90
This commit is contained in:
@ -720,12 +720,12 @@ ulong JOIN_CACHE::get_min_join_buffer_size()
|
||||
{
|
||||
if (!min_buff_size)
|
||||
{
|
||||
ulong len= 0;
|
||||
size_t len= 0;
|
||||
for (JOIN_TAB *tab= start_tab; tab != join_tab; tab= next_linear_tab(join, tab, FALSE))
|
||||
len+= tab->get_max_used_fieldlength();
|
||||
len+= get_record_max_affix_length() + get_max_key_addon_space_per_record();
|
||||
ulong min_sz= len*min_records;
|
||||
ulong add_sz= 0;
|
||||
size_t min_sz= len*min_records;
|
||||
size_t add_sz= 0;
|
||||
for (uint i=0; i < min_records; i++)
|
||||
add_sz+= join_tab_scan->aux_buffer_incr(i+1);
|
||||
avg_aux_buffer_incr= add_sz/min_records;
|
||||
@ -771,9 +771,9 @@ ulong JOIN_CACHE::get_max_join_buffer_size(bool optimize_buff_size)
|
||||
{
|
||||
if (!max_buff_size)
|
||||
{
|
||||
ulong max_sz;
|
||||
ulong min_sz= get_min_join_buffer_size();
|
||||
ulong len= 0;
|
||||
size_t max_sz;
|
||||
size_t min_sz= get_min_join_buffer_size();
|
||||
size_t len= 0;
|
||||
for (JOIN_TAB *tab= start_tab; tab != join_tab; tab= next_linear_tab(join, tab, FALSE))
|
||||
len+= tab->get_used_fieldlength();
|
||||
len+= get_record_max_affix_length();
|
||||
@ -781,7 +781,7 @@ ulong JOIN_CACHE::get_max_join_buffer_size(bool optimize_buff_size)
|
||||
len+= get_max_key_addon_space_per_record() + avg_aux_buffer_incr;
|
||||
space_per_record= len;
|
||||
|
||||
ulong limit_sz= join->thd->variables.join_buff_size;
|
||||
size_t limit_sz= join->thd->variables.join_buff_size;
|
||||
if (join_tab->join_buffer_size_limit)
|
||||
set_if_smaller(limit_sz, join_tab->join_buffer_size_limit);
|
||||
if (!optimize_buff_size)
|
||||
@ -844,8 +844,8 @@ int JOIN_CACHE::alloc_buffer()
|
||||
min_buff_size= 0;
|
||||
max_buff_size= 0;
|
||||
min_records= 1;
|
||||
max_records= partial_join_cardinality <= join_buff_space_limit ?
|
||||
(ulonglong) partial_join_cardinality : join_buff_space_limit;
|
||||
max_records= (size_t) (partial_join_cardinality <= join_buff_space_limit ?
|
||||
(ulonglong) partial_join_cardinality : join_buff_space_limit);
|
||||
set_if_bigger(max_records, 10);
|
||||
min_buff_size= get_min_join_buffer_size();
|
||||
buff_size= get_max_join_buffer_size(optimize_buff_size);
|
||||
@ -916,10 +916,10 @@ fail:
|
||||
|
||||
bool JOIN_CACHE::shrink_join_buffer_in_ratio(ulonglong n, ulonglong d)
|
||||
{
|
||||
ulonglong next_buff_size;
|
||||
size_t next_buff_size;
|
||||
if (n < d)
|
||||
return FALSE;
|
||||
next_buff_size= (ulonglong) ((double) buff_size / n * d);
|
||||
next_buff_size= (size_t) ((double) buff_size / n * d);
|
||||
set_if_bigger(next_buff_size, min_buff_size);
|
||||
buff_size= next_buff_size;
|
||||
return realloc_buffer();
|
||||
@ -1215,7 +1215,7 @@ uint JOIN_CACHE::write_record_data(uchar * link, bool *is_full)
|
||||
|
||||
/* Make an adjustment for the size of the auxiliary buffer if there is any */
|
||||
uint incr= aux_buffer_incr(records);
|
||||
ulong rem= rem_space();
|
||||
size_t rem= rem_space();
|
||||
aux_buff_size+= len+incr < rem ? incr : rem;
|
||||
|
||||
/*
|
||||
@ -2395,7 +2395,7 @@ inline bool JOIN_CACHE::check_match(uchar *rec_ptr)
|
||||
|
||||
enum_nested_loop_state JOIN_CACHE::join_null_complements(bool skip_last)
|
||||
{
|
||||
uint cnt;
|
||||
ulonglong cnt;
|
||||
enum_nested_loop_state rc= NESTED_LOOP_OK;
|
||||
bool is_first_inner= join_tab == join_tab->first_unmatched;
|
||||
|
||||
@ -3881,7 +3881,8 @@ bool bka_skip_index_tuple(range_seq_t rseq, char *range_info)
|
||||
{
|
||||
DBUG_ENTER("bka_skip_index_tuple");
|
||||
JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq;
|
||||
DBUG_RETURN(cache->skip_index_tuple(range_info));
|
||||
bool res= cache->skip_index_tuple(range_info);
|
||||
DBUG_RETURN(res);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user