Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.0, 13.1, 12.3.3, 13.0.2, 13.1.1
-
Platform: Ubuntu 24.04, x86_64
-
Unexpected results
-
Description
With an index (a DESC, c DESC, b), a query with range conditions on all three columns returns an empty set although one row satisfies all conditions. Replacing a >= 5 by a = 5, or using IGNORE INDEX, returns the row.
How to reproduce
CREATE TABLE t(a INT, b INT, c INT, KEY k(a DESC, c DESC, b)); |
INSERT INTO t VALUES (9, 1, 1), (5, 5, 2); |
|
|
SELECT a FROM t IGNORE INDEX (k) WHERE c >= 2 AND b >= 2 AND a >= 5; |
-- 5 correct
|
|
|
SELECT a FROM t WHERE c >= 2 AND b >= 2 AND a >= 5; |
-- expected: 5
|
-- actual: Empty set
|
|
|
SELECT a FROM t WHERE c >= 2 AND b >= 2 AND a = 5; |
-- 5 correct |
Notes
The two-part versions (a DESC, c DESC), (a DESC, c) and (a, c DESC) return the correct result; the third key part is needed.
Attachments
Issue Links
- is caused by
-
MDEV-26996 Support descending indexes in the range optimizer
-
- Closed
-