1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Descending indexes code exposed a gap in fix for MDEV-25858.

Extend the fix for MDEV-25858 to handle non-reverse-ordered ORDER BY:

If test_if_skip_sort_order() decides to use an index to produce rows
in the required ordering, it should disable "Range Checked for Each Record".

The fix needs to be backported to earlier versions.
This commit is contained in:
Sergei Petrunia
2021-12-14 15:35:10 +03:00
committed by Sergei Golubchik
parent 791146b9d2
commit 3a82c256da
3 changed files with 70 additions and 7 deletions

View File

@@ -17,7 +17,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL,
KEY `i1` (`c1`) USING BTREE
KEY `i1` (`c1` DESC) USING BTREE
) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t1;
SHOW TABLES;
@@ -40,7 +40,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL,
UNIQUE KEY `i1` (`c1`) USING BTREE
UNIQUE KEY `i1` (`c1` DESC) USING BTREE
) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP INDEX i1 ON t1;
DROP TABLE t1;