mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 5.3 -> 5.3-subqueries-mwl90
This commit is contained in:
@ -4926,7 +4926,7 @@ ha_rows get_table_cardinality_for_index_intersect(TABLE *table)
|
||||
{
|
||||
ha_rows d;
|
||||
double q;
|
||||
for (q= table->file->stats.records, d= 1 ; q >= 10; q/= 10, d*= 10 ) ;
|
||||
for (q= (double)table->file->stats.records, d= 1 ; q >= 10; q/= 10, d*= 10 ) ;
|
||||
return (ha_rows) (floor(q+0.5) * d);
|
||||
}
|
||||
}
|
||||
@ -5092,7 +5092,7 @@ bool prepare_search_best_index_intersect(PARAM *param,
|
||||
return TRUE;
|
||||
|
||||
size_t calc_cost_buff_size=
|
||||
Unique::get_cost_calc_buff_size(records_in_scans,
|
||||
Unique::get_cost_calc_buff_size((size_t)records_in_scans,
|
||||
common->key_size,
|
||||
common->max_memory_size);
|
||||
if (!(common->buff_elems= (uint *) alloc_root(param->mem_root,
|
||||
@ -5434,7 +5434,7 @@ bool check_index_intersect_extension(PARTIAL_INDEX_INTERSECT_INFO *curr,
|
||||
ulonglong max_memory_size= common_info->max_memory_size;
|
||||
|
||||
records_sent_to_unique+= ext_index_scan_records;
|
||||
cost= Unique::get_use_cost(buff_elems, records_sent_to_unique, key_size,
|
||||
cost= Unique::get_use_cost(buff_elems, (size_t) records_sent_to_unique, key_size,
|
||||
max_memory_size, compare_factor, TRUE,
|
||||
&next->in_memory);
|
||||
if (records_filtered_out_by_cpk)
|
||||
@ -5444,7 +5444,7 @@ bool check_index_intersect_extension(PARTIAL_INDEX_INTERSECT_INFO *curr,
|
||||
double cost2;
|
||||
bool in_memory2;
|
||||
ha_rows records2= records_sent_to_unique-records_filtered_out_by_cpk;
|
||||
cost2= Unique::get_use_cost(buff_elems, records2, key_size,
|
||||
cost2= Unique::get_use_cost(buff_elems, (size_t) records2, key_size,
|
||||
max_memory_size, compare_factor, TRUE,
|
||||
&in_memory2);
|
||||
cost2+= get_cpk_filter_cost(ext_index_scan_records, common_info->cpk_scan,
|
||||
@ -11859,13 +11859,14 @@ get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree,
|
||||
Find the range tree for the current keypart. We assume that
|
||||
index_range_tree points to the leftmost keypart in the index.
|
||||
*/
|
||||
for (cur_range= index_range_tree; cur_range;
|
||||
for (cur_range= index_range_tree;
|
||||
cur_range && cur_range->type == SEL_ARG::KEY_RANGE;
|
||||
cur_range= cur_range->next_key_part)
|
||||
{
|
||||
if (cur_range->field->eq(cur_part->field))
|
||||
break;
|
||||
}
|
||||
if (!cur_range)
|
||||
if (!cur_range || cur_range->type != SEL_ARG::KEY_RANGE)
|
||||
{
|
||||
if (min_max_arg_part)
|
||||
return FALSE; /* The current keypart has no range predicates at all. */
|
||||
|
Reference in New Issue
Block a user