diff options
author | Igor Babaev <igor@askmonty.org> | 2017-02-26 15:40:18 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2017-02-27 09:02:41 -0800 |
commit | 5a0fff50f87e20c4e95a84143a0a3bb67e03e29e (patch) | |
tree | 9b5ffd8ae32bc28a3a8a9c7866c2fc23fd11216f /sql/sql_derived.cc | |
parent | 199f88cb9cfb08cefced1b51a7d98fe4c91b7a2e (diff) | |
download | mariadb-git-5a0fff50f87e20c4e95a84143a0a3bb67e03e29e.tar.gz |
Fixed bug mdev-12099.
The function mysql_derived_merge() erroneously did not mark newly formed
AND formulas in ON conditions with the flag abort_on_null. As a result
not_null_tables() calculated incorrectly for these conditions. This
could prevent conversion of embedded outer joins into inner joins.
Changed a test case from table_elim.test to preserve the former execution
plan.
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r-- | sql/sql_derived.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 44395599961..20fca2de8cf 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -446,6 +446,9 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived) { Item *expr= derived->on_expr; expr= and_conds(expr, dt_select->join ? dt_select->join->conds : 0); + if (expr) + expr->top_level_item(); + if (expr && (derived->prep_on_expr || expr != derived->on_expr)) { derived->on_expr= expr; |