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

LP:784723 - Wrong result with semijoin + nested subqueries in maria-5.3

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      As reported by Igor:

      This test case:

      CREATE TABLE t1 ( t1field integer, primary key (t1field));
      CREATE TABLE t2 ( t2field integer, primary key (t2field));
      INSERT INTO t1 VALUES (1),(2),(3);
      INSERT INTO t2 VALUES (2),(3),(4);
      SELECT * FROM t1 A WHERE A.t1field IN (SELECT A.t1field FROM t2 B) AND A.t1field IN (SELECT C.t2field FROM t2 C WHERE C.t2field IN (SELECT D.t2field FROM t2 D));

      produces 6 rows with semijoin=on, which is more than the size of the base table that is being filtered by the WHERE.

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            philipstoev Philip Stoev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.