Skip to content

Commit e599402

Browse files
committed
MDEV-37938 very long query cannot be killed quickly
check for thd->killed in the lexer
1 parent 7888b6c commit e599402

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sql/sql_lex.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,6 +2028,12 @@ int Lex_input_stream::lex_one_token(YYSTYPE *yylval, THD *thd)
20282028
const uchar *const state_map= cs->state_map;
20292029
const uchar *const ident_map= cs->ident_map;
20302030

2031+
if (thd->killed)
2032+
{
2033+
thd->send_kill_message();
2034+
return END_OF_INPUT;
2035+
}
2036+
20312037
start_token();
20322038
state= next_state;
20332039
next_state= MY_LEX_OPERATOR_OR_IDENT;

0 commit comments

Comments
 (0)