summaryrefslogtreecommitdiff
path: root/mysql-test/r/view.result
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/r/view.result
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/r/view.result')
-rw-r--r--mysql-test/r/view.result20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 50d2ea1e940..4e184f1ceec 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -4352,3 +4352,23 @@ WHERE t4.a >= v1.a);
a a
DROP VIEW v1;
DROP TABLE t1,t2,t3,t4;
+#
+# BUG#833600: Wrong result with view + outer join + uncorrelated subquery (non-semijoin)
+#
+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 ;
+a b a b
+NULL NULL 1 0
+NULL NULL 1 0
+SELECT * FROM t1 RIGHT JOIN v2 ON ( v2.a = t1.a ) WHERE v2.b IN ( SELECT b FROM t3 ) AND t1.b IS NULL ;
+a b a b
+NULL NULL 1 0
+NULL NULL 1 0
+DROP VIEW v2;
+DROP TABLE t1, t2, t3;