diff options
author | Igor Babaev <igor@askmonty.org> | 2016-08-10 15:51:40 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2016-08-10 15:51:40 -0700 |
commit | 2f9555c40f96a956184a97e99d1b8f4cafbab024 (patch) | |
tree | 720fa733cd37f94d1294d1e91b52cd0f285319c6 /sql/sql_derived.cc | |
parent | e20e28bd2eca6bb4961a298c2765885155bfdd57 (diff) | |
download | mariadb-git-2f9555c40f96a956184a97e99d1b8f4cafbab024.tar.gz |
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.
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r-- | sql/sql_derived.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index e17896f9f24..33befdd4639 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -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) { |