Removed the parameter from st_select_lex_unit::exec_recursive.

Moved checking whether the limit set for the number of iterations
when executing a recursive query has been reached from
st_select_lex_unit::exec_recursive to TABLE_LIST::fill_recursive.
Changed the name of the system variable max_recursion_level for
max_recursive_iterations.
Adjusted test cases.
This commit is contained in:
Igor Babaev 2016-08-10 15:51:40 -07:00
commit 2f9555c40f
10 changed files with 40 additions and 34 deletions

View file

@ -927,13 +927,18 @@ bool TABLE_LIST::fill_recursive(THD *thd)
bool rc= false;
st_select_lex_unit *unit= get_unit();
if (is_with_table_recursive_reference())
rc= unit->exec_recursive(false);
{
rc= unit->exec_recursive();
}
else
{
rc= with->instantiate_tmp_tables();
while(!rc && !with->all_are_stabilized())
while (!rc && !with->all_are_stabilized())
{
rc= unit->exec_recursive(true);
if (with->level > thd->variables.max_recursive_iterations)
break;
with->prepare_for_next_iteration();
rc= unit->exec_recursive();
}
if (!rc)
{