1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-26938 Support descending indexes internally in InnoDB (server part)

* preserve DESC index property in the parser
* store it in the frm (only for HA_KEY_ALG_BTREE)
* read it from the frm
* show it in SHOW CREATE
* skip DESC indexes in opt_range.cc and opt_sum.cc
* ORDER BY test

This includes a fix of MDEV-27432.
This commit is contained in:
Sergei Golubchik
2021-11-24 16:50:21 +01:00
parent 358921ce32
commit a4cac0e07a
28 changed files with 882 additions and 119 deletions

View File

@ -342,7 +342,7 @@ tab CREATE TABLE `tab` (
`c7` geometrycollection DEFAULT NULL,
`c8` geometry DEFAULT NULL,
UNIQUE KEY `idx2` (`c8`(5)),
KEY `idx1` (`c2`(5)) USING BTREE,
KEY `idx1` (`c2`(5) DESC) USING BTREE,
KEY `idx3` (`c3`(5)) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1
#check the data after modify
@ -778,7 +778,7 @@ tab3 CREATE TABLE `tab3` (
`c7` geometrycollection DEFAULT NULL,
`c8` geometry DEFAULT NULL,
UNIQUE KEY `idx2` (`c8`(5)),
KEY `idx1` (`c2`(5)) USING BTREE,
KEY `idx1` (`c2`(5) DESC) USING BTREE,
KEY `idx3` (`c3`(5)) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=16
#check index with WKB function