[MDEV-27420] Spider tables retain DESC attribute on indexes even though it has no meaning Created: 2022-01-04  Updated: 2022-01-24  Resolved: 2022-01-24

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Create Table, Storage Engine - Spider
Affects Version/s: N/A
Fix Version/s: N/A

Type: Bug Priority: Trivial
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-13756 Implement descending index: KEY (a DE... Closed
Relates
relates to MDEV-27590 Auto-increment on Spider tables with ... Closed

 Description   

Upon creation of Spider tables, indexes are accepted and stored with the table definition. Now with the addition of the DESC attribute, it is accepted and stored as well.

The redundancy isn't new – the indexes themselves apparently aren't used in any way, and why they are retained in the table definition is in itself questionable. But it's legacy now. For the DESC attribute however, the general tendency seems to be to only keep it when it has real effect, so maybe it shouldn't be there.

--source include/have_innodb.inc
 
install soname 'ha_spider';
set spider_same_server_link= on;
 
eval create server s foreign data wrapper mysql options 
(host '127.0.0.1', database 'test', user 'root', port $MASTER_MYPORT);
 
create or replace table t (id int primary key) engine=InnoDB;
create or replace table t_sp (id int, key(id desc)) engine=Spider COMMENT='wrapper "mysql", srv "s", table "t"';
 
select * from t_sp;
show create table t_sp;

preview-10.8-MDEV-13756-desc-indexes 43444ff5

show create table t_sp;
Table	Create Table
t_sp	CREATE TABLE `t_sp` (
  `id` int(11) DEFAULT NULL,
  KEY `id` (`id` DESC)
) ENGINE=SPIDER DEFAULT CHARSET=latin1 COMMENT='wrapper "mysql", srv "s", table "t"'



 Comments   
Comment by Elena Stepanova [ 2022-01-23 ]

See also MDEV-27590 – one of these should be redundant, either DESC has no meaning for Spider as was initially assumed and thus should be ignored from the start, and then the problem in MDEV-27590 will not exist; or it does have a meaning, then MDEV-27420 is not a bug.

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