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

duplicate results in partitioned spider table with the the same data node table for multiple partitions

    XMLWordPrintable

Details

    Description

      Consider this case

      --disable_query_log
      --disable_result_log
      --source ../../t/test_init.inc
      --enable_result_log
      --enable_query_log
       
      set spider_same_server_link= 1;
      evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
      OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
       
      CREATE TABLE t (c INT);
      CREATE TABLE t1 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"' PARTITION BY LIST (c) (PARTITION p1 VALUES IN (42), PARTITION p2 VALUES IN (13));
      INSERT INTO t1 VALUES (13);
      select * from t1 partition (p1);
      select * from t1 partition (p2);
      select * from t1;
      drop table t, t1;
       
      drop server srv;
       
      --disable_query_log
      --disable_result_log
      --source ../../t/test_deinit.inc
      --enable_result_log
      --enable_query_log
      

      Both the first and the second selects return a row 13, and the third select returns two rows of 13.

      This looks wrong but it is expected, as each partition in a spider table is supposed to point to a different data node table. Still it looks wrong, and spider should report an error when multiple partitions point to the same remote table.

      Attachments

        Activity

          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.