1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge 10.3 into 10.4

This commit is contained in:
Marko Mäkelä
2018-10-05 08:09:49 +03:00
464 changed files with 10228 additions and 197067 deletions

View File

@ -1728,6 +1728,7 @@ bool st_select_lex_unit::exec_recursive()
}
}
thd->lex->current_select= sl;
set_limit(sl);
if (sl->tvc)
sl->tvc->exec(sl);
else
@ -1796,6 +1797,37 @@ bool st_select_lex_unit::cleanup()
{
DBUG_RETURN(FALSE);
}
/*
When processing a PS/SP or an EXPLAIN command cleanup of a unit can
be performed immediately when the unit is reached in the cleanup
traversal initiated by the cleanup of the main unit.
*/
if (!thd->stmt_arena->is_stmt_prepare() && !thd->lex->describe &&
with_element && with_element->is_recursive && union_result)
{
select_union_recursive *result= with_element->rec_result;
if (++result->cleanup_count == with_element->rec_outer_references)
{
/*
Perform cleanup for with_element and for all with elements
mutually recursive with it.
*/
cleaned= 1;
with_element->get_next_mutually_recursive()->spec->cleanup();
}
else
{
/*
Just increment by 1 cleanup_count for with_element and
for all with elements mutually recursive with it.
*/
With_element *with_elem= with_element;
while ((with_elem= with_elem->get_next_mutually_recursive()) !=
with_element)
with_elem->rec_result->cleanup_count++;
DBUG_RETURN(FALSE);
}
}
cleaned= 1;
for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select())
@ -1826,7 +1858,7 @@ bool st_select_lex_unit::cleanup()
if (with_element && with_element->is_recursive)
{
if (union_result )
if (union_result)
{
((select_union_recursive *) union_result)->cleanup();
delete union_result;