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

Row IN subquery with semi-join and PS re-execution

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (column1 INT) ENGINE=MyISAM;
      INSERT INTO t1 VALUES (3),(9);

      CREATE TABLE t2 (column2 INT, column2_2 INT) ENGINE=MyISAM;

      INSERT INTO t2 VALUES (1,1),(4,4);

      CREATE TABLE t3 (column3 INT, column3_2 INT) ENGINE=MyISAM;
      INSERT INTO t3 VALUES (6, 6),(8, 8);

      CREATE TABLE t4 (column4 INT) ENGINE=MyISAM;
      INSERT INTO t4 VALUES (2),(5);

      PREPARE stmt FROM "
      SELECT (
      SELECT MAX( table1.column1 ) AS field1
      FROM t1 AS table1
      WHERE (table3.column3, table3.column3_2) IN ( SELECT table2.column2, table2.column2_2 AS field2 FROM t2 AS table2 )
      ) AS sq
      FROM t3 AS table3, t4 AS table4 GROUP BY sq
      ";

      EXECUTE stmt;
      EXECUTE stmt;

      deallocate prepare stmt;
      drop table t1,t2,t3,t4;

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              sanja Oleksandr Byelkin
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.