Wrong result from view containing outer reference in simijoin subquery

Bug #784281 reported by Igor Babaev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
Critical
Igor Babaev

Bug 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)

Revision history for this message
Igor Babaev (igorb-seattle) wrote :

This bug is observed only on the LP tree for mwl#106.

Changed in maria:
milestone: none → 5.3
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Igor Babaev (igorb-seattle)
Changed in maria:
status: In Progress → Fix Committed
Changed in maria:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.