diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-19 18:45:53 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-19 18:45:53 +0200 |
commit | fd58bb71e22196c3c5e8d20b92bce6f343f1dea1 (patch) | |
tree | 88b34c77a20d9e816edce51e9dcff47f6de526c8 /mysql-test/main/derived_cond_pushdown.test | |
parent | 37d6d3b661315617953f1a8c5d53a2cb6558992e (diff) | |
parent | e669e705a1a7d2bbdd42734cb9fc8349a5f2f118 (diff) | |
download | mariadb-git-fd58bb71e22196c3c5e8d20b92bce6f343f1dea1.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.test | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test index 659bc2026ff..076d39c1abd 100644 --- a/mysql-test/main/derived_cond_pushdown.test +++ b/mysql-test/main/derived_cond_pushdown.test @@ -2075,6 +2075,33 @@ SELECT * FROM t1; DROP VIEW v1; DROP TABLE t1; +--echo # +--echo # MDEV-17574: pushdown into derived from mergeable view +--echo # used in multi-table UPDATE +--echo # pushdown into materialized derived from mergeable view +--echo # used in SELECT +--echo # + +CREATE TABLE t1 (f1 text, f2 int); +INSERT INTO t1 VALUES ('x',1), ('y',2); + +CREATE VIEW v1 AS SELECT f2 FROM ( SELECT f2 FROM t1 ) AS t; +let $q1 = +UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2; +eval $q1; +eval EXPLAIN FORMAT=JSON $q1; + +SELECT * FROM t1; + +CREATE VIEW v2 AS SELECT f2 FROM ( SELECT DISTINCT f2 FROM t1 ) AS t; +let $q2 = +SELECT * FROM v2, t1 WHERE v2.f2 < 2 AND t1.f2 = v2.f2; +eval $q2; +eval EXPLAIN FORMAT=JSON $q2; + +DROP VIEW v1,v2; +DROP TABLE t1; + --echo # End of 10.2 tests --echo # |