1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Backporting slow log simulation logic details from 10.2 to 10.1

Simulate slow statements only for COM_QUERY and COM_STMT_EXECUTE commands,
to exclude mysqld_stmt_prepare() and mysqld_stmt_close() entries from the log,
as they are not relevant for log_slow_debug.test. This simplifies the test.
This commit is contained in:
Alexander Barkov
2019-03-22 15:48:49 +04:00
parent 9c9bf9642e
commit f704361cd6
3 changed files with 9 additions and 24 deletions

View File

@ -2048,8 +2048,11 @@ void log_slow_statement(THD *thd)
if (!thd->enable_slow_log)
goto end; // E.g. SP statement
DBUG_EXECUTE_IF("simulate_slow_query",
thd->server_status|= SERVER_QUERY_WAS_SLOW;);
DBUG_EXECUTE_IF("simulate_slow_query", {
if (thd->get_command() == COM_QUERY ||
thd->get_command() == COM_STMT_EXECUTE)
thd->server_status|= SERVER_QUERY_WAS_SLOW;
});
if (((thd->server_status & SERVER_QUERY_WAS_SLOW) ||
((thd->server_status &