Skip to content

MDEV-31209 Queries with window functions do not obey KILL / max_statement_time#5126

Open
grooverdan wants to merge 1 commit into
MariaDB:10.11from
grooverdan:MDEV-31209
Open

MDEV-31209 Queries with window functions do not obey KILL / max_statement_time#5126
grooverdan wants to merge 1 commit into
MariaDB:10.11from
grooverdan:MDEV-31209

Conversation

@grooverdan
Copy link
Copy Markdown
Member

Window functions run in a loop in
Frame_cursor::compute_values_for_current_row which can include a large number of rows.

Adjust this function to check for the current thd being killed.

@grooverdan grooverdan added the MariaDB Foundation Pull requests created by MariaDB Foundation label May 26, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes MDEV-31209 by ensuring queries with window functions respect KILL and max_statement_time limits. It adds a check for current_thd->check_killed(true) in the Frame_scan_cursor loop in sql/sql_window.cc and includes corresponding test cases. The review feedback suggests caching current_thd in a local variable before the loop to avoid thread-local storage (TLS) lookup overhead on every iteration.

Comment thread sql/sql_window.cc Outdated
…ment_time

Window functions run in a loop in
Frame_cursor::compute_values_for_current_row which can include a large
number of rows.

Adjust this function to check for the current thd being killed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MariaDB Foundation Pull requests created by MariaDB Foundation

Development

Successfully merging this pull request may close these issues.

1 participant