source include/have_xtradb.inc;

SET GLOBAL SLOW_QUERY_LOG=ON;

SELECT sleep(1);
SELECT sleep(3);
SELECT sleep(5);

set global long_query_time=4;
set global slow_query_log_use_global_control='long_query_time';

SELECT sleep(1);
SELECT sleep(3);
SELECT sleep(5);

set global long_query_time=2;
set global slow_query_log_use_global_control='';

SET GLOBAL SLOW_QUERY_LOG=OFF;

FLUSH LOGS;
--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-use_global_long_query_time.log
--let grep_pattern = Query_time
--source grep.inc

show global variables like 'slow_query_log_use_global_control';

set global slow_query_log_use_global_control='long_query_time';
show global variables like 'slow_query_log_use_global_control';

set global slow_query_log_use_global_control='log_slow_filter,long_query_time';
show global variables like 'slow_query_log_use_global_control';

set global slow_query_log_use_global_control='log_slow_filter';
show global variables like 'slow_query_log_use_global_control';

set global slow_query_log_use_global_control='';
show global variables like 'slow_query_log_use_global_control';

set global slow_query_log_use_global_control='long_query_time';
