1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fixed bug mdev-12375.

The function st_select_lex_unit::exec_recursive() incorrectly determined
that a CTE mutually recursive with some others was stabilized in the case
when the non-recursive part of the CTE returned an empty set. As a result
the server fell into an infinite loop when executing a query using
this CTE.
This commit is contained in:
Igor Babaev
2017-03-27 14:41:17 -07:00
parent 046d442d4c
commit 93dd70ced8
3 changed files with 126 additions and 2 deletions

View File

@ -1247,7 +1247,7 @@ bool st_select_lex_unit::exec_recursive()
thd->inc_examined_row_count(examined_rows);
incr_table->file->info(HA_STATUS_VARIABLE);
if (incr_table->file->stats.records == 0)
if (with_element->level && incr_table->file->stats.records == 0)
with_element->set_as_stabilized();
else
with_element->level++;