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

Wrong result with JOINs involving Spider table

    XMLWordPrintable

Details

    Description

      # This may not work, e.g. for in-source builds, fix the path
      --source plugin/spider/spider/include/init_spider.inc
      #--source ../storage/spider/mysql-test/spider/include/init_spider.inc
       
      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 TABLE t (a INT);
      CREATE TABLE t_spider (a INT, KEY(a)) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't'";
      INSERT INTO t VALUES (1),(2);
       
      SELECT t1.* FROM t_spider AS t1 LEFT JOIN t_spider AS t2 RIGHT JOIN t_spider AS t3 ON 1 ON t1.a = 1;
       
      # Cleanup
      DROP TABLE t_spider, t;
      DROP SERVER s;
       
      # This may not work, e.g. for in-source builds, fix the path
      --source plugin/spider/spider/include/deinit_spider.inc
      #--source ../storage/spider/mysql-test/spider/include/deinit_spider.inc
      

      10.4 f3f09def

      SELECT t1.* FROM t_spider AS t1 LEFT JOIN t_spider AS t2 RIGHT JOIN t_spider AS t3 ON 1 ON t1.a = 1;
      a
      1
      1
      2
      1
      1
      2
      

      One of 2 rows shouldn't be there, the expected result is

      SELECT t1.* FROM t AS t1 LEFT JOIN t AS t2 RIGHT JOIN t AS t3 ON 1 ON t1.a = 1;
      a
      1
      1
      1
      1
      2
      

      Attachments

        Activity

          People

            ycp Yuchen Pei
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.