mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
MDEV-4206 : log all slow statements (do not use filters), if log_slow_filter is empty.
This commit is contained in:
parent
e013bf9f0e
commit
f33178b99a
3 changed files with 27 additions and 2 deletions
|
@ -56,5 +56,18 @@ insert_id int(11) NO NULL
|
|||
server_id int(10) unsigned NO NULL
|
||||
sql_text mediumtext NO NULL
|
||||
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_verbosity=default;
|
||||
|
|
|
@ -42,7 +42,18 @@ show fields from mysql.slow_log;
|
|||
|
||||
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_verbosity=default;
|
||||
|
|
|
@ -1497,7 +1497,8 @@ void log_slow_statement(THD *thd)
|
|||
|
||||
/* Follow the slow log filter configuration. */
|
||||
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;
|
||||
|
||||
if (((thd->server_status & SERVER_QUERY_WAS_SLOW) ||
|
||||
|
|
Loading…
Reference in a new issue