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

Correlated subquery fails after single row substitution in outer query

    XMLWordPrintable

Details

    • Bug
    • Status: In Review (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4(EOL), 10.5, 10.6, 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL)
    • 10.5, 10.6, 10.11
    • None
    • None

    Description

      Test case:

      CREATE TABLE t1(a INT) ENGINE=MYISAM;
      INSERT INTO t1(a) VALUES (1);
       
      SELECT a FROM t1 WHERE (SELECT a,a) IN (SELECT a,a);
      SELECT a FROM t1 WHERE (SELECT a,a) IN (SELECT 1,1);
      SELECT a FROM t1 WHERE (SELECT a,a UNION SELECT 1,a FROM t1 ) IN (SELECT 1,1);
      SELECT a FROM t1 WHERE (SELECT a,a UNION SELECT 1,a FROM t1 ) IN (SELECT a,a);
      

      Note that these queries do not fail if the table engine is InnoDB. In order these query to fail with a debug assertion the optimizer should apply single row substitution which is done for MyISAM tables, but not for InnoDB tables. For InnoDB tables we can achieve the same failure using single row substitution for primary keys.

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              oleg.smirnov Oleg Smirnov
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.