MariaDB Development
  1. MariaDB Development
  2. MDEV-5015

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.33
    • Fix Version/s: 5.5.33a, 5.3.13
    • Labels:
      None
    • Global Rank:
      3606

      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
      

        Activity

        Hide
        Igor Babaev added a comment -

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

        Show
        Igor Babaev added a comment - The fix for the bug was pushed into the 5.3 tree and merged into the 5.5 tree

          People

          • Assignee:
            Igor Babaev
            Reporter:
            Elena Stepanova
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: