Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.5, 11.4, 11.8
-
None
Description
Noticed this while working on MDEV-32732. With
CREATE TABLE t1 (a int, b int, KEY (a, b)); |
insert into t1 values (1, 3), (1, 1); |
SELECT MAX(b) FROM t1 WHERE (b > 2 AND b < 4) OR (b = 5) GROUP BY a; |
drop table t1; |
At the current main c92add291e636c797e6d6ddca605905541b2a441 the SELECT statement outputs empty but it should be 3.
It outputs the correct result at the current 10.5 5ebff6e15a0c2e1b8a8e41943540332c757a6d03.
In fact, the bug reproduces at the current 11.4 ef966af801afc2a07222b5df65dddd52c77431dd, but not at (an ancestor) 10.11.11 e69f8cae1a15e15b9e4f5e0f8497e1f17bdc81a4
Attachments
Issue Links
- is part of
-
MDEV-32732 Support DESC indexes in loose scan optimization
-
- Closed
-
Well, the comment is the same as in QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range, despite
that the condition is different after the patch.
How about
If we've moved the current row when looking at the previous range (result==0),
and the current row's value for the MAX argument is smaller than the left
boundary of cur_range, there is no need to check this range.