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

LP:879864 - Wrong result with aggregate + two-column subselect

    Details

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

      Description

      This query:

      SELECT MAX( f1 ) FROM t1 WHERE ( 5 , 9 ) IN ( SELECT 3 , 5 );

      returns no rows even though it should return NULL (the where clause is false).

      Repeatable in maria-5.3,maria-5.2,mysql-5.5

      explain:

      1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
      2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used

      explain extended:

      select max(`test`.`t1`.`f1`) AS `MAX( f1 )` from `test`.`t1` where <in_optimizer>((5,9),<exists>(select 3,5 having (((5 = 3) or isnull(3)) and ((9 = 5) or isnull(5)) and <is_not_null_test>(3) and <is_not_null_test>(5))))

      test case:

      CREATE TABLE t1 (f1 integer, key(f1)) engine=myisam;
      insert into t1 values (1),(2);
      SELECT MAX( f1 ) FROM t1 WHERE ( 5 , 9 ) IN ( SELECT 3 , 5 );

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            igor Igor Babaev added a comment -

            Re: Wrong result with aggregate + two-column subselect
            This bug is fixed by the patch for bug #904345.

            Show
            igor Igor Babaev added a comment - Re: Wrong result with aggregate + two-column subselect This bug is fixed by the patch for bug #904345.
            Hide
            elenst Elena Stepanova added a comment -

            Re: Wrong result with aggregate + two-column subselect
            Fix for the bug #904345 was released in 5.2.11

            Show
            elenst Elena Stepanova added a comment - Re: Wrong result with aggregate + two-column subselect Fix for the bug #904345 was released in 5.2.11
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 879864

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

              People

              • Assignee:
                igor Igor Babaev
                Reporter:
                philipstoev Philip Stoev
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: