mirror of
https://github.com/MariaDB/server.git
synced 2026-05-03 13:45:34 +02:00
Fix ha_rocksdb::calc_eq_cond_len() to handle HA_READ_PREFIX_LAST_OR_PREV correctly
This is Variant#2. - Undo Variant#1 - Instead, swap the range bounds if we are doing a reverse-ordered scan.
This commit is contained in:
parent
8628c589f6
commit
7e700bd2a8
2 changed files with 2 additions and 9 deletions
|
|
@ -11677,8 +11677,8 @@ int QUICK_SELECT_DESC::get_next()
|
|||
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);
|
||||
result= file->prepare_range_scan((last_range->flag & NO_MIN_RANGE) ? NULL : &end_key,
|
||||
(last_range->flag & NO_MAX_RANGE) ? NULL : &start_key);
|
||||
if (result)
|
||||
{
|
||||
DBUG_RETURN(result);
|
||||
|
|
|
|||
|
|
@ -7464,13 +7464,6 @@ int ha_rocksdb::calc_eq_cond_len(const Rdb_key_def &kd,
|
|||
*/
|
||||
return slice.size() - bytes_changed_by_succ;
|
||||
}
|
||||
if (find_flag == HA_READ_PREFIX_LAST_OR_PREV) {
|
||||
/*
|
||||
We are interested in records with or without the specified prefix, so
|
||||
the only limit is that records are from this index
|
||||
*/
|
||||
return Rdb_key_def::INDEX_NUMBER_SIZE;
|
||||
}
|
||||
|
||||
if (end_key) {
|
||||
*end_key_packed_size =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue