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

Spider hint key does not really check the idx number

Details

    Description

      Probably affects other versions too.

      The following test sends "select `d` from `test`.`t2` force index(d) order by `d` desc limit 1" to the data node, even though d is not the 0th key (c is). I am not sure why we need to indicate the idx number - it is not shown in show create table as claimed by [1] anyway

      --echo #
      --echo # tmp
      --echo #
      --disable_query_log
      --disable_result_log
      --source ../../t/test_init.inc
      --enable_result_log
      --enable_query_log
       
      evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
      OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
       
      create table t2 (c int, d int, primary key (c), key (d));
      show create table t2;
      create table t1 (c int, d int, primary key (c), key (d)) ENGINE=Spider
      COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", idx000 "f d"';
      show create table t1;
      /* 13 */ insert into t1 values (42, 23), (37, 93);
      select max(d) from t1;
       
      drop table t1, t2;
       
      drop server srv;
       
      --disable_query_log
      --disable_result_log
      --source ../../t/test_deinit.inc
      --enable_result_log
      --enable_query_log
      --echo #
      --echo # end of test tmp
      --echo #
      

      [1] https://mariadb.com/kb/en/spider-table-parameters/#idx000

      Attachments

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

              ycp Yuchen Pei
              ycp Yuchen Pei
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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