summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2011-09-08 23:24:47 +0400
committerSergey Petrunya <psergey@askmonty.org>2011-09-08 23:24:47 +0400
commit3769841d9e706ee018d5273d2901954b9a281c3e (patch)
treee276e120ce8972fe9dc5c356e7289a4e7eb2fb4c /mysql-test/t/view.test
parent19a4309acf64a98b08048592c3a4b69bed1b9f5e (diff)
downloadmariadb-git-3769841d9e706ee018d5273d2901954b9a281c3e.tar.gz
BUG#833600: Wrong result with view + outer join + uncorrelated subquery (non-semijoin)
- The bug was caused by outer join being incorrectly converted into inner because of invalid return values of Item_direct_view_ref::not_null_tables(). - Provided a correct Item_direct_view_ref::not_null_tables() function.
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 034f8a4ca6c..7486ffc38f8 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -4286,3 +4286,25 @@ SELECT * FROM v1, t2
DROP VIEW v1;
DROP TABLE t1,t2,t3,t4;
+
+
+--echo #
+--echo # BUG#833600: Wrong result with view + outer join + uncorrelated subquery (non-semijoin)
+--echo #
+
+CREATE TABLE t1 ( a int, b int );
+INSERT INTO t1 VALUES (0,0),(0,0);
+
+CREATE TABLE t2 ( a int, b int );
+INSERT IGNORE INTO t2 VALUES (1,0),(1,0);
+
+CREATE TABLE t3 ( b int );
+INSERT IGNORE INTO t3 VALUES (0),(0);
+
+CREATE OR REPLACE VIEW v2 AS SELECT * FROM t2;
+SELECT * FROM t1 RIGHT JOIN v2 ON ( v2.a = t1.a ) WHERE v2.b IN ( SELECT b FROM t3 ) AND t1.b IS NULL ;
+
+SELECT * FROM t1 RIGHT JOIN v2 ON ( v2.a = t1.a ) WHERE v2.b IN ( SELECT b FROM t3 ) AND t1.b IS NULL ;
+
+DROP VIEW v2;
+DROP TABLE t1, t2, t3;