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:
@ -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;
|
||||
|
Reference in New Issue
Block a user