[CP] Fix multi range reverse scan blockscan
This commit is contained in:
@ -1241,12 +1241,25 @@ OB_INLINE static int binary_check_micro_infos(
|
|||||||
if (is_reverse) {
|
if (is_reverse) {
|
||||||
// [check_border_idx - 1] is the last micro whose endkey greater than border_rowkey in reverse scan, need move forward
|
// [check_border_idx - 1] is the last micro whose endkey greater than border_rowkey in reverse scan, need move forward
|
||||||
check_border_idx--;
|
check_border_idx--;
|
||||||
|
if (OB_UNLIKELY(check_border_idx == end && check_border_idx > 0)) {
|
||||||
|
// move to left if the two rightmost endkeys is same(possible in multiple ranges)
|
||||||
|
int cmp_ret = 0;
|
||||||
|
for (; OB_SUCC(ret) && 0 == cmp_ret && check_border_idx > start; check_border_idx--) {
|
||||||
|
const ObDatumRowkey *cur_endkey = (micro_infos + check_border_idx)->endkey_;
|
||||||
|
const ObDatumRowkey *prev_endkey = (micro_infos + check_border_idx - 1)->endkey_;
|
||||||
|
if (OB_FAIL(cur_endkey->compare(*prev_endkey, datum_utils, cmp_ret, false))) {
|
||||||
|
LOG_WARN("fail to compare rowkey", K(ret), KPC(cur_endkey), KPC(prev_endkey));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (OB_SUCC(ret)) {
|
||||||
for (int64_t idx = start; idx < check_border_idx; idx++) {
|
for (int64_t idx = start; idx < check_border_idx; idx++) {
|
||||||
micro_infos[idx].set_blockscan();
|
micro_infos[idx].set_blockscan();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user