Please sign in to comment.
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.
- Loading branch information...
Showing with 126 additions and 6 deletions.
- +9 −0 mysql-test/r/derived.result
- +57 −0 mysql-test/r/derived_view.result
- +2 −0 mysql-test/r/func_group.result
- +2 −0 mysql-test/r/subselect_cache.result
- +4 −0 mysql-test/t/derived.test
- +34 −0 mysql-test/t/derived_view.test
- +8 −5 sql/item.cc
- +1 −0 sql/item.h
- +1 −0 sql/item_func.cc
- +8 −1 sql/sql_select.cc