summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@sun.com>2009-09-29 15:09:01 +0100
committerLuis Soares <luis.soares@sun.com>2009-09-29 15:09:01 +0100
commit01cdba58ba758e468d01770e87bca7f22790a184 (patch)
tree64c15326cb2b159380a2ab3ed5267c3d102adbde /sql/log.cc
parentd94e279c7ce6953f50f033278a385ab8633526ce (diff)
downloadmariadb-git-01cdba58ba758e468d01770e87bca7f22790a184.tar.gz
BUG#23300: Slow query log on slave does not log slow replicated statements
NOTE: this is the backport to next-mr. When using replication, the slave will not log any slow query logs queries replicated from the master, even if the option "--log-slow-slave-statements" is set and these take more than "log_query_time" to execute. In order to log slow queries in replicated thread one needs to set the --log-slow-slave-statements, so that the SQL thread is initialized with the correct switch. Although setting this flag correctly configures the slave thread option to log slow queries, there is an issue with the condition that is used to check whether to log the slow query or not. When replaying binlog events the statement contains the SET TIMESTAMP clause which will force the slow logging condition check to fail. Consequently, the slow query logging will not take place. This patch addresses this issue by removing the second condition from the log_slow_statements as it prevents slow queries to be binlogged and seems to be deprecated.
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 1af2f3a4ddc..5c25d30bad0 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -961,6 +961,7 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length,
uint user_host_len= 0;
ulonglong query_utime, lock_utime;
+ DBUG_ASSERT(thd->enable_slow_log);
/*
Print the message to the buffer if we have slow log enabled
*/