mariadb/mysql-test/main/log_slow_always_query_time.result
Monty 40810baffe MDEV-33144 Implement the Percona variable slow_query_log_always_write_time
This task is inspired by the Percona implementation of
slow_query_log_always_write_time.

This task implements the variable log_slow_always_query_time (name
matching other MariaDB variables using the slow query log). The
default value for the variable is 31536000, which makes MariaDB
compatible with older installations.

For queries with execution time longer than log_slow_always_query_time
the variables log_slow_rate_limit and log_slow_min_examined_row_limit
will be ignored and the query will be written to the slow query log
if there is no other limitations (like log_slow_filter etc).

Other things:
- long_query_time internal variable renamed to log_slow_query_time.
- More descriptive information for "log_slow_query_time".
2024-11-01 08:58:37 +01:00

22 lines
858 B
Text

select @@session.log_slow_always_query_time;
@@session.log_slow_always_query_time
31536000.000000
SET GLOBAL log_slow_always_query_time= 20.2;
SET SESSION log_slow_always_query_time=20.2;
select @@global.log_slow_always_query_time, @@session.log_slow_always_query_time;
@@global.log_slow_always_query_time @@session.log_slow_always_query_time
20.200000 20.200000
set GLOBAL log_slow_always_query_time= default;
SET log_slow_query_time=0.5;
SET log_slow_rate_limit=999;
SET log_slow_always_query_time=1.5;
SET log_slow_min_examined_row_limit= 100;
[slow_log_start.inc] log_slow_always_query_time-1
SELECT sleep(2) as 'this-should-be-logged';
this-should-be-logged
0
SELECT sleep(1) as 'this-should-not-be-logged';
this-should-not-be-logged
0
[log_grep.inc] file: log_slow_always_query_time-1 pattern: this-should expected_matches: 1
[log_grep.inc] lines: 1