Commit f33178b9 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-4206 : log all slow statements (do not use filters), if log_slow_filter is empty.

parent e013bf9f
...@@ -56,5 +56,18 @@ insert_id int(11) NO NULL ...@@ -56,5 +56,18 @@ insert_id int(11) NO NULL
server_id int(10) unsigned NO NULL server_id int(10) unsigned NO NULL
sql_text mediumtext NO NULL sql_text mediumtext NO NULL
flush slow logs; flush slow logs;
set long_query_time=0.1;
set log_slow_filter='';
set global slow_query_log=1;
set global log_output='TABLE';
select sleep(0.5);
sleep(0.5)
0
select count(*) FROM mysql.slow_log;
count(*)
1
truncate mysql.slow_log;
set @@long_query_time=default;
set global slow_query_log=default;
set @@log_slow_filter=default; set @@log_slow_filter=default;
set @@log_slow_verbosity=default; set @@log_slow_verbosity=default;
...@@ -42,7 +42,18 @@ show fields from mysql.slow_log; ...@@ -42,7 +42,18 @@ show fields from mysql.slow_log;
flush slow logs; flush slow logs;
# Reset used variables # MDEV-4206 (empty filter should be no filter)
set long_query_time=0.1;
set log_slow_filter='';
set global slow_query_log=1;
set global log_output='TABLE';
select sleep(0.5);
select count(*) FROM mysql.slow_log;
truncate mysql.slow_log;
# Reset used variables
set @@long_query_time=default;
set global slow_query_log=default;
set @@log_slow_filter=default; set @@log_slow_filter=default;
set @@log_slow_verbosity=default; set @@log_slow_verbosity=default;
...@@ -1497,7 +1497,8 @@ void log_slow_statement(THD *thd) ...@@ -1497,7 +1497,8 @@ void log_slow_statement(THD *thd)
/* Follow the slow log filter configuration. */ /* Follow the slow log filter configuration. */
if (!thd->enable_slow_log || if (!thd->enable_slow_log ||
!(thd->variables.log_slow_filter & thd->query_plan_flags)) (thd->variables.log_slow_filter
&& !(thd->variables.log_slow_filter & thd->query_plan_flags)))
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
if (((thd->server_status & SERVER_QUERY_WAS_SLOW) || if (((thd->server_status & SERVER_QUERY_WAS_SLOW) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment