mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
10.0-base merge.
Partitioning/InnoDB changes are *not* merged (they'll come from 5.6) TokuDB does not compile (not updated to 10.0 SE API)
This commit is contained in:
@ -11811,6 +11811,26 @@ int QUICK_SELECT_DESC::get_next()
|
||||
if (!(last_range= rev_it++))
|
||||
DBUG_RETURN(HA_ERR_END_OF_FILE); // All ranges used
|
||||
|
||||
key_range start_key;
|
||||
start_key.key= (const uchar*) last_range->min_key;
|
||||
start_key.length= last_range->min_length;
|
||||
start_key.flag= ((last_range->flag & NEAR_MIN) ? HA_READ_AFTER_KEY :
|
||||
(last_range->flag & EQ_RANGE) ?
|
||||
HA_READ_KEY_EXACT : HA_READ_KEY_OR_NEXT);
|
||||
start_key.keypart_map= last_range->min_keypart_map;
|
||||
key_range end_key;
|
||||
end_key.key= (const uchar*) last_range->max_key;
|
||||
end_key.length= last_range->max_length;
|
||||
end_key.flag= (last_range->flag & NEAR_MAX ? HA_READ_BEFORE_KEY :
|
||||
HA_READ_AFTER_KEY);
|
||||
end_key.keypart_map= last_range->max_keypart_map;
|
||||
result= file->prepare_range_scan((last_range->flag & NO_MIN_RANGE) ? NULL : &start_key,
|
||||
(last_range->flag & NO_MAX_RANGE) ? NULL : &end_key);
|
||||
if (result)
|
||||
{
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
|
||||
if (last_range->flag & NO_MAX_RANGE) // Read last record
|
||||
{
|
||||
int local_error;
|
||||
@ -12437,8 +12457,12 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree, double read_time)
|
||||
uchar cur_key_infix[MAX_KEY_LENGTH];
|
||||
uint cur_used_key_parts;
|
||||
|
||||
/* Check (B1) - if current index is covering. */
|
||||
if (!table->covering_keys.is_set(cur_index))
|
||||
/*
|
||||
Check (B1) - if current index is covering. Exclude UNIQUE indexes, because
|
||||
loose scan may still be chosen for them due to imperfect cost calculations.
|
||||
*/
|
||||
if (!table->covering_keys.is_set(cur_index) ||
|
||||
cur_index_info->flags & HA_NOSAME)
|
||||
goto next_index;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user