From 7bc67357368263a233e4d8553cc0a2a1ad331276 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Wed, 29 Apr 2020 01:13:52 +0300 Subject: 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) --- include/my_base.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/my_base.h b/include/my_base.h index 68b3aaa6a13..44af7b45075 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -632,7 +632,13 @@ typedef struct st_key_multi_range key_range start_key; key_range end_key; range_id_t ptr; /* Free to use by caller (ptr to row etc) */ - uint range_flag; /* key range flags see above */ + /* + A set of range flags that describe both endpoints: UNIQUE_RANGE, + NULL_RANGE, EQ_RANGE, GEOM_FLAG. + (Flags that describe one endpoint, NO_{MIN|MAX}_RANGE, NEAR_{MIN|MAX} will + not be set here) + */ + uint range_flag; } KEY_MULTI_RANGE; -- cgit v1.2.1