summaryrefslogtreecommitdiff
path: root/mysql-test/r/subselect_cache.result
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2011-11-01 17:42:52 +0200
committerunknown <sanja@askmonty.org>2011-11-01 17:42:52 +0200
commitb40bc2b3e3afee92a6d33d80840840fcf9baae11 (patch)
tree6b836e02a31995d2fdf3a71ff04c31f0abccccf4 /mysql-test/r/subselect_cache.result
parent391c5db1fca4b9d36afa3d131b4f5401fa9189f6 (diff)
downloadmariadb-git-b40bc2b3e3afee92a6d33d80840840fcf9baae11.tar.gz
Fix of LP BUG#872775.
The problem was that merged views has its own nest_level numbering => when we compare nest levels we should take into considiration basis (i.e. 0 level), if it is different then nest levels are not comparable.
Diffstat (limited to 'mysql-test/r/subselect_cache.result')
-rw-r--r--mysql-test/r/subselect_cache.result28
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_cache.result b/mysql-test/r/subselect_cache.result
index c4826eeb50f..8758497f7d7 100644
--- a/mysql-test/r/subselect_cache.result
+++ b/mysql-test/r/subselect_cache.result
@@ -1,3 +1,5 @@
+drop table if exists t1,t2,t3,t4,t5;
+drop view if exists v1;
set optimizer_switch='subquery_cache=on';
create table t1 (a int, b int);
insert into t1 values (1,2),(3,4),(1,2),(3,4),(3,4),(4,5),(4,5),(5,6),(5,6),(4,5);
@@ -3354,5 +3356,31 @@ f1 f2 f3 f3
7 0 0 0
7 0 0 0
drop tables t1, t2, t3;
+#
+# Test of LP BUG#872775 view with "outer references" bug
+#
+set @@optimizer_switch= default;
+set optimizer_switch='subquery_cache=on';
+CREATE TABLE t1 (a int) ;
+CREATE TABLE t2 (b int, c varchar(1) NOT NULL ) ;
+INSERT INTO t2 VALUES (1,'x'),(2,'y');
+CREATE TABLE t3 (a int) ;
+CREATE TABLE t4 ( pk int(11) NOT NULL , b int(11) NOT NULL ) ;
+INSERT INTO t4 VALUES (26,9),(27,5),(28,0),(29,3);
+CREATE OR REPLACE VIEW v1 AS
+SELECT t2.b
+FROM t1
+JOIN t2
+WHERE t2 .c > (
+SELECT t2.c FROM t3
+);
+SELECT * FROM t4 WHERE b NOT IN ( SELECT * FROM v1 );
+pk b
+26 9
+27 5
+28 0
+29 3
+drop view v1;
+drop table t1,t2,t3,t4;
# restore default
set @@optimizer_switch= default;