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

incorrect result of intersect with ANY/ALL/IN subquery

Details

    Description

      Following should return empty set

      CREATE TABLE t (i INT);
      INSERT INTO t VALUES (1),(2);
      SELECT * FROM t WHERE i != ANY ( SELECT 6 INTERSECT SELECT 3 );
      i
      2
      drop table t;
      

      test suite

      CREATE TABLE t (i INT);
      INSERT INTO t VALUES (1),(2);
      SELECT * FROM t WHERE i != ANY ( SELECT 6 INTERSECT SELECT 3 );
      drop table t;
      

      Attachments

        Issue Links

          Activity

            select i from t where
            exists ((select 6 as r from dual having t.i <> 6)
            intersect
            (select 3 from dual having t.i <> 3));
            i
            2
            (select 6 as r from dual having 1 <> 6)
            intersect
            (select 3 from dual having 1 <> 3);
            r
            (select 6 as r from dual having 2 <> 6)
            intersect
            (select 3 from dual having 2 <> 3);
            r
            

            sanja Oleksandr Byelkin added a comment - select i from t where exists ((select 6 as r from dual having t.i <> 6) intersect (select 3 from dual having t.i <> 3)); i 2 (select 6 as r from dual having 1 <> 6) intersect (select 3 from dual having 1 <> 3); r (select 6 as r from dual having 2 <> 6) intersect (select 3 from dual having 2 <> 3); r

            Problem is lack of initialization of state of select_unit before second and so on restart

            sanja Oleksandr Byelkin added a comment - Problem is lack of initialization of state of select_unit before second and so on restart

            github tree is bb-10.2c-MDEV-14346

            revision-id: a25aa2e47c2d65d733ae622c215ba5e99ba29468 (mariadb-10.2.2-706-ga25aa2e47c2)
            parent(s): 0592d4d88a18bef33176444a07bc7fc1984d3f3c
            author: Oleksandr Byelkin
            committer: Oleksandr Byelkin
            timestamp: 2017-11-10 17:57:26 +0100
            message:

            MDEV-14346: incorrect result of intersect with ANY/ALL/IN subquery

            Reinit internal state of select_unit before using to correctly run it after first time.

            sanja Oleksandr Byelkin added a comment - github tree is bb-10.2c- MDEV-14346 revision-id: a25aa2e47c2d65d733ae622c215ba5e99ba29468 (mariadb-10.2.2-706-ga25aa2e47c2) parent(s): 0592d4d88a18bef33176444a07bc7fc1984d3f3c author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2017-11-10 17:57:26 +0100 message: MDEV-14346 : incorrect result of intersect with ANY/ALL/IN subquery Reinit internal state of select_unit before using to correctly run it after first time. —

            People

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