MDEV-14786: Server crashes in Item_cond::transform on 2nd execution of SP querying from a view

MDEV-14957: JOIN::prepare gets unusable "conds" as argument

Do not touch merged derived (it is irreversible)

Fix first argument of in_optimizer for calls possible before fix_fields()
This commit is contained in:
Oleksandr Byelkin 2018-01-15 14:50:35 +01:00
commit ba8d0fa700
8 changed files with 97 additions and 1 deletions

View file

@ -638,6 +638,9 @@ JOIN::prepare(Item ***rref_pointer_array,
join_list= &select_lex->top_join_list;
union_part= unit_arg->is_union();
// simple check that we got usable conds
dbug_print_item(conds);
if (select_lex->handle_derived(thd->lex, DT_PREPARE))
DBUG_RETURN(1);