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

Wrong result with an aggregate function, index and impossible condition inside OR

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5.33
    • 5.5.33a, 5.3.13
    • None
    • None

    Description

      The wrong result started appearing on 5.3 tree since the following revision:

      revno: 3676 [merge]
      revision-id: igor@askmonty.org-20130815235920-io2h7tlypwlbunsp
      parent: igor@askmonty.org-20130815210420-l2lr4dhln2li77iy
      parent: igor@askmonty.org-20130815211616-80di8in2ae5fttxd
      committer: Igor Babaev <igor@askmonty.org>
      branch nick: maria-5.3
      timestamp: Thu 2013-08-15 16:59:20 -0700
      message:
        Merge
          ------------------------------------------------------------
          revno: 3669.1.1
          revision-id: igor@askmonty.org-20130815211616-80di8in2ae5fttxd
          parent: bar@mariadb.org-20130709070256-0evtbj6foe8za239
          committer: Igor Babaev <igor@askmonty.org>
          branch nick: maria-5.3-bugs
          timestamp: Thu 2013-08-15 14:16:16 -0700
          message:
            Fixed bug mdev-4355.
            This patch almost totally revised the patch for bug mdev-4177.
            The latter had too many defects. In particular, it did not
            propagate multiple equalities formed when merging a degenerate
            disjunct into underlying AND formula.

      Test case:

      CREATE TABLE t1 (i1 INT, INDEX(i1));
      INSERT INTO t1 VALUES (9),(8);
       
      CREATE TABLE t2 (i2 INT);
      INSERT INTO t2 VALUES (8),(4);
       
      SELECT MAX( t1a.i1 ) FROM t1 AS t1a, t2, t1 AS t1b WHERE t1b.i1 = i2 AND ( 0 OR t1a.i1 = i2 );

      Actual result:

      MAX( t1a.i1 )
      9

      Expected result:

      MAX( t1a.i1 )
      8

      Attachments

        Activity

          People

            igor Igor Babaev
            elenst Elena Stepanova
            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.