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

MDEV-17201 dropped anchor rows with non-null recursion query

The function st_select_lex_unit::exec_recursive() missed resetting of
select_limit_cnt and offset_limit_cnt before execution of union parts.
As a result recursive CTEs specified by UNIONs whose SELECTs contained
LIMIT/OFFSET could return wrong sets of records.
This commit is contained in:
Igor Babaev
2018-09-17 23:15:56 -07:00
parent 65474d92f5
commit 6858d5346c
3 changed files with 99 additions and 0 deletions

View File

@ -1274,6 +1274,7 @@ bool st_select_lex_unit::exec_recursive()
for (st_select_lex *sl= start ; sl != end; sl= sl->next_select())
{
thd->lex->current_select= sl;
set_limit(sl);
sl->join->exec();
saved_error= sl->join->error;
if (!saved_error)