summaryrefslogtreecommitdiff
path: root/mysql-test/main/derived.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-08-03 15:57:23 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-08-03 15:57:23 +0300
commit05459706f22b1d9d22abd24e6de3b505d787beb3 (patch)
tree3e850e0cbf5489fbf36f5c1579248e344bfe2395 /mysql-test/main/derived.test
parent8ae2a2dbe6fc52d40ec88c325b9a44de52f83f2f (diff)
parente6a808bec790fdbbf1dc0a6b03fb6c8b6e41dc01 (diff)
downloadmariadb-git-05459706f22b1d9d22abd24e6de3b505d787beb3.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/derived.test')
-rw-r--r--mysql-test/main/derived.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/main/derived.test b/mysql-test/main/derived.test
index 466d79af409..6c51f23c51e 100644
--- a/mysql-test/main/derived.test
+++ b/mysql-test/main/derived.test
@@ -913,6 +913,7 @@ CREATE TABLE t3 (c VARCHAR(1024) CHARACTER SET utf8, d INT) ENGINE=MyISAM;
CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t3;
INSERT INTO t3 VALUES ('abc',NULL),('def',4);
+set @save_join_cache_level= @@join_cache_level;
SET join_cache_level= 8;
explain
SELECT * FROM v1, t2, v3 WHERE a = c AND b = d;
@@ -935,7 +936,27 @@ call pr(2);
drop procedure pr;
drop view v1;
drop table t1;
+set @@join_cache_level= @save_join_cache_level;
+--echo #
+--echo # MDEV-16307: Incorrect results when using BNLH join instead of BNL join with views
+--echo #
+
+CREATE TABLE t1 (c1 text, c2 int);
+INSERT INTO t1 VALUES ('a',1), ('c',3), ('g',7), ('d',4), ('c',3);
+CREATE TABLE t2 (c1 text, c2 int);
+INSERT INTO t2 VALUES ('b',2), ('c',3);
+CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
+
+explain SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
+SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
+set @save_join_cache_level= @@join_cache_level;
+set @@join_cache_level=4;
+explain SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
+SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
+drop table t1,t2;
+drop view v1;
+set @@join_cache_level= @save_join_cache_level;
--echo # end of 5.5
--echo #