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

LP:784281 - Wrong result from view containing outer reference in simijoin subquery

    Details

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

      Description

      A wrong result is returned by the query below for the test case of bug #33389 from mysql-test/t/view.test.

      To reproduce the problem first execute the following statements:

      create table t1 (a int, key(a));
      create table t2 (c int);

      create view v1 as select a b from t1;
      create view v2 as select 1 a from t2, v1 where c in
      (select 1 from t1 where b = a);

      insert into t1 values (1), (1);
      insert into t2 values (1), (1);

      Then run the query
      select * from v2.

      You'll get:

      MariaDB [test]> select * from v2;
      Empty set (0.00 sec)

      The expected result is:
      MariaDB [test]> select * from v2;
      ---

      a

      ---

      1
      1
      1
      1

      ---
      4 rows in set (0.00 sec)

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            igor Igor Babaev added a comment -

            Re: Wrong result from view containing outer reference in simijoin subquery
            This bug is observed only on the LP tree for mwl#106.

            Show
            igor Igor Babaev added a comment - Re: Wrong result from view containing outer reference in simijoin subquery This bug is observed only on the LP tree for mwl#106.
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 784281

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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: