Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-27420

Spider tables retain DESC attribute on indexes even though it has no meaning

    XMLWordPrintable

Details

    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"'
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.