[MDEV-27581] Wrong result with DESC key on partitioned Spider table Created: 2022-01-22  Updated: 2022-01-26  Resolved: 2022-01-26

Status: Closed
Project: MariaDB Server
Component/s: Partitioning, Storage Engine - Spider
Affects Version/s: N/A
Fix Version/s: 10.8.1

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-13756 Implement descending index: KEY (a DE... Closed

 Description   

--source include/have_partition.inc
 
INSTALL SONAME 'ha_spider';
SET spider_same_server_link= 1;
 
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT PRIMARY KEY);
 
eval 
CREATE TABLE t (a INT, PRIMARY KEY (a DESC)) ENGINE=SPIDER
COMMENT "host '127.0.0.1', port '$MASTER_MYPORT', user 'root'"
PARTITION BY RANGE (a) 
(PARTITION p1 VALUES LESS THAN (4) COMMENT "table 't1'",
 PARTITION p2 VALUES LESS THAN (MAXVALUE) COMMENT "table 't2'");
 
INSERT INTO t VALUES (1),(2),(10),(11);
SELECT * FROM t WHERE a > 1 ORDER BY a;

SELECT returns an empty result set.

preview-10.8-MDEV-13756-desc-indexes c10e10c6

SELECT * FROM t WHERE a > 1 ORDER BY a;
a

With an ASC key the expected result is returned:

SELECT * FROM t WHERE a > 1 ORDER BY a;
a
2
10
11


Generated at Thu Feb 08 09:54:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.