diff options
author | Igor Babaev <igor@askmonty.org> | 2017-06-22 00:41:44 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2017-06-22 22:06:03 -0700 |
commit | 9f3622191df074d9f4e512320effe86f06b250fb (patch) | |
tree | 16aadc76e982cb17349df79a381af23fec27b2f8 /sql/item_func.h | |
parent | a8131e71f9504a7399bc9a7f312b14ed6700d099 (diff) | |
download | mariadb-git-9f3622191df074d9f4e512320effe86f06b250fb.tar.gz |
Fixed the bug mdev-12845.
This patch fills in a serious flaw in the
code that supports condition pushdown into
materialized views / derived tables.
If a predicate happened to contain a reference
to a mergeable view / derived table and it does
not depended directly on the target materialized
view / derived table then the predicate was not
considered as a subject to pusdown to this view
/ derived table.
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index 0919685bbf3..585b981ba05 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -316,6 +316,19 @@ public: return this; } + bool excl_dep_on_table(table_map tab_map) + { + if (used_tables() & OUTER_REF_TABLE_BIT) + return false; + return !(used_tables() & ~tab_map) || + Item_args::excl_dep_on_table(tab_map); + } + + bool excl_dep_on_grouping_fields(st_select_lex *sel) + { + return Item_args::excl_dep_on_grouping_fields(sel); + } + /* We assume the result of any function that has a TIMESTAMP argument to be timezone-dependent, since a TIMESTAMP value in both numeric and string |