summaryrefslogtreecommitdiff
path: root/mysql-test/main/derived_cond_pushdown.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-10-17 19:05:59 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-10-17 19:37:05 +0300
commitf454189c606b9ce7c401a3493c9b85c72651e220 (patch)
tree14d529b74174aecf0603fde5bcc374ad1652e726 /mysql-test/main/derived_cond_pushdown.test
parent2fa4ed031ce6cc6370671058ccc3d119b8cb3d91 (diff)
parent853a0a4368ec5268aac2e53e862ce4ad975ffd66 (diff)
downloadmariadb-git-f454189c606b9ce7c401a3493c9b85c72651e220.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/derived_cond_pushdown.test')
-rw-r--r--mysql-test/main/derived_cond_pushdown.test34
1 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test
index 1de1e8a8d15..340aa1f5a54 100644
--- a/mysql-test/main/derived_cond_pushdown.test
+++ b/mysql-test/main/derived_cond_pushdown.test
@@ -3109,6 +3109,40 @@ WHERE ((a,b) IN ((1,2),(3,2)));
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-17354: INSERT SELECT with condition pushdown into derived
+--echo #
+
+CREATE TABLE t1 (f INT NOT NULL);
+INSERT INTO t1 VALUES (3), (7), (3);
+
+CREATE ALGORITHM= TEMPTABLE VIEW v1 AS SELECT * FROM ( SELECT * FROM t1 ) AS sq;
+
+let $q1=
+INSERT INTO t1
+SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL;
+
+eval $q1;
+eval EXPLAIN $q1;
+eval EXPLAIN FORMAT=JSON $q1;
+SELECT * FROM t1;
+
+DELETE FROM t1;
+INSERT INTO t1 VALUES (3), (7), (3);
+
+let $q2=
+INSERT INTO t1
+SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ON v1.f=t1.f) AS t
+ WHERE f IS NOT NULL;
+
+eval $q2;
+eval EXPLAIN FORMAT=JSON $q2;
+SELECT * FROM t1;
+
+DROP VIEW v1;
+DROP TABLE t1;
+
--echo # Start of 10.3 tests
--echo #