1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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
parent 11408a69ad
commit ba8d0fa700
8 changed files with 97 additions and 1 deletions

View File

@@ -366,7 +366,11 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived)
derived->get_unit()));
if (derived->merged)
{
DBUG_PRINT("info", ("Irreversibly merged: exit"));
DBUG_RETURN(FALSE);
}
if (dt_select->uncacheable & UNCACHEABLE_RAND)
{
@@ -667,6 +671,17 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
unit->derived= derived;
/*
Above cascade call of prepare is important for PS protocol, but after it
is called we can check if we really need prepare for this derived
*/
if (derived->merged)
{
DBUG_PRINT("info", ("Irreversibly merged: exit"));
DBUG_RETURN(FALSE);
}
derived->fill_me= FALSE;
if (!(derived->derived_result= new select_union))
@@ -795,6 +810,11 @@ bool mysql_derived_optimize(THD *thd, LEX *lex, TABLE_LIST *derived)
DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
(derived->alias ? derived->alias : "<NULL>"),
derived->get_unit()));
if (derived->merged)
{
DBUG_PRINT("info", ("Irreversibly merged: exit"));
DBUG_RETURN(FALSE);
}
if (unit->optimized)
DBUG_RETURN(FALSE);