1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
Igor Babaev
2017-02-26 15:40:18 -08:00
parent 199f88cb9c
commit 5a0fff50f8
5 changed files with 151 additions and 4 deletions

View File

@ -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;