diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-19 19:58:27 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-19 20:22:33 +0200 |
commit | dde2ca4aa108b611b5fdfc970146b28461ef08bf (patch) | |
tree | 08f90bb9d54413af23230ccf99f18391596afa34 /mysql-test/main/derived_cond_pushdown.result | |
parent | b5ac863f1494920b5e7035c9dfa0ebfdaa50a15d (diff) | |
parent | fd58bb71e22196c3c5e8d20b92bce6f343f1dea1 (diff) | |
download | mariadb-git-dde2ca4aa108b611b5fdfc970146b28461ef08bf.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test/main/derived_cond_pushdown.result')
-rw-r--r-- | mysql-test/main/derived_cond_pushdown.result | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index dac180301d7..ceb14aaca6d 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -10403,6 +10403,99 @@ f 3 DROP VIEW v1; DROP TABLE t1; +# +# MDEV-17574: pushdown into derived from mergeable view +# used in multi-table UPDATE +# pushdown into materialized derived from mergeable view +# used in SELECT +# +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; +UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2; +EXPLAIN FORMAT=JSON UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "<derived3>", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t.f2 < 2", + "materialized": { + "query_block": { + "select_id": 3, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t1.f2 < 2" + } + } + } + }, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t1.f2 = t.f2" + } + } +} +SELECT * FROM t1; +f1 f2 +z 1 +y 2 +CREATE VIEW v2 AS SELECT f2 FROM ( SELECT DISTINCT f2 FROM t1 ) AS t; +SELECT * FROM v2, t1 WHERE v2.f2 < 2 AND t1.f2 = v2.f2; +f2 f1 f2 +1 z 1 +EXPLAIN FORMAT=JSON SELECT * FROM v2, t1 WHERE v2.f2 < 2 AND t1.f2 = v2.f2; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "<derived3>", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t.f2 < 2", + "materialized": { + "query_block": { + "select_id": 3, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t1.f2 < 2" + } + } + } + } + }, + "block-nl-join": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100 + }, + "buffer_type": "flat", + "buffer_size": "256Kb", + "join_type": "BNL", + "attached_condition": "t1.f2 = t.f2" + } + } +} +DROP VIEW v1,v2; +DROP TABLE t1; # End of 10.2 tests # # MDEV-14579: pushdown conditions into materialized views/derived tables |