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

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

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

          elenst Elena Stepanova created issue -
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          serg Sergei Golubchik made changes -
          Affects Version/s 5.5.33 [ 13300 ]

          The fix for the bug was pushed into the 5.3 tree and merged into the 5.5 tree

          igor Igor Babaev (Inactive) added a comment - The fix for the bug was pushed into the 5.3 tree and merged into the 5.5 tree
          igor Igor Babaev (Inactive) made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow defaullt [ 28919 ] MariaDB v2 [ 44626 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Workflow MariaDB v2 [ 44626 ] MariaDB v3 [ 63978 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 63978 ] MariaDB v4 [ 147033 ]

          People

            igor Igor Babaev (Inactive)
            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.