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

LP:883976 - exists with DISTINCT & ORDER BY returns incorrect result

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      CREATE TABLE t1(pk INT PRIMARY KEY, a INT, INDEX idx(a));
      INSERT INTO t1 VALUES (1, 10), (3, 30), (2, 20);
      CREATE TABLE t2(pk INT PRIMARY KEY, a INT, b INT, INDEX idxa(a));
      INSERT INTO t2 VALUES (2, 20, 700), (1, 10, 200), (4, 10, 100);
      SELECT * FROM t1
      WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b);

      returns 3 rows but should return only one. Without DISTINCT or ORDER BY result is correct.

      repeatable in 5.1 (actually incorrect result present in test suite results)

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            igor Igor Babaev added a comment -

            Re: exists with DISTINCT & ORDER BY returns incorrect result
            This is a duplicate of the bug #906322.

            Show
            igor Igor Babaev added a comment - Re: exists with DISTINCT & ORDER BY returns incorrect result This is a duplicate of the bug #906322.
            Hide
            elenst Elena Stepanova added a comment -

            Re: exists with DISTINCT & ORDER BY returns incorrect result
            Fix for the bug #906322 was released in 5.2.11

            Show
            elenst Elena Stepanova added a comment - Re: exists with DISTINCT & ORDER BY returns incorrect result Fix for the bug #906322 was released in 5.2.11
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 883976

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 883976

              People

              • Assignee:
                igor Igor Babaev
                Reporter:
                sanja Oleksandr Byelkin
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: