diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2020-04-29 01:13:52 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2020-04-29 16:31:16 +0300 |
commit | 7bc67357368263a233e4d8553cc0a2a1ad331276 (patch) | |
tree | 6a40c1c4c6db679ba8b743b04731c78e296b44fc /sql/opt_range_mrr.cc | |
parent | 5ba2aa1ddc074dc89db7f265ddb61ce96f714fc8 (diff) | |
download | mariadb-git-7bc67357368263a233e4d8553cc0a2a1ad331276.tar.gz |
MDEV-22401: Optimizer trace: multi-component range is not printed correctly
KEY_MULTI_RANGE::range_flag does not have correct flag bits for
per-endpoint flags (NEAR_MIN, NEAR_MAX, NO_MIN_RANGE, NO_MAX_RANGE).
It only has bits for flags that describe both endpoints.
So
- Document this.
- Switch optimizer trace to using {start|end}_key.flag values, instead.
This fixes the bug.
- Switch records_in_column_ranges() to doing that too. (This used to
work, because KEY_MULTI_RANGE::range_flag had correct flag value
for the last key component, and EITS only uses one-component
pseudo-indexes)
Diffstat (limited to 'sql/opt_range_mrr.cc')
-rw-r--r-- | sql/opt_range_mrr.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/opt_range_mrr.cc b/sql/opt_range_mrr.cc index 4afa06a7ca0..267d764bb3b 100644 --- a/sql/opt_range_mrr.cc +++ b/sql/opt_range_mrr.cc @@ -262,7 +262,6 @@ walk_up_n_right: else { max_key_parts= MY_MAX(cur->min_key_parts, cur->max_key_parts); - range->range_flag= cur->min_key_flag | cur->max_key_flag; range->start_key.key= seq->param->min_key; range->start_key.length= (uint)(cur->min_key - seq->param->min_key); @@ -298,6 +297,7 @@ walk_up_n_right: !memcmp(seq->param->min_key, seq->param->max_key, // (2) range->start_key.length); + range->range_flag= 0; if (is_eq_range_pred) { range->range_flag = EQ_RANGE; |