Details
-
Bug
-
Status: In Review (View Workflow)
-
Major
-
Resolution: Unresolved
-
12.1
Description
MDEV-34413 introduced a new overriding ha_partition::set_end_range, which causes handler::set_end_range to not be called which would set key_compare_result_on_equal, causing it to be uninitialized.
In my local test, the following testcase testcase reliably produces different Handler_read_key counts between Debug and non-Debug builds. CI fails MSAN: https://buildbot.mariadb.org/#/builders/867/builds/5162
--source include/have_partition.inc
|
--source include/have_sequence.inc
|
CREATE TABLE t1 ( |
a INT, |
b INT, |
KEY ( a, b ) |
) PARTITION BY RANGE COLUMNS(a) ( |
PARTITION `p1` VALUES LESS THAN (10), |
PARTITION `p2` VALUES LESS THAN (20), |
PARTITION `p3` VALUES LESS THAN (30), |
PARTITION `p4` VALUES LESS THAN (40), |
PARTITION `p5` VALUES LESS THAN MAXVALUE |
);
|
|
|
insert into t1 select seq, seq from seq_1_to_50; |
|
|
FLUSH status;
|
SELECT a, MIN(b) FROM t1 WHERE a > 18 and a < 21 GROUP BY a; |
show status like 'handler_read_%'; |
|
|
DROP TABLE t1; |
One could place a breakpoint like so and print or display key_compare_result_on_equal which typically shows a random-looking value like -1094795586
int handler::compare_key(key_range *range) |
{
|
int cmp; |
if (!range || in_range_check_pushed_down) |
return 0; // No max range |
cmp= key_cmp(range_key_part, range->key, range->length);
|
if (!cmp) |
cmp= key_compare_result_on_equal; // <-- breakpoint |
return cmp; |
}
|
Checked that it does not affect 11.8
Attachments
Issue Links
- is caused by
-
MDEV-34413 Index Condition Pushdown for reverse-ordered scans
-
- Closed
-
- split from
-
MDEV-37330 Ordered scans over PARTITION BY RANGE should not use priority queue
-
- In Review
-