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

MDEV-35571 Check for LIMIT ROWS EXAMINED exceeded in UNION ALL

When UNION ALL is used with LIMIT ROWS EXAMINED, and when the limit is
exceeded for a SELECT that is not the last in the UNION, interrupt the
execution and call end_eof on the result. This makes sure that the
results are sent, and the query result status is conclusive rather
than empty, which would cause an assertion failure.
This commit is contained in:
Yuchen Pei
2024-12-09 19:27:53 +11:00
parent 3e34e4c161
commit 432856c473
3 changed files with 86 additions and 1 deletions

View File

@ -1026,7 +1026,8 @@ bool select_union_direct::send_eof()
// Reset for each SELECT_LEX, so accumulate here
limit_found_rows+= thd->limit_found_rows;
if (unit->thd->lex->current_select == last_select_lex)
if (unit->thd->lex->current_select == last_select_lex ||
thd->killed == ABORT_QUERY)
{
thd->limit_found_rows= limit_found_rows;