summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-03-22 15:48:49 +0400
committerAlexander Barkov <bar@mariadb.com>2019-03-22 15:56:45 +0400
commitf704361cd6f43445dbd108d54d1124f6722b4025 (patch)
tree5cba331dc6e3c0b668d8db975a913e6958235870 /sql/sql_parse.cc
parent9c9bf9642e5693841375350540530141e1916b36 (diff)
downloadmariadb-git-f704361cd6f43445dbd108d54d1124f6722b4025.tar.gz
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.
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 6b289a9fee9..0edb8a3f5a3 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -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 &