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

Ensure that process "State" is properly cleaned after query execution

In some cases "SHOW PROCESSLIST" could show "Reset for next command"
as State, even if the previous query had finished properly.

Fixed by clearing State after end of command and also setting the State
for the "Connect" command.

Other things:
- Changed usage of 'thd->set_command(COM_SLEEP)' to
  'thd->mark_connection_idle()'.
- Changed thread_state_info() to return "" instead of NULL. This is
  just a safety measurement and in line with the logic of the
  rest of the function.
This commit is contained in:
Monty
2023-11-06 17:37:11 +02:00
parent 01623ac9ea
commit 2447172afb
10 changed files with 22 additions and 12 deletions

View File

@ -2465,7 +2465,7 @@ dispatch_end:
/* Performance Schema Interface instrumentation, end */
MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
thd->set_examined_row_count(0); // For processlist
thd->set_command(COM_SLEEP);
thd->mark_connection_idle();
thd->m_statement_psi= NULL;
thd->m_digest= NULL;
@ -7903,6 +7903,7 @@ static bool wsrep_mysql_parse(THD *thd, char *rawbuf, uint length,
thd->wsrep_retry_query = NULL;
thd->wsrep_retry_query_len = 0;
thd->wsrep_retry_command = COM_CONNECT;
thd->proc_info= 0;
}
return false;
}