diff options
author | Igor Babaev <igor@askmonty.org> | 2019-06-20 18:50:20 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2019-06-22 09:18:24 -0700 |
commit | 645191aa1338caa397124e5c02002d93a07a628b (patch) | |
tree | a5d67a881dc646566c2357758b23453ad55e3164 /sql/item_func.cc | |
parent | 15065a2398aa3ddc40625f150cf8646d505b692a (diff) | |
download | mariadb-git-645191aa1338caa397124e5c02002d93a07a628b.tar.gz |
MDEV-19778 Wrong Result on Left Outer Join with Subquery right on true
and WHERE filter afterwards
This patch complements the patch fixing the bug MDEV-6892. The latter
properly handled queries that used mergeable views returning constant
columns as inner tables of outer joins and whose where clause contained
predicates referring to these columns if the predicates of happened not
to be equality predicates. Otherwise the server still could return wrong
result sets for such queries. Besides the fix for MDEV-6892 prevented
some possible conversions of outer joins to inner joins for such queries.
This patch corrected the function check_simple_equality() to handle
properly conjunctive equalities of the where clause that refer to the
constant columns of mergeable views used as inner tables of an outer join.
The patch also changed the code of Item_direct_view_ref::not_null_tables().
This change allowed to take into account predicates containing references
to constant columns of mergeable views when converting outer joins into
inner joins.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 22d7e8c7bb6..dad4b89b3bc 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -226,6 +226,7 @@ Item_func::fix_fields(THD *thd, Item **ref) with_field= with_field || item->with_field; used_tables_cache|= item->used_tables(); const_item_cache&= item->const_item(); + not_null_tables_cache|= item->not_null_tables(); with_subselect|= item->has_subquery(); } } |