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

Merge branch '10.4' into bb-10.4-mdev17096

This commit is contained in:
Igor Babaev
2019-02-06 18:01:29 -08:00
3283 changed files with 144674 additions and 282912 deletions

View File

@ -1128,6 +1128,7 @@ bool mysql_derived_fill(THD *thd, LEX *lex, TABLE_LIST *derived)
DBUG_ASSERT(derived->table && derived->table->is_created());
select_unit *derived_result= derived->derived_result;
SELECT_LEX *save_current_select= lex->current_select;
bool derived_recursive_is_filled= false;
if (derived->pushdown_derived)
{
@ -1167,6 +1168,7 @@ bool mysql_derived_fill(THD *thd, LEX *lex, TABLE_LIST *derived)
{
/* In this case all iteration are performed */
res= derived->fill_recursive(thd);
derived_recursive_is_filled= true;
}
}
else if (unit->is_unit_op())
@ -1222,7 +1224,8 @@ bool mysql_derived_fill(THD *thd, LEX *lex, TABLE_LIST *derived)
}
}
err:
if (res || (!lex->describe && !derived_is_recursive && !unit->uncacheable))
if (res || (!lex->describe && !unit->uncacheable &&
(!derived_is_recursive || derived_recursive_is_filled)))
unit->cleanup();
lex->current_select= save_current_select;