summaryrefslogtreecommitdiff
path: root/mysql-test/suite/percona
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-07-18 23:04:24 +0200
committerSergei Golubchik <sergii@pisem.net>2011-07-18 23:04:24 +0200
commit4e46d8e5bff140f2549841167dc4b65a3c0a645d (patch)
treec6612dcc1d0fbd801c084e6c36307d9e5913a293 /mysql-test/suite/percona
parent9a02c69f5c6766eaf552284a2a4dd0f1d26ecd2c (diff)
parentd4d7a8fa62c406be73f6c0f6d75e795293db548b (diff)
downloadmariadb-git-4e46d8e5bff140f2549841167dc4b65a3c0a645d.tar.gz
merge with xtradb-5.5.15
fix test cases
Diffstat (limited to 'mysql-test/suite/percona')
-rw-r--r--mysql-test/suite/percona/disabled.def20
-rw-r--r--mysql-test/suite/percona/grep.inc16
-rw-r--r--mysql-test/suite/percona/have_response_time_distribution.inc4
-rw-r--r--mysql-test/suite/percona/percona_bug643149.result21
-rw-r--r--mysql-test/suite/percona/percona_bug643149.test49
-rw-r--r--mysql-test/suite/percona/percona_innodb_buffer_pool_shm.result4
-rw-r--r--mysql-test/suite/percona/percona_innodb_buffer_pool_shm.test18
-rw-r--r--mysql-test/suite/percona/percona_innodb_deadlock_count.result10
-rw-r--r--mysql-test/suite/percona/percona_innodb_deadlock_count.test22
-rw-r--r--mysql-test/suite/percona/percona_log_connection_error-master.opt2
-rw-r--r--mysql-test/suite/percona/percona_log_connection_error.test4
-rw-r--r--mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.test141
-rw-r--r--mysql-test/suite/percona/percona_log_slow_slave_statements.result86
-rw-r--r--mysql-test/suite/percona/percona_log_slow_slave_statements.test162
-rw-r--r--mysql-test/suite/percona/percona_log_warnings_suppress-master.opt (renamed from mysql-test/suite/percona/percona_suppress_log_warning_1592-master.opt)0
-rw-r--r--mysql-test/suite/percona/percona_log_warnings_suppress.result31
-rw-r--r--mysql-test/suite/percona/percona_log_warnings_suppress.test (renamed from mysql-test/suite/percona/percona_suppress_log_warning_1592.test)17
-rw-r--r--mysql-test/suite/percona/percona_processlist_row_stats.result74
-rw-r--r--mysql-test/suite/percona/percona_processlist_row_stats.test92
-rw-r--r--mysql-test/suite/percona/percona_query_cache_with_comments.inc95
-rw-r--r--mysql-test/suite/percona/percona_query_cache_with_comments.test1
-rw-r--r--mysql-test/suite/percona/percona_query_cache_with_comments_begin.inc12
-rw-r--r--mysql-test/suite/percona/percona_query_cache_with_comments_clear.inc5
-rw-r--r--mysql-test/suite/percona/percona_query_cache_with_comments_end.inc3
-rw-r--r--mysql-test/suite/percona/percona_query_cache_with_comments_eval.inc7
-rw-r--r--mysql-test/suite/percona/percona_query_cache_with_comments_show.inc8
-rw-r--r--mysql-test/suite/percona/percona_query_response_time-replication.result30
-rw-r--r--mysql-test/suite/percona/percona_query_response_time-replication.test21
-rw-r--r--mysql-test/suite/percona/percona_query_response_time-stored.result50
-rw-r--r--mysql-test/suite/percona/percona_query_response_time-stored.test42
-rw-r--r--mysql-test/suite/percona/percona_query_response_time.result433
-rw-r--r--mysql-test/suite/percona/percona_query_response_time.test30
-rw-r--r--mysql-test/suite/percona/percona_query_response_time_flush.inc1
-rw-r--r--mysql-test/suite/percona/percona_query_response_time_show.inc8
-rw-r--r--mysql-test/suite/percona/percona_query_response_time_sleep.inc19
-rw-r--r--mysql-test/suite/percona/percona_server_variables.inc3
-rw-r--r--mysql-test/suite/percona/percona_server_variables.result342
-rw-r--r--mysql-test/suite/percona/percona_server_variables.test7
-rw-r--r--mysql-test/suite/percona/percona_server_variables_debug.result371
-rw-r--r--mysql-test/suite/percona/percona_server_variables_debug.test2
-rw-r--r--mysql-test/suite/percona/percona_server_variables_release.result368
-rw-r--r--mysql-test/suite/percona/percona_server_variables_release.test2
-rw-r--r--mysql-test/suite/percona/percona_show_slave_status_nolock.result21
-rw-r--r--mysql-test/suite/percona/percona_show_slave_status_nolock.test53
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-log_slow_filter-master.opt (renamed from mysql-test/suite/percona/percona_slow_query_log-log_slow_filter-master.opt)2
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-log_slow_filter.result (renamed from mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.result)4
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-log_slow_filter.test (renamed from mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.test)17
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-log_slow_sp_statements-cl-master.opt1
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-log_slow_sp_statements-cl.result3
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-log_slow_sp_statements-cl.test1
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-cl-master.opt1
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-cl.result9
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-cl.test3
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-master.opt (renamed from mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity-master.opt)2
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity.result9
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity.test12
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-long_query_time-master.opt (renamed from mysql-test/suite/percona/percona_slow_query_log-long_query_time-master.opt)2
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-long_query_time.result24
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-long_query_time.test23
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-microseconds_in_slow_extended-master.opt (renamed from mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log-master.opt)2
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-microseconds_in_slow_extended.result13
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-microseconds_in_slow_extended.test23
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-min_examined_row_limit-master.opt (renamed from mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit-master.opt)2
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-min_examined_row_limit.result (renamed from mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.result)4
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-min_examined_row_limit.test (renamed from mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.test)16
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slave_innodb_stats-master.opt (renamed from mysql-test/suite/percona/percona_slave_innodb_stats-master.opt)0
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slave_innodb_stats-slave.opt (renamed from mysql-test/suite/percona/percona_slave_innodb_stats-slave.opt)0
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slave_innodb_stats.result (renamed from mysql-test/suite/percona/percona_slave_innodb_stats.result)13
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slave_innodb_stats.test (renamed from mysql-test/suite/percona/percona_slave_innodb_stats.test)14
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slave_statements-and-use_global_long_query_time-master.opt (renamed from mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-master.opt)2
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slave_statements-and-use_global_long_query_time-slave.opt (renamed from mysql-test/suite/percona/percona_log_slow_slave_statements-slave.opt)2
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slave_statements-and-use_global_long_query_time.result (renamed from mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.result)56
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slave_statements-and-use_global_long_query_time.test107
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slave_statements-master.opt (renamed from mysql-test/suite/percona/percona_log_slow_slave_statements-master.opt)2
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slave_statements-slave.opt (renamed from mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-slave.opt)2
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slave_statements.result94
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slave_statements.test133
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slow_query_log_microseconds_timestamp-cl-master.opt1
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.result3
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.test1
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl-master.opt1
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.result3
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.test1
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-use_global_control-master.opt (renamed from mysql-test/suite/percona/percona_slow_query_log-control_global_slow-master.opt)2
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-use_global_control.result12
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-use_global_control.test12
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-use_global_long_query_time-master.opt1
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-use_global_long_query_time.result46
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-use_global_long_query_time.test40
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-control_global_slow.result12
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-control_global_slow.test14
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.result9
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.test15
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-long_query_time.result21
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-long_query_time.test18
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.result12
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.test21
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time-master.opt1
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.result59
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.test43
-rw-r--r--mysql-test/suite/percona/percona_sql_no_fcache.test2
-rw-r--r--mysql-test/suite/percona/percona_status_wait_query_cache_mutex.result10
-rw-r--r--mysql-test/suite/percona/percona_status_wait_query_cache_mutex.test4
-rw-r--r--mysql-test/suite/percona/percona_suppress_log_warning_1592.result28
-rw-r--r--mysql-test/suite/percona/percona_xtradb_bug317074.result1
-rw-r--r--mysql-test/suite/percona/percona_xtradb_bug317074.test4
-rw-r--r--mysql-test/suite/percona/userstat_bug602047.result15
-rw-r--r--mysql-test/suite/percona/userstat_bug602047.test12
108 files changed, 2214 insertions, 1515 deletions
diff --git a/mysql-test/suite/percona/disabled.def b/mysql-test/suite/percona/disabled.def
index a99b952a5eb..c20f5f3860d 100644
--- a/mysql-test/suite/percona/disabled.def
+++ b/mysql-test/suite/percona/disabled.def
@@ -16,7 +16,23 @@ percona_status_wait_query_cache_mutex: Feature not merged into MariaDB
percona_slave_innodb_stats: Feature not merged into MariaDB
percona_query_response_time-replication: Feature not merged into MariaDB
percona_server_variables: Feature not merged into MariaDB
-
percona_slow_query_log-log_slow_verbosity: InnoDB filtering information not fully merged into MariaDB
-
percona_innodb_buffer_pool_shm: Requires big shmmax not default on many systems
+percona_log_warnings_suppress: Feature not merged into MariaDB
+percona_slow_extended-log_slow_sp_statements-cl: Feature not merged into MariaDB
+percona_slow_extended-log_slow_verbosity-cl: Feature not merged into MariaDB
+slow_query_log_use_global_control: Feature not merged into MariaDB
+percona_slow_extended-use_global_control: Feature not merged into MariaDB
+percona_slow_query_log-log_slow_verbosity: Feature not merged into MariaDB
+percona_slow_extended-log_slow_verbosity: Feature not merged into MariaDB
+percona_slow_extended-microseconds_in_slow_extended: Feature not merged into MariaDB
+percona_slow_extended-use_global_long_query_time: Feature not merged into MariaDB
+percona_slow_extended-slow_query_log_timestamp_always-cl: Feature not merged into MariaDB
+percona_slow_extended-slow_query_log_microseconds_timestamp-cl: Feature not merged into MariaDB
+percona_bug643149: Feature not merged into MariaDB
+percona_processlist_row_stats: Feature not merged into MariaDB
+percona_server_variables_debug: Feature not merged into MariaDB
+percona_slow_extended-slave_statements: Feature not merged into MariaDB
+percona_show_slave_status_nolock: Feature not merged into MariaDB
+percona_slow_extended-slave_innodb_stats: Feature not merged into MariaDB
+percona_slow_extended-slave_statements-and-use_global_long_query_time: Feature not merged into MariaDB
diff --git a/mysql-test/suite/percona/grep.inc b/mysql-test/suite/percona/grep.inc
new file mode 100644
index 00000000000..c9c823fa695
--- /dev/null
+++ b/mysql-test/suite/percona/grep.inc
@@ -0,0 +1,16 @@
+perl;
+
+ $file = $ENV{'grep_file'};
+ $pattern = $ENV{'grep_pattern'};
+
+ open(FILE, "$file")
+ or die("Cannot open file $file: $!\n");
+
+ $lines = 0;
+ while(<FILE>) {
+ $lines++ if (/$pattern/);
+ }
+ print "$lines\n";
+
+ close(FILE);
+EOF
diff --git a/mysql-test/suite/percona/have_response_time_distribution.inc b/mysql-test/suite/percona/have_response_time_distribution.inc
new file mode 100644
index 00000000000..45650133b31
--- /dev/null
+++ b/mysql-test/suite/percona/have_response_time_distribution.inc
@@ -0,0 +1,4 @@
+if (`SELECT @@have_response_time_distribution != 'YES'`)
+{
+ --skip No response time distribution
+}
diff --git a/mysql-test/suite/percona/percona_bug643149.result b/mysql-test/suite/percona/percona_bug643149.result
new file mode 100644
index 00000000000..1a447a194e7
--- /dev/null
+++ b/mysql-test/suite/percona/percona_bug643149.result
@@ -0,0 +1,21 @@
+SET @old_slow_query_log_file=@@global.slow_query_log_file;
+SET GLOBAL slow_query_log=on;
+SET LOCAL log_slow_verbosity='profiling';
+SET LOCAL long_query_time=0;
+SET GLOBAL slow_query_log_file='MYSQLTEST_VARDIR/percona_bug643149_slow.log';;
+SELECT 1;
+1
+1
+# User@Host: root[root] @ localhost []
+# Thread_id: X Schema: test Last_errno: X Killed: X
+# Query_time: X.X Lock_time: X.X Rows_sent: X Rows_examined: X Rows_affected: X Rows_read: X
+# Bytes_sent: X Tmp_tables: X Tmp_disk_tables: X Tmp_table_sizes: X
+# Profile_starting: X.X Profile_starting_cpu: X.X Profile_Opening_tables: X.X Profile_Opening_tables_cpu: X.X Profile_query_end: X.X Profile_query_end_cpu: X.X Profile_closing_tables: X.X Profile_closing_tables_cpu: X.X Profile_freeing_items: X.X Profile_freeing_items_cpu: X.X Profile_logging_slow_query: X.X Profile_logging_slow_query_cpu: X.X
+# Profile_total: X.X Profile_total_cpu: X.X
+# User@Host: root[root] @ localhost []
+# Thread_id: X Schema: test Last_errno: X Killed: X
+# Query_time: X.X Lock_time: X.X Rows_sent: X Rows_examined: X Rows_affected: X Rows_read: X
+# Bytes_sent: X Tmp_tables: X Tmp_disk_tables: X Tmp_table_sizes: X
+# Profile_starting: X.X Profile_starting_cpu: X.X Profile_checking_permissions: X.X Profile_checking_permissions_cpu: X.X Profile_Opening_tables: X.X Profile_Opening_tables_cpu: X.X Profile_init: X.X Profile_init_cpu: X.X Profile_optimizing: X.X Profile_optimizing_cpu: X.X Profile_executing: X.X Profile_executing_cpu: X.X Profile_end: X.X Profile_end_cpu: X.X Profile_query_end: X.X Profile_query_end_cpu: X.X Profile_closing_tables: X.X Profile_closing_tables_cpu: X.X Profile_freeing_items: X.X Profile_freeing_items_cpu: X.X Profile_logging_slow_query: X.X Profile_logging_slow_query_cpu: X.X
+# Profile_total: X.X Profile_total_cpu: X.X
+SET GLOBAL slow_query_log_file=@old_slow_query_log_file;
diff --git a/mysql-test/suite/percona/percona_bug643149.test b/mysql-test/suite/percona/percona_bug643149.test
new file mode 100644
index 00000000000..fa31b169a19
--- /dev/null
+++ b/mysql-test/suite/percona/percona_bug643149.test
@@ -0,0 +1,49 @@
+#
+# This test suffers from server
+# Bug#38124 "general_log_file" variable silently unset when using expression
+# In short:
+# SET GLOBAL general_log_file = @<whatever>
+# SET GLOBAL slow_query_log = @<whatever>
+# cause that the value of these server system variables is set to default
+# instead of the assigned values. There comes no error message or warning.
+# If this bug is fixed please
+# 1. try this test with "let $fixed_bug38124 = 0;"
+# 2. remove all workarounds if 1. was successful.
+--source include/have_profiling.inc
+let $fixed_bug38124 = 0;
+
+SET @old_slow_query_log_file=@@global.slow_query_log_file;
+SET GLOBAL slow_query_log=on;
+SET LOCAL log_slow_verbosity='profiling';
+SET LOCAL long_query_time=0;
+
+let slogfile=$MYSQLTEST_VARDIR/percona_bug643149_slow.log;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SET GLOBAL slow_query_log_file='$slogfile';
+
+SELECT 1;
+
+perl;
+ $slogfile= $ENV{'slogfile'};
+
+ open(FILE, "$slogfile") or
+ die("Unable to read slow query log file $slogfile: $!\n");
+ while(<FILE>) {
+ next if (!/^#/);
+ next if (/^# Time:/);
+ s/[0-9]+/X/g;
+ print;
+ }
+
+ close(FILE);
+EOF
+
+SET GLOBAL slow_query_log_file=@old_slow_query_log_file;
+
+if(!$fixed_bug38124)
+{
+ --disable_query_log
+ let $my_var = `SELECT @old_slow_query_log_file`;
+ eval SET @@global.slow_query_log_file = '$my_var';
+ --enable_query_log
+}
diff --git a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.result b/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.result
index 08ece8fb9a9..e5373606099 100644
--- a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.result
+++ b/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.result
@@ -1,6 +1,4 @@
show variables like 'innodb_buffer_pool_shm%';
Variable_name Value
-innodb_buffer_pool_shm_key 123456
-show variables like 'innodb_buffer_pool_shm%';
-Variable_name Value
+innodb_buffer_pool_shm_checksum ON
innodb_buffer_pool_shm_key 123456
diff --git a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.test b/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.test
index 7b81bb8d54b..7b26c217893 100644
--- a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.test
+++ b/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.test
@@ -1,18 +1,2 @@
---source include/have_innodb.inc
+--source include/have_xtradb.inc
show variables like 'innodb_buffer_pool_shm%';
-
-#clean shutdown (restart_mysqld.inc is not clean if over 10 sec...)
---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait
-EOF
-shutdown_server 120;
---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart
-EOF
---enable_reconnect
---source include/wait_until_connected_again.inc
---disable_reconnect
-
-show variables like 'innodb_buffer_pool_shm%';
---sleep 1
---system ipcrm -M 123456
diff --git a/mysql-test/suite/percona/percona_innodb_deadlock_count.result b/mysql-test/suite/percona/percona_innodb_deadlock_count.result
index 4ad6fd433fe..00902e87feb 100644
--- a/mysql-test/suite/percona/percona_innodb_deadlock_count.result
+++ b/mysql-test/suite/percona/percona_innodb_deadlock_count.result
@@ -11,18 +11,18 @@ insert into t values(1,2);
# Switch to connection con1
BEGIN;
SELECT b FROM t WHERE a=1 FOR UPDATE;
-b
-2
# Switch to connection con2
BEGIN;
SELECT b FROM t WHERE a=2 FOR UPDATE;
-b
-1
# Switch to connection con1
SELECT b FROM t WHERE a=2 FOR UPDATE;
# Switch to connection con2
SELECT b FROM t WHERE a=1 FOR UPDATE;
+# Switch to connection con1
+ROLLBACK;
+# Switch to connection con2
+ROLLBACK;
# Switch to connection con3
-1
+Deadlocks: 1
# Drop test table
drop table t;
diff --git a/mysql-test/suite/percona/percona_innodb_deadlock_count.test b/mysql-test/suite/percona/percona_innodb_deadlock_count.test
index 7a7f0e5ddb7..f953b9d7822 100644
--- a/mysql-test/suite/percona/percona_innodb_deadlock_count.test
+++ b/mysql-test/suite/percona/percona_innodb_deadlock_count.test
@@ -9,7 +9,6 @@ connect (con3,localhost,root,,);
--disable_warnings
drop table if exists t;
--enable_warnings
-disable_abort_on_error;
--echo # Create test table
create table t(a INT PRIMARY KEY, b INT) engine=InnoDB;
@@ -20,12 +19,12 @@ insert into t values(1,2);
#--echo # Save current deadlock count
let $current = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`;
+--disable_result_log
+
--echo # Switch to connection con1
connection con1;
BEGIN; SELECT b FROM t WHERE a=1 FOR UPDATE;
-#show engine innodb status;
-
--echo # Switch to connection con2
connection con2;
BEGIN; SELECT b FROM t WHERE a=2 FOR UPDATE;
@@ -38,12 +37,25 @@ SEND SELECT b FROM t WHERE a=2 FOR UPDATE;
connection con2;
SEND SELECT b FROM t WHERE a=1 FOR UPDATE;
-SLEEP 0.2;
+--echo # Switch to connection con1
+connection con1;
+--error 0, ER_LOCK_DEADLOCK
+reap;
+ROLLBACK;
+
+--echo # Switch to connection con2
+connection con2;
+--error 0, ER_LOCK_DEADLOCK
+reap;
+ROLLBACK;
+
--echo # Switch to connection con3
connection con3;
let $result = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`;
+--enable_result_log
+
let $diff = `SELECT $result - $current`;
-echo $diff;
+echo Deadlocks: $diff;
--echo # Drop test table
drop table t;
diff --git a/mysql-test/suite/percona/percona_log_connection_error-master.opt b/mysql-test/suite/percona/percona_log_connection_error-master.opt
index 32a891789f3..4658d62af60 100644
--- a/mysql-test/suite/percona/percona_log_connection_error-master.opt
+++ b/mysql-test/suite/percona/percona_log_connection_error-master.opt
@@ -1 +1 @@
---log-error \ No newline at end of file
+--log-error
diff --git a/mysql-test/suite/percona/percona_log_connection_error.test b/mysql-test/suite/percona/percona_log_connection_error.test
index 57cd652bd24..677da047354 100644
--- a/mysql-test/suite/percona/percona_log_connection_error.test
+++ b/mysql-test/suite/percona/percona_log_connection_error.test
@@ -48,5 +48,7 @@ if(!`select LENGTH('$log_error_')`)
# Assign env variable LOG_ERROR
let LOG_ERROR=$log_error_;
-let cmd=cat $log_error | grep "Too many connections" | wc -l;
+--let grep_file = $log_error
+--let grep_pattern = Too many connections
+--source grep.inc
exec $cmd;
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.test b/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.test
deleted file mode 100644
index 8d4bb1e091c..00000000000
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.test
+++ /dev/null
@@ -1,141 +0,0 @@
--- source include/not_windows.inc
-
--- echo # Activate master-slave replication
--- source include/master-slave.inc
-
-connection master;
--- echo # Make table t for test
--- disable_warnings
-DROP TABLE IF EXISTS t;
--- enable_warnings
-CREATE TABLE t(id INT);
-
-
--- echo # Start slave replication
--- disable_warnings
-connection slave;
-START SLAVE;
--- source include/wait_for_slave_to_start.inc
--- enable_warnings
-
-#-- echo # Make insert(1) on master
-connection master;
-INSERT INTO t VALUES (1);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync(1) slave thread
-connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-
--- echo # Read and change log_slow_slave_statements to ON on slave
-show variables like 'log_slow_slave_statements';
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-
-#-- echo # Make insert(2) on master
-connection master;
-INSERT INTO t VALUES (2);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(2) thread
-connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
--- echo # Restart slave
-STOP SLAVE;
--- source include/wait_for_slave_to_stop.inc
-START SLAVE;
--- source include/wait_for_slave_to_start.inc
-
-#-- echo # Make insert(3) on master
-connection master;
-INSERT INTO t VALUES (3);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync(3) slave thread
-connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-show variables like 'long_query_time';
-show global variables like 'long_query_time';
-show global variables like 'use_global_long_query_time';
-set global long_query_time=0;
-show variables like 'long_query_time';
-show global variables like 'long_query_time';
-show global variables like 'use_global_long_query_time';
-
-#-- echo # Make insert(4) on master
-connection master;
-INSERT INTO t VALUES (4);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(4) thread
-connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-show variables like 'long_query_time';
-show global variables like 'long_query_time';
-show global variables like 'use_global_long_query_time';
-set global use_global_long_query_time=1;
-show variables like 'long_query_time';
-show global variables like 'long_query_time';
-show global variables like 'use_global_long_query_time';
-
-#-- echo # Make insert(5) on master
-connection master;
-let $MASTER_DATADIR= `select @@datadir`;
-INSERT INTO t VALUES (5);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(5) thread
-connection slave;
-let $SLAVE_DATADIR= `select @@datadir`;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-show variables like 'long_query_time';
-show global variables like 'long_query_time';
-show global variables like 'use_global_long_query_time';
-set global long_query_time=1;
-set global use_global_long_query_time=0;
-
--- echo # Analyse master slow_query_log
-let $i=5;
-let $k=1;
-let $cmd=cat ./$MASTER_DATADIR/percona_log_slow_slave_statements-master.log | grep;
-while($i)
-{
- let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
- exec $current_cmd;
- dec $i;
- inc $k;
-}
-
--- echo # Analyse slave slow_query_log
-let $i=5;
-let $k=1;
-let $cmd=cat $SLAVE_DATADIR/percona_log_slow_slave_statements-slave.log | grep;
-while($i)
-{
- let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
- exec $current_cmd;
- dec $i;
- inc $k;
-}
-set global log_slow_slave_statements=OFF;
-
-connection master;
-DROP TABLE t;
-
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(6) thread
-connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements.result b/mysql-test/suite/percona/percona_log_slow_slave_statements.result
deleted file mode 100644
index e3bf3e92c94..00000000000
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements.result
+++ /dev/null
@@ -1,86 +0,0 @@
-# Activate master-slave replication
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-# Make table t for test
-DROP TABLE IF EXISTS t;
-CREATE TABLE t(id INT);
-# Start slave replication
-START SLAVE;
-INSERT INTO t VALUES (1);
-# Read information about master binlog
-# Sync(1) slave thread
-# Read and change log_slow_slave_statements to ON on slave
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements OFF
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements ON
-INSERT INTO t VALUES (2);
-# Read information about master binlog
-# Sync slave(2) thread
-# Restart slave
-STOP SLAVE;
-START SLAVE;
-INSERT INTO t VALUES (3);
-# Read information about master binlog
-# Sync(3) slave thread
-# Read and change log_slow_slave_statements to OFF on slave
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements ON
-set global log_slow_slave_statements=OFF;
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements OFF
-INSERT INTO t VALUES (4);
-# Read information about master binlog
-# Sync slave(4) thread
-# Restart slave
-STOP SLAVE;
-START SLAVE;
-INSERT INTO t VALUES (5);
-# Read information about master binlog
-# Sync slave(5) thread
-# Read and change log_slow_slave_statements to ON on slave
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements OFF
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements ON
-INSERT INTO t VALUES (6);
-# Read information about master binlog
-# Sync slave(6) thread
-# Restart slave
-STOP SLAVE;
-START SLAVE;
-INSERT INTO t VALUES (7);
-# Read information about master binlog
-# Sync slave(7) thread
-# Analyse master slow_query_log
-1
-1
-1
-1
-1
-1
-1
-# Analyse slave slow_query_log
-0
-0
-1
-0
-0
-0
-1
-set global log_slow_slave_statements=OFF;
-DROP TABLE t;
-# Read information about master binlog
-# Sync slave(8) thread
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements.test b/mysql-test/suite/percona/percona_log_slow_slave_statements.test
deleted file mode 100644
index 8c9c594e41c..00000000000
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements.test
+++ /dev/null
@@ -1,162 +0,0 @@
--- source include/not_windows.inc
-
--- echo # Activate master-slave replication
--- source include/master-slave.inc
-
-connection master;
--- echo # Make table t for test
--- disable_warnings
-DROP TABLE IF EXISTS t;
--- enable_warnings
-CREATE TABLE t(id INT);
-
-
--- echo # Start slave replication
--- disable_warnings
-connection slave;
-START SLAVE;
--- source include/wait_for_slave_to_start.inc
--- enable_warnings
-
-#-- echo # Make insert(1) on master
-connection master;
-INSERT INTO t VALUES (1);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync(1) slave thread
-connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-
--- echo # Read and change log_slow_slave_statements to ON on slave
-show variables like 'log_slow_slave_statements';
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-
-#-- echo # Make insert(2) on master
-connection master;
-INSERT INTO t VALUES (2);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(2) thread
-connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
--- echo # Restart slave
-STOP SLAVE;
--- source include/wait_for_slave_to_stop.inc
-START SLAVE;
--- source include/wait_for_slave_to_start.inc
-
-#-- echo # Make insert(3) on master
-connection master;
-INSERT INTO t VALUES (3);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync(3) slave thread
-connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
--- echo # Read and change log_slow_slave_statements to OFF on slave
-show variables like 'log_slow_slave_statements';
-set global log_slow_slave_statements=OFF;
-show variables like 'log_slow_slave_statements';
-
-#-- echo # Make insert(4) on master
-connection master;
-INSERT INTO t VALUES (4);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(4) thread
-connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
--- echo # Restart slave
-STOP SLAVE;
--- source include/wait_for_slave_to_stop.inc
-START SLAVE;
--- source include/wait_for_slave_to_start.inc
-
-#-- echo # Make insert(5) on master
-connection master;
-INSERT INTO t VALUES (5);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(5) thread
-connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
--- echo # Read and change log_slow_slave_statements to ON on slave
-show variables like 'log_slow_slave_statements';
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-
-#-- echo # Make insert(6) on master
-connection master;
-INSERT INTO t VALUES (6);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(6) thread
-connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
--- echo # Restart slave
-STOP SLAVE;
--- source include/wait_for_slave_to_stop.inc
-START SLAVE;
--- source include/wait_for_slave_to_start.inc
-
-#-- echo # Make insert(7) on master
-connection master;
-let $MASTER_DATADIR= `select @@datadir`;
-INSERT INTO t VALUES (7);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(7) thread
-connection slave;
-let $SLAVE_DATADIR= `select @@datadir`;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-
--- echo # Analyse master slow_query_log
-let $i=7;
-let $k=1;
-let $cmd=cat $MASTER_DATADIR/percona_log_slow_slave_statements-master.log | grep -c;
-while($i)
-{
- let $current_cmd = $cmd "INSERT INTO t VALUES ($k)";
- exec $current_cmd;
- dec $i;
- inc $k;
-}
-
--- echo # Analyse slave slow_query_log
-let $i=7;
-let $k=1;
-let $cmd=cat $SLAVE_DATADIR/percona_log_slow_slave_statements-slave.log | grep -c;
-while($i)
-{
- let $current_cmd = $cmd "INSERT INTO t VALUES ($k)";
- exec $current_cmd;
- dec $i;
- inc $k;
-}
-set global log_slow_slave_statements=OFF;
-
-connection master;
-DROP TABLE t;
-
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(8) thread
-connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
diff --git a/mysql-test/suite/percona/percona_suppress_log_warning_1592-master.opt b/mysql-test/suite/percona/percona_log_warnings_suppress-master.opt
index 4658d62af60..4658d62af60 100644
--- a/mysql-test/suite/percona/percona_suppress_log_warning_1592-master.opt
+++ b/mysql-test/suite/percona/percona_log_warnings_suppress-master.opt
diff --git a/mysql-test/suite/percona/percona_log_warnings_suppress.result b/mysql-test/suite/percona/percona_log_warnings_suppress.result
new file mode 100644
index 00000000000..1ee6c46738a
--- /dev/null
+++ b/mysql-test/suite/percona/percona_log_warnings_suppress.result
@@ -0,0 +1,31 @@
+SET @old_log_warnings = @@log_warnings;
+SET @old_log_warnings_suppress = @@log_warnings_suppress;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(20));
+SET GLOBAL log_warnings_suppress='';
+SET GLOBAL LOG_WARNINGS=0;
+SHOW GLOBAL VARIABLES LIKE 'log_warnings_suppress';
+Variable_name Value
+log_warnings_suppress
+INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
+SET GLOBAL LOG_WARNINGS=1;
+INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
+SET GLOBAL log_warnings_suppress='1592';
+SET GLOBAL LOG_WARNINGS=0;
+INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
+SET GLOBAL LOG_WARNINGS=1;
+INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
+DROP TABLE t1;
+SET GLOBAL log_warnings = @old_log_warnings;
+SET GLOBAL log_warnings_suppress = @old_log_warnings_suppress;
+# Count the number of times the "Unsafe" message was printed
+# to the error log.
+Occurrences: 1
diff --git a/mysql-test/suite/percona/percona_suppress_log_warning_1592.test b/mysql-test/suite/percona/percona_log_warnings_suppress.test
index 97fe40469fc..82221013f0b 100644
--- a/mysql-test/suite/percona/percona_suppress_log_warning_1592.test
+++ b/mysql-test/suite/percona/percona_log_warnings_suppress.test
@@ -2,26 +2,27 @@
-- source include/have_binlog_format_statement.inc
SET @old_log_warnings = @@log_warnings;
-SET @old_suppress_log_warning_1592 = @@suppress_log_warning_1592;
+SET @old_log_warnings_suppress = @@log_warnings_suppress;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(20));
-SET GLOBAL SUPPRESS_LOG_WARNING_1592 = 0;
-SET GLOBAL LOG_WARNINGS = 0;
+SET GLOBAL log_warnings_suppress='';
+SET GLOBAL LOG_WARNINGS=0;
+SHOW GLOBAL VARIABLES LIKE 'log_warnings_suppress';
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-SET GLOBAL LOG_WARNINGS = 1;
+SET GLOBAL LOG_WARNINGS=1;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-SET GLOBAL SUPPRESS_LOG_WARNING_1592 = 1;
-SET GLOBAL LOG_WARNINGS = 0;
+SET GLOBAL log_warnings_suppress='1592';
+SET GLOBAL LOG_WARNINGS=0;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-SET GLOBAL LOG_WARNINGS = 1;
+SET GLOBAL LOG_WARNINGS=1;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
DROP TABLE t1;
SET GLOBAL log_warnings = @old_log_warnings;
-SET GLOBAL suppress_log_warning_1592 = @old_suppress_log_warning_1592;
+SET GLOBAL log_warnings_suppress = @old_log_warnings_suppress;
let $log_error_= `SELECT @@GLOBAL.log_error`;
if(!`select LENGTH('$log_error_')`)
diff --git a/mysql-test/suite/percona/percona_processlist_row_stats.result b/mysql-test/suite/percona/percona_processlist_row_stats.result
new file mode 100644
index 00000000000..e9b07b2eaea
--- /dev/null
+++ b/mysql-test/suite/percona/percona_processlist_row_stats.result
@@ -0,0 +1,74 @@
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES(10);
+INSERT INTO t2 VALUES(10);
+INSERT INTO t2 VALUES(20);
+INSERT INTO t2 VALUES(10);
+INSERT INTO t2 VALUES(20);
+Issuing operation that should not return any rows and stopping the thread #1
+SET DEBUG_SYNC= 'locked_table_name SIGNAL thread1_ready WAIT_FOR threads_dumped';
+CREATE TABLE t1 (a INT);
+SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
+Thread #1 stopped
+Issuing row-returning query and stopping the thread #2 at the end of query
+SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
+SELECT a FROM t2 WHERE a > 15;
+SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
+Thread #2 stopped
+Look at thread states
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info Rows_sent Rows_examined Rows_read
+### root ### test Query ### ### SHOW PROCESSLIST 0 0 2
+### root ### test Query ### ### CREATE TABLE t1 (a INT) 0 0 1
+### root ### test Query ### ### SELECT a FROM t2 WHERE a > 15 2 5 6
+SELECT id, info, rows_sent, rows_examined, rows_read FROM information_schema.processlist
+ORDER BY id;
+id info rows_sent rows_examined rows_read
+### SELECT id, info, rows_sent, rows_examined, rows_read FROM information_schema.processlist
+ORDER BY id 0 0 1
+### CREATE TABLE t1 (a INT) 0 0 1
+### SELECT a FROM t2 WHERE a > 15 2 5 6
+Let threads #1 and #2 finish their job
+SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
+a
+20
+20
+Issuing row-returning query and stopping the thread #2 in the middle of query
+SET DEBUG_SYNC= 'sent_row SIGNAL thread2_ready WAIT_FOR threads_dumped';
+SELECT a FROM t2 WHERE a > 15;
+SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
+Thread #2 stopped, look at its state
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info Rows_sent Rows_examined Rows_read
+### root ### test Query ### ### SHOW PROCESSLIST 0 0 4
+### root ### test Sleep ### ### NULL 0 0 1
+### root ### test Query ### ### SELECT a FROM t2 WHERE a > 15 1 0 3
+SELECT id,rows_sent,rows_examined,rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY Id;
+id rows_sent rows_examined rows_read
+### 0 0 1
+### 0 0 1
+### 1 0 3
+SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
+Let thread #2 finish its job
+a
+20
+20
+Issuing an UPDATE and stopping thread #2
+SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
+UPDATE t2 SET a = 15 WHERE a = 10;
+SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
+Thread #2 stopped, look at its state
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info Rows_sent Rows_examined Rows_read
+### root ### test Query ### ### SHOW PROCESSLIST 0 0 4
+### root ### test Sleep ### ### NULL 0 0 1
+### root ### test Query ### ### UPDATE t2 SET a = 15 WHERE a = 10 0 5 6
+SELECT id,rows_sent,rows_examined,rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY Id;
+id rows_sent rows_examined rows_read
+### 0 0 1
+### 0 0 1
+### 0 5 6
+SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
+Let thread #2 finish its job
+DROP TABLES t1, t2;
diff --git a/mysql-test/suite/percona/percona_processlist_row_stats.test b/mysql-test/suite/percona/percona_processlist_row_stats.test
new file mode 100644
index 00000000000..230a9f4c311
--- /dev/null
+++ b/mysql-test/suite/percona/percona_processlist_row_stats.test
@@ -0,0 +1,92 @@
+# Testing of INFORMATION_SCHEMA.PROCESSLIST fields ROWS_SENT, ROWS_EXAMINED, ROWS_READ
+--source include/have_debug_sync.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES(10);
+INSERT INTO t2 VALUES(10);
+INSERT INTO t2 VALUES(20);
+INSERT INTO t2 VALUES(10);
+INSERT INTO t2 VALUES(20);
+
+connect (conn1, localhost, root, ,);
+connect (conn2, localhost, root, ,);
+
+--connection conn1
+echo Issuing operation that should not return any rows and stopping the thread #1;
+SET DEBUG_SYNC= 'locked_table_name SIGNAL thread1_ready WAIT_FOR threads_dumped';
+send CREATE TABLE t1 (a INT);
+
+--connection default
+SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
+--echo Thread #1 stopped
+
+--connection conn2
+echo Issuing row-returning query and stopping the thread #2 at the end of query;
+SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
+send SELECT a FROM t2 WHERE a > 15;
+
+--connection default
+SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
+--echo Thread #2 stopped
+--echo Look at thread states
+
+--replace_column 1 ### 3 ### 6 ### 7 ###
+SHOW PROCESSLIST;
+# The running threads are different between SHOW above and SELECT below. Thus select info too to
+# show the difference. Results are in the same order as in SHOW.
+--replace_column 1 ###
+SELECT id, info, rows_sent, rows_examined, rows_read FROM information_schema.processlist
+ORDER BY id;
+
+echo Let threads #1 and #2 finish their job;
+SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
+
+--connection conn1
+reap;
+
+--connection conn2
+reap;
+echo Issuing row-returning query and stopping the thread #2 in the middle of query;
+SET DEBUG_SYNC= 'sent_row SIGNAL thread2_ready WAIT_FOR threads_dumped';
+send SELECT a FROM t2 WHERE a > 15;
+
+--connection default
+SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
+echo Thread #2 stopped, look at its state;
+
+--replace_column 1 ### 3 ### 6 ### 7 ###
+SHOW PROCESSLIST;
+--replace_column 1 ###
+SELECT id,rows_sent,rows_examined,rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY Id;
+SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
+echo Let thread #2 finish its job;
+
+--connection conn2
+reap;
+echo Issuing an UPDATE and stopping thread #2;
+SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
+send UPDATE t2 SET a = 15 WHERE a = 10;
+
+--connection default
+SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
+echo Thread #2 stopped, look at its state;
+
+--replace_column 1 ### 3 ### 6 ### 7 ###
+SHOW PROCESSLIST;
+--replace_column 1 ###
+SELECT id,rows_sent,rows_examined,rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY Id;
+SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
+echo Let thread #2 finish its job;
+
+--connection conn2
+reap;
+
+--connection default
+disconnect conn1;
+disconnect conn2;
+DROP TABLES t1, t2;
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments.inc b/mysql-test/suite/percona/percona_query_cache_with_comments.inc
new file mode 100644
index 00000000000..d55e52d5b64
--- /dev/null
+++ b/mysql-test/suite/percona/percona_query_cache_with_comments.inc
@@ -0,0 +1,95 @@
+--source percona_query_cache_with_comments_clear.inc
+let $query=/* with comment first */select * from t1;
+eval $query;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=# with comment first
+select * from t1;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=-- with comment first
+select * from t1;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=/* with comment first and "quote" */select * from t1;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=# with comment first and "quote"
+select * from t1;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=-- with comment first and "quote"
+select * from t1;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=
+ /* with comment and whitespaces first */select * from t1;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=
+ # with comment and whitespaces first
+select * from t1;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=
+ -- with comment and whitespaces first
+select * from t1;
+--source percona_query_cache_with_comments_eval.inc
+
+let $internal=* internal comment *;
+
+let $query=select * /$internal/ from t1;
+--source percona_query_cache_with_comments_eval.inc
+let $query=select */$internal/ from t1;
+--source percona_query_cache_with_comments_eval.inc
+let $query=select */$internal/from t1;
+--source percona_query_cache_with_comments_eval.inc
+
+let $internal=* internal comment with "quote" *;
+
+let $query=select * /$internal/ from t1;
+--source percona_query_cache_with_comments_eval.inc
+let $query=select */$internal/ from t1;
+--source percona_query_cache_with_comments_eval.inc
+let $query=select */$internal/from t1;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1
+;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1 ;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1 ;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1
+/* comment in the end */;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1
+/* *\/ */;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1
+/* comment in the end */
+;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1 #comment in the end;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1 #comment in the end
+;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1 -- comment in the end;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1 -- comment in the end
+;
+--source percona_query_cache_with_comments_eval.inc
+
+let $query=select ' \' ' from t1;
+--source percona_query_cache_with_comments_eval.inc
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments.test b/mysql-test/suite/percona/percona_query_cache_with_comments.test
index 0190f54d104..0b93441f364 100644
--- a/mysql-test/suite/percona/percona_query_cache_with_comments.test
+++ b/mysql-test/suite/percona/percona_query_cache_with_comments.test
@@ -1,3 +1,4 @@
+--disable_ps_protocol
set global query_cache_strip_comments=ON;
-- source include/percona_query_cache_with_comments_begin.inc
-- source include/percona_query_cache_with_comments.inc
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments_begin.inc b/mysql-test/suite/percona/percona_query_cache_with_comments_begin.inc
new file mode 100644
index 00000000000..6bfd2bfbc83
--- /dev/null
+++ b/mysql-test/suite/percona/percona_query_cache_with_comments_begin.inc
@@ -0,0 +1,12 @@
+-- source include/have_query_cache.inc
+
+set GLOBAL query_cache_size=1355776;
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (a int not null);
+insert into t1 values (1),(2),(3);
+
+--source percona_query_cache_with_comments_clear.inc
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments_clear.inc b/mysql-test/suite/percona/percona_query_cache_with_comments_clear.inc
new file mode 100644
index 00000000000..728a19a3c97
--- /dev/null
+++ b/mysql-test/suite/percona/percona_query_cache_with_comments_clear.inc
@@ -0,0 +1,5 @@
+# Reset query cache variables.
+flush query cache; # This crashed in some versions
+flush query cache; # This crashed in some versions
+reset query cache;
+flush status;
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments_end.inc b/mysql-test/suite/percona/percona_query_cache_with_comments_end.inc
new file mode 100644
index 00000000000..d5356359d7e
--- /dev/null
+++ b/mysql-test/suite/percona/percona_query_cache_with_comments_end.inc
@@ -0,0 +1,3 @@
+DROP TABLE t1;
+SET GLOBAL query_cache_size=default;
+set global query_cache_strip_comments=OFF;
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments_eval.inc b/mysql-test/suite/percona/percona_query_cache_with_comments_eval.inc
new file mode 100644
index 00000000000..f0c200245e0
--- /dev/null
+++ b/mysql-test/suite/percona/percona_query_cache_with_comments_eval.inc
@@ -0,0 +1,7 @@
+echo -----------------------------------------------------;
+echo $query;
+echo -----------------------------------------------------;
+--source percona_query_cache_with_comments_show.inc
+eval $query;
+eval $query;
+--source percona_query_cache_with_comments_show.inc
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments_show.inc b/mysql-test/suite/percona/percona_query_cache_with_comments_show.inc
new file mode 100644
index 00000000000..71aa5211cfd
--- /dev/null
+++ b/mysql-test/suite/percona/percona_query_cache_with_comments_show.inc
@@ -0,0 +1,8 @@
+let $show=show status like "Qcache_queries_in_cache";
+eval $show;
+let $show=show status like "Qcache_inserts";
+eval $show;
+let $show=show status like "Qcache_hits";
+eval $show;
+
+
diff --git a/mysql-test/suite/percona/percona_query_response_time-replication.result b/mysql-test/suite/percona/percona_query_response_time-replication.result
index df5c73812df..fd06d07b4d8 100644
--- a/mysql-test/suite/percona/percona_query_response_time-replication.result
+++ b/mysql-test/suite/percona/percona_query_response_time-replication.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t;
CREATE TABLE t(id INT);
SELECT * from t;
@@ -21,12 +17,16 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 10
FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=ON;
-INSERT INTO t VALUES(0);
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=ON;
+INSERT INTO t SELECT SLEEP(0.4);
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
0
-INSERT INTO t VALUES(1);
+INSERT INTO t SELECT SLEEP(0.4);
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
0
@@ -41,11 +41,15 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 2
FLUSH QUERY_RESPONSE_TIME;
-INSERT INTO t VALUES(0);
+INSERT INTO t SELECT SLEEP(0.4);
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
0
-INSERT INTO t VALUES(1);
+INSERT INTO t SELECT SLEEP(0.4);
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
0
@@ -57,4 +61,6 @@ SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
3
DROP TABLE IF EXISTS t;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=OFF;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=OFF;
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/percona_query_response_time-replication.test b/mysql-test/suite/percona/percona_query_response_time-replication.test
index 4f674c2fd19..199ecce0977 100644
--- a/mysql-test/suite/percona/percona_query_response_time-replication.test
+++ b/mysql-test/suite/percona/percona_query_response_time-replication.test
@@ -1,4 +1,10 @@
+--source include/have_response_time_distribution.inc
--source include/master-slave.inc
+--source include/have_binlog_format_statement.inc
+--source include/have_debug.inc
+--disable_query_log
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement:");
+--enable_query_log
connection master;
-- disable_warnings
@@ -16,12 +22,12 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=ON;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=ON;
connection master;
-INSERT INTO t VALUES(0);
+INSERT INTO t SELECT SLEEP(0.4);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-INSERT INTO t VALUES(1);
+INSERT INTO t SELECT SLEEP(0.4);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
sync_slave_with_master;
@@ -34,9 +40,9 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
connection master;
-INSERT INTO t VALUES(0);
+INSERT INTO t SELECT SLEEP(0.4);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-INSERT INTO t VALUES(1);
+INSERT INTO t SELECT SLEEP(0.4);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
sync_slave_with_master;
@@ -49,4 +55,7 @@ DROP TABLE IF EXISTS t;
sync_slave_with_master;
connection slave;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=OFF;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=OFF;
+
+STOP SLAVE;
+-- source include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/percona_query_response_time-stored.result b/mysql-test/suite/percona/percona_query_response_time-stored.result
index df51f2bfd58..0168c4630be 100644
--- a/mysql-test/suite/percona/percona_query_response_time-stored.result
+++ b/mysql-test/suite/percona/percona_query_response_time-stored.result
@@ -1,15 +1,9 @@
+SET GLOBAL debug="d,query_exec_time_debug";
CREATE FUNCTION test_f()
RETURNS CHAR(30) DETERMINISTIC
BEGIN
-DECLARE first VARCHAR(5);
-DECLARE second VARCHAR(5);
-DECLARE result VARCHAR(20);
-SELECT SLEEP(1.11) INTO first;
-SET first= 'Hello';
-SET second=', ';
-SET result= CONCAT(first,second);
-SET result= CONCAT(result,'world!');
-RETURN result;
+SET SESSION debug="+d,query_exec_time_1.1";
+RETURN 'Hello, world!';
END/
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
Warnings:
@@ -78,7 +72,7 @@ time
4194304.00000
8388608.00000
TOO LONG
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
test_f()
Hello, world!
@@ -91,7 +85,7 @@ Hello, world!
SELECT test_f();
test_f()
Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
@@ -99,8 +93,7 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count
-1 5 4 2 44
-4 5 4 2 44
+4 4 4 1 44
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count
44
@@ -158,11 +151,11 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 10
FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
test_f()
Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
@@ -170,8 +163,7 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count
-1 2 1 2 14
-1 2 1 2 14
+1 1 1 1 14
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count
14
@@ -199,11 +191,11 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 7
FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
test_f()
Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
@@ -211,8 +203,7 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count
-1 2 1 2 17
-1 2 1 2 17
+1 1 1 1 17
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count
17
@@ -243,11 +234,11 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 156
FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
test_f()
Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
@@ -255,8 +246,7 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count
-1 2 1 2 7
-1 2 1 2 7
+1 1 1 1 7
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count
7
@@ -277,11 +267,11 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 1000
FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
test_f()
Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
@@ -289,8 +279,7 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count
-1 2 1 2 6
-1 2 1 2 6
+1 1 1 1 6
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count
6
@@ -311,6 +300,7 @@ Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 1000
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
DROP FUNCTION test_f;
+SET GLOBAL debug=default;
diff --git a/mysql-test/suite/percona/percona_query_response_time-stored.test b/mysql-test/suite/percona/percona_query_response_time-stored.test
index f761dd7d01c..e80fc3dd3c0 100644
--- a/mysql-test/suite/percona/percona_query_response_time-stored.test
+++ b/mysql-test/suite/percona/percona_query_response_time-stored.test
@@ -1,18 +1,14 @@
-source include/have_innodb.inc;
+--source include/have_response_time_distribution.inc
+--source include/have_debug.inc
+
+SET GLOBAL debug="d,query_exec_time_debug";
delimiter /;
CREATE FUNCTION test_f()
RETURNS CHAR(30) DETERMINISTIC
BEGIN
- DECLARE first VARCHAR(5);
- DECLARE second VARCHAR(5);
- DECLARE result VARCHAR(20);
- SELECT SLEEP(1.11) INTO first;
- SET first= 'Hello';
- SET second=', ';
- SET result= CONCAT(first,second);
- SET result= CONCAT(result,'world!');
- RETURN result;
+ SET SESSION debug="+d,query_exec_time_1.1";
+ RETURN 'Hello, world!';
END/
delimiter ;/
@@ -24,12 +20,12 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
source include/percona_query_response_time_show.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
SELECT test_f();
SELECT test_f();
SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
@@ -38,9 +34,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
@@ -49,9 +45,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
@@ -60,9 +56,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
@@ -71,9 +67,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
@@ -81,7 +77,9 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
-DROP FUNCTION test_f; \ No newline at end of file
+DROP FUNCTION test_f;
+
+SET GLOBAL debug=default;
diff --git a/mysql-test/suite/percona/percona_query_response_time.result b/mysql-test/suite/percona/percona_query_response_time.result
index 54657b6ca06..2243c155e39 100644
--- a/mysql-test/suite/percona/percona_query_response_time.result
+++ b/mysql-test/suite/percona/percona_query_response_time.result
@@ -1,3 +1,4 @@
+SET GLOBAL debug="d,query_exec_time_debug";
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
Warnings:
Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
@@ -65,65 +66,27 @@ time
4194304.00000
8388608.00000
TOO LONG
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
+SET SESSION debug="+d,query_exec_time_0.31";
+SET SESSION debug="+d,query_exec_time_0.32";
+SET SESSION debug="+d,query_exec_time_0.33";
+SET SESSION debug="+d,query_exec_time_0.34";
+SET SESSION debug="+d,query_exec_time_0.35";
+SET SESSION debug="+d,query_exec_time_0.36";
+SET SESSION debug="+d,query_exec_time_0.37";
+SET SESSION debug="+d,query_exec_time_0.38";
+SET SESSION debug="+d,query_exec_time_0.39";
+SET SESSION debug="+d,query_exec_time_0.4";
+SET SESSION debug="+d,query_exec_time_1.1";
+SET SESSION debug="+d,query_exec_time_1.2";
+SET SESSION debug="+d,query_exec_time_1.3";
+SET SESSION debug="+d,query_exec_time_1.5";
+SET SESSION debug="+d,query_exec_time_1.4";
+SET SESSION debug="+d,query_exec_time_0.5";
+SET SESSION debug="+d,query_exec_time_2.1";
+SET SESSION debug="+d,query_exec_time_2.3";
+SET SESSION debug="+d,query_exec_time_2.5";
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
@@ -131,11 +94,10 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count
-1 20 15 5 44
-10 20 15 5 44
-1 20 15 5 44
-5 20 15 5 44
-3 20 15 5 44
+10 19 15 4 44
+1 19 15 4 44
+5 19 15 4 44
+3 19 15 4 44
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count
44
@@ -193,65 +155,27 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 10
FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
+SET SESSION debug="+d,query_exec_time_0.31";
+SET SESSION debug="+d,query_exec_time_0.32";
+SET SESSION debug="+d,query_exec_time_0.33";
+SET SESSION debug="+d,query_exec_time_0.34";
+SET SESSION debug="+d,query_exec_time_0.35";
+SET SESSION debug="+d,query_exec_time_0.36";
+SET SESSION debug="+d,query_exec_time_0.37";
+SET SESSION debug="+d,query_exec_time_0.38";
+SET SESSION debug="+d,query_exec_time_0.39";
+SET SESSION debug="+d,query_exec_time_0.4";
+SET SESSION debug="+d,query_exec_time_1.1";
+SET SESSION debug="+d,query_exec_time_1.2";
+SET SESSION debug="+d,query_exec_time_1.3";
+SET SESSION debug="+d,query_exec_time_1.5";
+SET SESSION debug="+d,query_exec_time_1.4";
+SET SESSION debug="+d,query_exec_time_0.5";
+SET SESSION debug="+d,query_exec_time_2.1";
+SET SESSION debug="+d,query_exec_time_2.3";
+SET SESSION debug="+d,query_exec_time_2.5";
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
@@ -259,9 +183,8 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count
-1 20 17 3 14
-11 20 17 3 14
-8 20 17 3 14
+11 19 17 2 14
+8 19 17 2 14
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count
14
@@ -289,65 +212,27 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 7
FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
+SET SESSION debug="+d,query_exec_time_0.31";
+SET SESSION debug="+d,query_exec_time_0.32";
+SET SESSION debug="+d,query_exec_time_0.33";
+SET SESSION debug="+d,query_exec_time_0.34";
+SET SESSION debug="+d,query_exec_time_0.35";
+SET SESSION debug="+d,query_exec_time_0.36";
+SET SESSION debug="+d,query_exec_time_0.37";
+SET SESSION debug="+d,query_exec_time_0.38";
+SET SESSION debug="+d,query_exec_time_0.39";
+SET SESSION debug="+d,query_exec_time_0.4";
+SET SESSION debug="+d,query_exec_time_1.1";
+SET SESSION debug="+d,query_exec_time_1.2";
+SET SESSION debug="+d,query_exec_time_1.3";
+SET SESSION debug="+d,query_exec_time_1.5";
+SET SESSION debug="+d,query_exec_time_1.4";
+SET SESSION debug="+d,query_exec_time_0.5";
+SET SESSION debug="+d,query_exec_time_2.1";
+SET SESSION debug="+d,query_exec_time_2.3";
+SET SESSION debug="+d,query_exec_time_2.5";
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
@@ -355,9 +240,8 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count
-1 20 17 3 17
-11 20 17 3 17
-8 20 17 3 17
+11 19 17 2 17
+8 19 17 2 17
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count
17
@@ -388,65 +272,27 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 156
FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
+SET SESSION debug="+d,query_exec_time_0.31";
+SET SESSION debug="+d,query_exec_time_0.32";
+SET SESSION debug="+d,query_exec_time_0.33";
+SET SESSION debug="+d,query_exec_time_0.34";
+SET SESSION debug="+d,query_exec_time_0.35";
+SET SESSION debug="+d,query_exec_time_0.36";
+SET SESSION debug="+d,query_exec_time_0.37";
+SET SESSION debug="+d,query_exec_time_0.38";
+SET SESSION debug="+d,query_exec_time_0.39";
+SET SESSION debug="+d,query_exec_time_0.4";
+SET SESSION debug="+d,query_exec_time_1.1";
+SET SESSION debug="+d,query_exec_time_1.2";
+SET SESSION debug="+d,query_exec_time_1.3";
+SET SESSION debug="+d,query_exec_time_1.5";
+SET SESSION debug="+d,query_exec_time_1.4";
+SET SESSION debug="+d,query_exec_time_0.5";
+SET SESSION debug="+d,query_exec_time_2.1";
+SET SESSION debug="+d,query_exec_time_2.3";
+SET SESSION debug="+d,query_exec_time_2.5";
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
@@ -454,9 +300,8 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count
-1 20 17 3 7
-11 20 17 3 7
-8 20 17 3 7
+11 19 17 2 7
+8 19 17 2 7
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count
7
@@ -477,65 +322,27 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 1000
FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
+SET SESSION debug="+d,query_exec_time_0.31";
+SET SESSION debug="+d,query_exec_time_0.32";
+SET SESSION debug="+d,query_exec_time_0.33";
+SET SESSION debug="+d,query_exec_time_0.34";
+SET SESSION debug="+d,query_exec_time_0.35";
+SET SESSION debug="+d,query_exec_time_0.36";
+SET SESSION debug="+d,query_exec_time_0.37";
+SET SESSION debug="+d,query_exec_time_0.38";
+SET SESSION debug="+d,query_exec_time_0.39";
+SET SESSION debug="+d,query_exec_time_0.4";
+SET SESSION debug="+d,query_exec_time_1.1";
+SET SESSION debug="+d,query_exec_time_1.2";
+SET SESSION debug="+d,query_exec_time_1.3";
+SET SESSION debug="+d,query_exec_time_1.5";
+SET SESSION debug="+d,query_exec_time_1.4";
+SET SESSION debug="+d,query_exec_time_0.5";
+SET SESSION debug="+d,query_exec_time_2.1";
+SET SESSION debug="+d,query_exec_time_2.3";
+SET SESSION debug="+d,query_exec_time_2.5";
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
@@ -543,9 +350,8 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count
-1 20 17 3 6
-11 20 17 3 6
-8 20 17 3 6
+11 19 17 2 6
+8 19 17 2 6
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count
6
@@ -566,5 +372,6 @@ Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 1000
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
+SET GLOBAL debug=default;
diff --git a/mysql-test/suite/percona/percona_query_response_time.test b/mysql-test/suite/percona/percona_query_response_time.test
index a58cafc8d01..f2df156b13d 100644
--- a/mysql-test/suite/percona/percona_query_response_time.test
+++ b/mysql-test/suite/percona/percona_query_response_time.test
@@ -1,4 +1,8 @@
-source include/have_innodb.inc;
+--source include/have_response_time_distribution.inc
+--source include/have_debug.inc
+
+SET GLOBAL debug="d,query_exec_time_debug";
+
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
@@ -7,9 +11,9 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
source include/percona_query_response_time_show.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
@@ -18,9 +22,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
@@ -29,9 +33,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
@@ -40,9 +44,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
@@ -51,9 +55,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc;
@@ -61,5 +65,7 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
+
+SET GLOBAL debug=default;
diff --git a/mysql-test/suite/percona/percona_query_response_time_flush.inc b/mysql-test/suite/percona/percona_query_response_time_flush.inc
new file mode 100644
index 00000000000..44bb320fe13
--- /dev/null
+++ b/mysql-test/suite/percona/percona_query_response_time_flush.inc
@@ -0,0 +1 @@
+FLUSH QUERY_RESPONSE_TIME;
diff --git a/mysql-test/suite/percona/percona_query_response_time_show.inc b/mysql-test/suite/percona/percona_query_response_time_show.inc
new file mode 100644
index 00000000000..709abf9872e
--- /dev/null
+++ b/mysql-test/suite/percona/percona_query_response_time_show.inc
@@ -0,0 +1,8 @@
+SELECT d.count,
+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
diff --git a/mysql-test/suite/percona/percona_query_response_time_sleep.inc b/mysql-test/suite/percona/percona_query_response_time_sleep.inc
new file mode 100644
index 00000000000..d889fd9f98d
--- /dev/null
+++ b/mysql-test/suite/percona/percona_query_response_time_sleep.inc
@@ -0,0 +1,19 @@
+SET SESSION debug="+d,query_exec_time_0.31";
+SET SESSION debug="+d,query_exec_time_0.32";
+SET SESSION debug="+d,query_exec_time_0.33";
+SET SESSION debug="+d,query_exec_time_0.34";
+SET SESSION debug="+d,query_exec_time_0.35";
+SET SESSION debug="+d,query_exec_time_0.36";
+SET SESSION debug="+d,query_exec_time_0.37";
+SET SESSION debug="+d,query_exec_time_0.38";
+SET SESSION debug="+d,query_exec_time_0.39";
+SET SESSION debug="+d,query_exec_time_0.4";
+SET SESSION debug="+d,query_exec_time_1.1";
+SET SESSION debug="+d,query_exec_time_1.2";
+SET SESSION debug="+d,query_exec_time_1.3";
+SET SESSION debug="+d,query_exec_time_1.5";
+SET SESSION debug="+d,query_exec_time_1.4";
+SET SESSION debug="+d,query_exec_time_0.5";
+SET SESSION debug="+d,query_exec_time_2.1";
+SET SESSION debug="+d,query_exec_time_2.3";
+SET SESSION debug="+d,query_exec_time_2.5";
diff --git a/mysql-test/suite/percona/percona_server_variables.inc b/mysql-test/suite/percona/percona_server_variables.inc
new file mode 100644
index 00000000000..60c8e0ba759
--- /dev/null
+++ b/mysql-test/suite/percona/percona_server_variables.inc
@@ -0,0 +1,3 @@
+--source have_response_time_distribution.inc
+--source include/have_xtradb.inc
+SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
diff --git a/mysql-test/suite/percona/percona_server_variables.result b/mysql-test/suite/percona/percona_server_variables.result
deleted file mode 100644
index cb2af0d3d0e..00000000000
--- a/mysql-test/suite/percona/percona_server_variables.result
+++ /dev/null
@@ -1,342 +0,0 @@
-show variables;
-Variable_name Value
-auto_increment_increment Value
-auto_increment_offset Value
-autocommit Value
-automatic_sp_privileges Value
-back_log Value
-basedir Value
-big_tables Value
-binlog_cache_size Value
-binlog_direct_non_transactional_updates Value
-binlog_format Value
-bulk_insert_buffer_size Value
-character_set_client Value
-character_set_connection Value
-character_set_database Value
-character_set_filesystem Value
-character_set_results Value
-character_set_server Value
-character_set_system Value
-character_sets_dir Value
-collation_connection Value
-collation_database Value
-collation_server Value
-completion_type Value
-concurrent_insert Value
-connect_timeout Value
-datadir Value
-date_format Value
-datetime_format Value
-debug Value
-debug_sync Value
-default_week_format Value
-delay_key_write Value
-delayed_insert_limit Value
-delayed_insert_timeout Value
-delayed_queue_size Value
-div_precision_increment Value
-enable_query_response_time_stats Value
-engine_condition_pushdown Value
-error_count Value
-event_scheduler Value
-expire_logs_days Value
-fast_index_creation Value
-flush Value
-flush_time Value
-foreign_key_checks Value
-ft_boolean_syntax Value
-ft_max_word_len Value
-ft_min_word_len Value
-ft_query_expansion_limit Value
-ft_stopword_file Value
-general_log Value
-general_log_file Value
-group_concat_max_len Value
-have_community_features Value
-have_compress Value
-have_crypt Value
-have_csv Value
-have_dynamic_loading Value
-have_geometry Value
-have_innodb Value
-have_ndbcluster Value
-have_openssl Value
-have_partitioning Value
-have_query_cache Value
-have_rtree_keys Value
-have_ssl Value
-have_symlink Value
-hostname Value
-identity Value
-ignore_builtin_innodb Value
-init_connect Value
-init_file Value
-init_slave Value
-innodb_adaptive_checkpoint Value
-innodb_adaptive_flushing Value
-innodb_adaptive_hash_index Value
-innodb_additional_mem_pool_size Value
-innodb_auto_lru_dump Value
-innodb_autoextend_increment Value
-innodb_autoinc_lock_mode Value
-innodb_buffer_pool_shm_checksum Value
-innodb_buffer_pool_shm_key Value
-innodb_buffer_pool_size Value
-innodb_change_buffering Value
-innodb_checkpoint_age_target Value
-innodb_checksums Value
-innodb_commit_concurrency Value
-innodb_concurrency_tickets Value
-innodb_data_file_path Value
-innodb_data_home_dir Value
-innodb_dict_size_limit Value
-innodb_doublewrite Value
-innodb_doublewrite_file Value
-innodb_enable_unsafe_group_commit Value
-innodb_expand_import Value
-innodb_extra_rsegments Value
-innodb_extra_undoslots Value
-innodb_fast_checksum Value
-innodb_fast_recovery Value
-innodb_fast_shutdown Value
-innodb_file_format Value
-innodb_file_format_check Value
-innodb_file_per_table Value
-innodb_flush_log_at_trx_commit Value
-innodb_flush_log_at_trx_commit_session Value
-innodb_flush_method Value
-innodb_flush_neighbor_pages Value
-innodb_force_recovery Value
-innodb_ibuf_accel_rate Value
-innodb_ibuf_active_contract Value
-innodb_ibuf_max_size Value
-innodb_io_capacity Value
-innodb_lock_wait_timeout Value
-innodb_locks_unsafe_for_binlog Value
-innodb_log_buffer_size Value
-innodb_log_file_size Value
-innodb_log_files_in_group Value
-innodb_log_group_home_dir Value
-innodb_max_dirty_pages_pct Value
-innodb_max_purge_lag Value
-innodb_mirrored_log_groups Value
-innodb_old_blocks_pct Value
-innodb_old_blocks_time Value
-innodb_open_files Value
-innodb_overwrite_relay_log_info Value
-innodb_page_size Value
-innodb_pass_corrupt_table Value
-innodb_read_ahead Value
-innodb_read_ahead_threshold Value
-innodb_read_io_threads Value
-innodb_recovery_stats Value
-innodb_replication_delay Value
-innodb_rollback_on_timeout Value
-innodb_show_locks_held Value
-innodb_show_verbose_locks Value
-innodb_spin_wait_delay Value
-innodb_stats_auto_update Value
-innodb_stats_method Value
-innodb_stats_on_metadata Value
-innodb_stats_sample_pages Value
-innodb_stats_update_need_lock Value
-innodb_strict_mode Value
-innodb_support_xa Value
-innodb_sync_spin_loops Value
-innodb_table_locks Value
-innodb_thread_concurrency Value
-innodb_thread_concurrency_timer_based Value
-innodb_thread_sleep_delay Value
-innodb_use_purge_thread Value
-innodb_use_sys_malloc Value
-innodb_use_sys_stats_table Value
-innodb_version Value
-innodb_write_io_threads Value
-insert_id Value
-interactive_timeout Value
-join_buffer_size Value
-keep_files_on_create Value
-key_buffer_size Value
-key_cache_age_threshold Value
-key_cache_block_size Value
-key_cache_division_limit Value
-language Value
-large_files_support Value
-large_page_size Value
-large_pages Value
-last_insert_id Value
-lc_time_names Value
-license Value
-local_infile Value
-locked_in_memory Value
-log Value
-log_bin Value
-log_bin_trust_function_creators Value
-log_bin_trust_routine_creators Value
-log_error Value
-log_output Value
-log_queries_not_using_indexes Value
-log_slave_updates Value
-log_slow_filter Value
-log_slow_queries Value
-log_slow_rate_limit Value
-log_slow_slave_statements Value
-log_slow_sp_statements Value
-log_slow_timestamp_every Value
-log_slow_verbosity Value
-log_warnings Value
-long_query_time Value
-low_priority_updates Value
-lower_case_file_system Value
-lower_case_table_names Value
-max_allowed_packet Value
-max_binlog_cache_size Value
-max_binlog_size Value
-max_connect_errors Value
-max_connections Value
-max_delayed_threads Value
-max_error_count Value
-max_heap_table_size Value
-max_insert_delayed_threads Value
-max_join_size Value
-max_length_for_sort_data Value
-max_prepared_stmt_count Value
-max_relay_log_size Value
-max_seeks_for_key Value
-max_sort_length Value
-max_sp_recursion_depth Value
-max_tmp_tables Value
-max_user_connections Value
-max_write_lock_count Value
-min_examined_row_limit Value
-multi_range_count Value
-myisam_data_pointer_size Value
-myisam_max_sort_file_size Value
-myisam_mmap_size Value
-myisam_recover_options Value
-myisam_repair_threads Value
-myisam_sort_buffer_size Value
-myisam_stats_method Value
-myisam_use_mmap Value
-net_buffer_length Value
-net_read_timeout Value
-net_retry_count Value
-net_write_timeout Value
-new Value
-old Value
-old_alter_table Value
-old_passwords Value
-open_files_limit Value
-optimizer_fix Value
-optimizer_prune_level Value
-optimizer_search_depth Value
-optimizer_switch Value
-pid_file Value
-plugin_dir Value
-port Value
-preload_buffer_size Value
-profiling Value
-profiling_history_size Value
-profiling_server Value
-profiling_use_getrusage Value
-protocol_version Value
-pseudo_thread_id Value
-query_alloc_block_size Value
-query_cache_limit Value
-query_cache_min_res_unit Value
-query_cache_size Value
-query_cache_strip_comments Value
-query_cache_type Value
-query_cache_wlock_invalidate Value
-query_prealloc_size Value
-query_response_time_range_base Value
-rand_seed1 Value
-rand_seed2 Value
-range_alloc_block_size Value
-read_buffer_size Value
-read_only Value
-read_rnd_buffer_size Value
-relay_log Value
-relay_log_index Value
-relay_log_info_file Value
-relay_log_purge Value
-relay_log_space_limit Value
-report_host Value
-report_password Value
-report_port Value
-report_user Value
-rpl_recovery_rank Value
-secure_auth Value
-secure_file_priv Value
-server_id Value
-skip_external_locking Value
-skip_name_resolve Value
-skip_networking Value
-skip_show_database Value
-slave_compressed_protocol Value
-slave_exec_mode Value
-slave_load_tmpdir Value
-slave_net_timeout Value
-slave_skip_errors Value
-slave_transaction_retries Value
-slow_launch_time Value
-slow_query_log Value
-slow_query_log_file Value
-slow_query_log_microseconds_timestamp Value
-socket Value
-sort_buffer_size Value
-sql_auto_is_null Value
-sql_big_selects Value
-sql_big_tables Value
-sql_buffer_result Value
-sql_log_bin Value
-sql_log_off Value
-sql_log_update Value
-sql_low_priority_updates Value
-sql_max_join_size Value
-sql_mode Value
-sql_notes Value
-sql_quote_show_create Value
-sql_safe_updates Value
-sql_select_limit Value
-sql_slave_skip_counter Value
-sql_warnings Value
-ssl_ca Value
-ssl_capath Value
-ssl_cert Value
-ssl_cipher Value
-ssl_key Value
-storage_engine Value
-suppress_log_warning_1592 Value
-sync_binlog Value
-sync_frm Value
-system_time_zone Value
-table_definition_cache Value
-table_lock_wait_timeout Value
-table_open_cache Value
-table_type Value
-thread_cache_size Value
-thread_handling Value
-thread_stack Value
-thread_statistics Value
-time_format Value
-time_zone Value
-timed_mutexes Value
-timestamp Value
-tmp_table_size Value
-tmpdir Value
-transaction_alloc_block_size Value
-transaction_prealloc_size Value
-tx_isolation Value
-unique_checks Value
-updatable_views_with_limit Value
-use_global_log_slow_control Value
-use_global_long_query_time Value
-userstat_running Value
-version Value
-version_comment Value
-version_compile_machine Value
-version_compile_os Value
-wait_timeout Value
-warning_count Value
diff --git a/mysql-test/suite/percona/percona_server_variables.test b/mysql-test/suite/percona/percona_server_variables.test
deleted file mode 100644
index 232cbb15e25..00000000000
--- a/mysql-test/suite/percona/percona_server_variables.test
+++ /dev/null
@@ -1,7 +0,0 @@
---source include/have_innodb.inc
---source include/have_debug.inc
-
-#check the list of variable names
---replace_column 2 Value
-show variables;
-
diff --git a/mysql-test/suite/percona/percona_server_variables_debug.result b/mysql-test/suite/percona/percona_server_variables_debug.result
new file mode 100644
index 00000000000..1ffaa6a7704
--- /dev/null
+++ b/mysql-test/suite/percona/percona_server_variables_debug.result
@@ -0,0 +1,371 @@
+SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
+Variable_name
+AUTOCOMMIT
+AUTOMATIC_SP_PRIVILEGES
+AUTO_INCREMENT_INCREMENT
+AUTO_INCREMENT_OFFSET
+BACK_LOG
+BASEDIR
+BIG_TABLES
+BINLOG_CACHE_SIZE
+BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
+BINLOG_FORMAT
+BINLOG_STMT_CACHE_SIZE
+BULK_INSERT_BUFFER_SIZE
+CHARACTER_SETS_DIR
+CHARACTER_SET_CLIENT
+CHARACTER_SET_CONNECTION
+CHARACTER_SET_DATABASE
+CHARACTER_SET_FILESYSTEM
+CHARACTER_SET_RESULTS
+CHARACTER_SET_SERVER
+CHARACTER_SET_SYSTEM
+COLLATION_CONNECTION
+COLLATION_DATABASE
+COLLATION_SERVER
+COMPLETION_TYPE
+CONCURRENT_INSERT
+CONNECT_TIMEOUT
+DATADIR
+DATETIME_FORMAT
+DATE_FORMAT
+DEBUG
+DEBUG_SYNC
+DEFAULT_STORAGE_ENGINE
+DEFAULT_WEEK_FORMAT
+DELAYED_INSERT_LIMIT
+DELAYED_INSERT_TIMEOUT
+DELAYED_QUEUE_SIZE
+DELAY_KEY_WRITE
+DIV_PRECISION_INCREMENT
+ENGINE_CONDITION_PUSHDOWN
+ERROR_COUNT
+EVENT_SCHEDULER
+EXPIRE_LOGS_DAYS
+EXTERNAL_USER
+FAST_INDEX_CREATION
+FLUSH
+FLUSH_TIME
+FOREIGN_KEY_CHECKS
+FT_BOOLEAN_SYNTAX
+FT_MAX_WORD_LEN
+FT_MIN_WORD_LEN
+FT_QUERY_EXPANSION_LIMIT
+FT_STOPWORD_FILE
+GENERAL_LOG
+GENERAL_LOG_FILE
+GROUP_CONCAT_MAX_LEN
+HAVE_COMPRESS
+HAVE_CRYPT
+HAVE_CSV
+HAVE_DYNAMIC_LOADING
+HAVE_GEOMETRY
+HAVE_INNODB
+HAVE_NDBCLUSTER
+HAVE_OPENSSL
+HAVE_PARTITIONING
+HAVE_PROFILING
+HAVE_QUERY_CACHE
+HAVE_RESPONSE_TIME_DISTRIBUTION
+HAVE_RTREE_KEYS
+HAVE_SSL
+HAVE_SYMLINK
+HOSTNAME
+IDENTITY
+IGNORE_BUILTIN_INNODB
+INIT_CONNECT
+INIT_FILE
+INIT_SLAVE
+INNODB_ADAPTIVE_FLUSHING
+INNODB_ADAPTIVE_FLUSHING_METHOD
+INNODB_ADAPTIVE_HASH_INDEX
+INNODB_ADAPTIVE_HASH_INDEX_PARTITIONS
+INNODB_ADDITIONAL_MEM_POOL_SIZE
+INNODB_AUTOEXTEND_INCREMENT
+INNODB_AUTOINC_LOCK_MODE
+INNODB_BUFFER_POOL_INSTANCES
+INNODB_BUFFER_POOL_RESTORE_AT_STARTUP
+INNODB_BUFFER_POOL_SHM_CHECKSUM
+INNODB_BUFFER_POOL_SHM_KEY
+INNODB_BUFFER_POOL_SIZE
+INNODB_CHANGE_BUFFERING
+INNODB_CHANGE_BUFFERING_DEBUG
+INNODB_CHECKPOINT_AGE_TARGET
+INNODB_CHECKSUMS
+INNODB_COMMIT_CONCURRENCY
+INNODB_CONCURRENCY_TICKETS
+INNODB_CORRUPT_TABLE_ACTION
+INNODB_DATA_FILE_PATH
+INNODB_DATA_HOME_DIR
+INNODB_DICT_SIZE_LIMIT
+INNODB_DOUBLEWRITE
+INNODB_DOUBLEWRITE_FILE
+INNODB_FAST_CHECKSUM
+INNODB_FAST_SHUTDOWN
+INNODB_FILE_FORMAT
+INNODB_FILE_FORMAT_CHECK
+INNODB_FILE_FORMAT_MAX
+INNODB_FILE_PER_TABLE
+INNODB_FLUSH_LOG_AT_TRX_COMMIT
+INNODB_FLUSH_METHOD
+INNODB_FLUSH_NEIGHBOR_PAGES
+INNODB_FORCE_RECOVERY
+INNODB_IBUF_ACCEL_RATE
+INNODB_IBUF_ACTIVE_CONTRACT
+INNODB_IBUF_MAX_SIZE
+INNODB_IMPORT_TABLE_FROM_XTRABACKUP
+INNODB_IO_CAPACITY
+INNODB_LAZY_DROP_TABLE
+INNODB_LOCKS_UNSAFE_FOR_BINLOG
+INNODB_LOCK_WAIT_TIMEOUT
+INNODB_LOG_BLOCK_SIZE
+INNODB_LOG_BUFFER_SIZE
+INNODB_LOG_FILES_IN_GROUP
+INNODB_LOG_FILE_SIZE
+INNODB_LOG_GROUP_HOME_DIR
+INNODB_MAX_DIRTY_PAGES_PCT
+INNODB_MAX_PURGE_LAG
+INNODB_MIRRORED_LOG_GROUPS
+INNODB_OLD_BLOCKS_PCT
+INNODB_OLD_BLOCKS_TIME
+INNODB_OPEN_FILES
+INNODB_PAGE_SIZE
+INNODB_PURGE_BATCH_SIZE
+INNODB_PURGE_THREADS
+INNODB_READ_AHEAD
+INNODB_READ_AHEAD_THRESHOLD
+INNODB_READ_IO_THREADS
+INNODB_RECOVERY_STATS
+INNODB_RECOVERY_UPDATE_RELAY_LOG
+INNODB_REPLICATION_DELAY
+INNODB_ROLLBACK_ON_TIMEOUT
+INNODB_ROLLBACK_SEGMENTS
+INNODB_SHOW_LOCKS_HELD
+INNODB_SHOW_VERBOSE_LOCKS
+INNODB_SPIN_WAIT_DELAY
+INNODB_STATS_AUTO_UPDATE
+INNODB_STATS_METHOD
+INNODB_STATS_ON_METADATA
+INNODB_STATS_SAMPLE_PAGES
+INNODB_STATS_UPDATE_NEED_LOCK
+INNODB_STRICT_MODE
+INNODB_SUPPORT_XA
+INNODB_SYNC_SPIN_LOOPS
+INNODB_TABLE_LOCKS
+INNODB_THREAD_CONCURRENCY
+INNODB_THREAD_CONCURRENCY_TIMER_BASED
+INNODB_THREAD_SLEEP_DELAY
+INNODB_USE_GLOBAL_FLUSH_LOG_AT_TRX_COMMIT
+INNODB_USE_NATIVE_AIO
+INNODB_USE_SYS_MALLOC
+INNODB_USE_SYS_STATS_TABLE
+INNODB_VERSION
+INNODB_WRITE_IO_THREADS
+INSERT_ID
+INTERACTIVE_TIMEOUT
+JOIN_BUFFER_SIZE
+KEEP_FILES_ON_CREATE
+KEY_BUFFER_SIZE
+KEY_CACHE_AGE_THRESHOLD
+KEY_CACHE_BLOCK_SIZE
+KEY_CACHE_DIVISION_LIMIT
+LARGE_FILES_SUPPORT
+LARGE_PAGES
+LARGE_PAGE_SIZE
+LAST_INSERT_ID
+LC_MESSAGES
+LC_MESSAGES_DIR
+LC_TIME_NAMES
+LICENSE
+LOCAL_INFILE
+LOCKED_IN_MEMORY
+LOCK_WAIT_TIMEOUT
+LOG
+LOG_BIN
+LOG_BIN_TRUST_FUNCTION_CREATORS
+LOG_ERROR
+LOG_OUTPUT
+LOG_QUERIES_NOT_USING_INDEXES
+LOG_SLAVE_UPDATES
+LOG_SLOW_FILTER
+LOG_SLOW_QUERIES
+LOG_SLOW_RATE_LIMIT
+LOG_SLOW_SLAVE_STATEMENTS
+LOG_SLOW_SP_STATEMENTS
+LOG_SLOW_VERBOSITY
+LOG_WARNINGS
+LOG_WARNINGS_SUPPRESS
+LONG_QUERY_TIME
+LOWER_CASE_FILE_SYSTEM
+LOWER_CASE_TABLE_NAMES
+LOW_PRIORITY_UPDATES
+MAX_ALLOWED_PACKET
+MAX_BINLOG_CACHE_SIZE
+MAX_BINLOG_SIZE
+MAX_BINLOG_STMT_CACHE_SIZE
+MAX_CONNECTIONS
+MAX_CONNECT_ERRORS
+MAX_DELAYED_THREADS
+MAX_ERROR_COUNT
+MAX_HEAP_TABLE_SIZE
+MAX_INSERT_DELAYED_THREADS
+MAX_JOIN_SIZE
+MAX_LENGTH_FOR_SORT_DATA
+MAX_LONG_DATA_SIZE
+MAX_PREPARED_STMT_COUNT
+MAX_RELAY_LOG_SIZE
+MAX_SEEKS_FOR_KEY
+MAX_SORT_LENGTH
+MAX_SP_RECURSION_DEPTH
+MAX_TMP_TABLES
+MAX_USER_CONNECTIONS
+MAX_WRITE_LOCK_COUNT
+MIN_EXAMINED_ROW_LIMIT
+MULTI_RANGE_COUNT
+MYISAM_DATA_POINTER_SIZE
+MYISAM_MAX_SORT_FILE_SIZE
+MYISAM_MMAP_SIZE
+MYISAM_RECOVER_OPTIONS
+MYISAM_REPAIR_THREADS
+MYISAM_SORT_BUFFER_SIZE
+MYISAM_STATS_METHOD
+MYISAM_USE_MMAP
+NET_BUFFER_LENGTH
+NET_READ_TIMEOUT
+NET_RETRY_COUNT
+NET_WRITE_TIMEOUT
+NEW
+OLD
+OLD_ALTER_TABLE
+OLD_PASSWORDS
+OPEN_FILES_LIMIT
+OPTIMIZER_FIX
+OPTIMIZER_PRUNE_LEVEL
+OPTIMIZER_SEARCH_DEPTH
+OPTIMIZER_SWITCH
+PERFORMANCE_SCHEMA
+PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
+PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
+PERFORMANCE_SCHEMA_MAX_COND_CLASSES
+PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
+PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
+PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
+PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
+PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
+PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
+PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
+PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
+PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
+PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
+PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
+PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
+PID_FILE
+PLUGIN_DIR
+PORT
+PRELOAD_BUFFER_SIZE
+PROFILING
+PROFILING_HISTORY_SIZE
+PROTOCOL_VERSION
+PROXY_USER
+PSEUDO_THREAD_ID
+QUERY_ALLOC_BLOCK_SIZE
+QUERY_CACHE_LIMIT
+QUERY_CACHE_MIN_RES_UNIT
+QUERY_CACHE_SIZE
+QUERY_CACHE_STRIP_COMMENTS
+QUERY_CACHE_TYPE
+QUERY_CACHE_WLOCK_INVALIDATE
+QUERY_PREALLOC_SIZE
+QUERY_RESPONSE_TIME_RANGE_BASE
+QUERY_RESPONSE_TIME_STATS
+RAND_SEED1
+RAND_SEED2
+RANGE_ALLOC_BLOCK_SIZE
+READ_BUFFER_SIZE
+READ_ONLY
+READ_RND_BUFFER_SIZE
+RELAY_LOG
+RELAY_LOG_INDEX
+RELAY_LOG_INFO_FILE
+RELAY_LOG_PURGE
+RELAY_LOG_RECOVERY
+RELAY_LOG_SPACE_LIMIT
+REPORT_HOST
+REPORT_PASSWORD
+REPORT_PORT
+REPORT_USER
+RPL_RECOVERY_RANK
+SECURE_AUTH
+SECURE_FILE_PRIV
+SERVER_ID
+SKIP_EXTERNAL_LOCKING
+SKIP_NAME_RESOLVE
+SKIP_NETWORKING
+SKIP_SHOW_DATABASE
+SLAVE_COMPRESSED_PROTOCOL
+SLAVE_EXEC_MODE
+SLAVE_LOAD_TMPDIR
+SLAVE_NET_TIMEOUT
+SLAVE_SKIP_ERRORS
+SLAVE_TRANSACTION_RETRIES
+SLAVE_TYPE_CONVERSIONS
+SLOW_LAUNCH_TIME
+SLOW_QUERY_LOG
+SLOW_QUERY_LOG_FILE
+SLOW_QUERY_LOG_TIMESTAMP_ALWAYS
+SLOW_QUERY_LOG_TIMESTAMP_PRECISION
+SLOW_QUERY_LOG_USE_GLOBAL_CONTROL
+SOCKET
+SORT_BUFFER_SIZE
+SQL_AUTO_IS_NULL
+SQL_BIG_SELECTS
+SQL_BIG_TABLES
+SQL_BUFFER_RESULT
+SQL_LOG_BIN
+SQL_LOG_OFF
+SQL_LOW_PRIORITY_UPDATES
+SQL_MAX_JOIN_SIZE
+SQL_MODE
+SQL_NOTES
+SQL_QUOTE_SHOW_CREATE
+SQL_SAFE_UPDATES
+SQL_SELECT_LIMIT
+SQL_SLAVE_SKIP_COUNTER
+SQL_WARNINGS
+SSL_CA
+SSL_CAPATH
+SSL_CERT
+SSL_CIPHER
+SSL_KEY
+STORAGE_ENGINE
+SYNC_BINLOG
+SYNC_FRM
+SYNC_MASTER_INFO
+SYNC_RELAY_LOG
+SYNC_RELAY_LOG_INFO
+SYSTEM_TIME_ZONE
+TABLE_DEFINITION_CACHE
+TABLE_OPEN_CACHE
+THREAD_CACHE_SIZE
+THREAD_CONCURRENCY
+THREAD_HANDLING
+THREAD_STACK
+THREAD_STATISTICS
+TIMED_MUTEXES
+TIMESTAMP
+TIME_FORMAT
+TIME_ZONE
+TMPDIR
+TMP_TABLE_SIZE
+TRANSACTION_ALLOC_BLOCK_SIZE
+TRANSACTION_PREALLOC_SIZE
+TX_ISOLATION
+UNIQUE_CHECKS
+UPDATABLE_VIEWS_WITH_LIMIT
+USERSTAT
+VERSION
+VERSION_COMMENT
+VERSION_COMPILE_MACHINE
+VERSION_COMPILE_OS
+WAIT_TIMEOUT
+WARNING_COUNT
diff --git a/mysql-test/suite/percona/percona_server_variables_debug.test b/mysql-test/suite/percona/percona_server_variables_debug.test
new file mode 100644
index 00000000000..971f6bae689
--- /dev/null
+++ b/mysql-test/suite/percona/percona_server_variables_debug.test
@@ -0,0 +1,2 @@
+--source include/have_debug.inc
+--source percona_server_variables.inc
diff --git a/mysql-test/suite/percona/percona_server_variables_release.result b/mysql-test/suite/percona/percona_server_variables_release.result
new file mode 100644
index 00000000000..cabd69b19a6
--- /dev/null
+++ b/mysql-test/suite/percona/percona_server_variables_release.result
@@ -0,0 +1,368 @@
+SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
+Variable_name
+AUTOCOMMIT
+AUTOMATIC_SP_PRIVILEGES
+AUTO_INCREMENT_INCREMENT
+AUTO_INCREMENT_OFFSET
+BACK_LOG
+BASEDIR
+BIG_TABLES
+BINLOG_CACHE_SIZE
+BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
+BINLOG_FORMAT
+BINLOG_STMT_CACHE_SIZE
+BULK_INSERT_BUFFER_SIZE
+CHARACTER_SETS_DIR
+CHARACTER_SET_CLIENT
+CHARACTER_SET_CONNECTION
+CHARACTER_SET_DATABASE
+CHARACTER_SET_FILESYSTEM
+CHARACTER_SET_RESULTS
+CHARACTER_SET_SERVER
+CHARACTER_SET_SYSTEM
+COLLATION_CONNECTION
+COLLATION_DATABASE
+COLLATION_SERVER
+COMPLETION_TYPE
+CONCURRENT_INSERT
+CONNECT_TIMEOUT
+DATADIR
+DATETIME_FORMAT
+DATE_FORMAT
+DEFAULT_STORAGE_ENGINE
+DEFAULT_WEEK_FORMAT
+DELAYED_INSERT_LIMIT
+DELAYED_INSERT_TIMEOUT
+DELAYED_QUEUE_SIZE
+DELAY_KEY_WRITE
+DIV_PRECISION_INCREMENT
+ENGINE_CONDITION_PUSHDOWN
+ERROR_COUNT
+EVENT_SCHEDULER
+EXPIRE_LOGS_DAYS
+EXTERNAL_USER
+FAST_INDEX_CREATION
+FLUSH
+FLUSH_TIME
+FOREIGN_KEY_CHECKS
+FT_BOOLEAN_SYNTAX
+FT_MAX_WORD_LEN
+FT_MIN_WORD_LEN
+FT_QUERY_EXPANSION_LIMIT
+FT_STOPWORD_FILE
+GENERAL_LOG
+GENERAL_LOG_FILE
+GROUP_CONCAT_MAX_LEN
+HAVE_COMPRESS
+HAVE_CRYPT
+HAVE_CSV
+HAVE_DYNAMIC_LOADING
+HAVE_GEOMETRY
+HAVE_INNODB
+HAVE_NDBCLUSTER
+HAVE_OPENSSL
+HAVE_PARTITIONING
+HAVE_PROFILING
+HAVE_QUERY_CACHE
+HAVE_RESPONSE_TIME_DISTRIBUTION
+HAVE_RTREE_KEYS
+HAVE_SSL
+HAVE_SYMLINK
+HOSTNAME
+IDENTITY
+IGNORE_BUILTIN_INNODB
+INIT_CONNECT
+INIT_FILE
+INIT_SLAVE
+INNODB_ADAPTIVE_FLUSHING
+INNODB_ADAPTIVE_FLUSHING_METHOD
+INNODB_ADAPTIVE_HASH_INDEX
+INNODB_ADAPTIVE_HASH_INDEX_PARTITIONS
+INNODB_ADDITIONAL_MEM_POOL_SIZE
+INNODB_AUTOEXTEND_INCREMENT
+INNODB_AUTOINC_LOCK_MODE
+INNODB_BUFFER_POOL_INSTANCES
+INNODB_BUFFER_POOL_RESTORE_AT_STARTUP
+INNODB_BUFFER_POOL_SHM_CHECKSUM
+INNODB_BUFFER_POOL_SHM_KEY
+INNODB_BUFFER_POOL_SIZE
+INNODB_CHANGE_BUFFERING
+INNODB_CHECKPOINT_AGE_TARGET
+INNODB_CHECKSUMS
+INNODB_COMMIT_CONCURRENCY
+INNODB_CONCURRENCY_TICKETS
+INNODB_CORRUPT_TABLE_ACTION
+INNODB_DATA_FILE_PATH
+INNODB_DATA_HOME_DIR
+INNODB_DICT_SIZE_LIMIT
+INNODB_DOUBLEWRITE
+INNODB_DOUBLEWRITE_FILE
+INNODB_FAST_CHECKSUM
+INNODB_FAST_SHUTDOWN
+INNODB_FILE_FORMAT
+INNODB_FILE_FORMAT_CHECK
+INNODB_FILE_FORMAT_MAX
+INNODB_FILE_PER_TABLE
+INNODB_FLUSH_LOG_AT_TRX_COMMIT
+INNODB_FLUSH_METHOD
+INNODB_FLUSH_NEIGHBOR_PAGES
+INNODB_FORCE_RECOVERY
+INNODB_IBUF_ACCEL_RATE
+INNODB_IBUF_ACTIVE_CONTRACT
+INNODB_IBUF_MAX_SIZE
+INNODB_IMPORT_TABLE_FROM_XTRABACKUP
+INNODB_IO_CAPACITY
+INNODB_LAZY_DROP_TABLE
+INNODB_LOCKS_UNSAFE_FOR_BINLOG
+INNODB_LOCK_WAIT_TIMEOUT
+INNODB_LOG_BLOCK_SIZE
+INNODB_LOG_BUFFER_SIZE
+INNODB_LOG_FILES_IN_GROUP
+INNODB_LOG_FILE_SIZE
+INNODB_LOG_GROUP_HOME_DIR
+INNODB_MAX_DIRTY_PAGES_PCT
+INNODB_MAX_PURGE_LAG
+INNODB_MIRRORED_LOG_GROUPS
+INNODB_OLD_BLOCKS_PCT
+INNODB_OLD_BLOCKS_TIME
+INNODB_OPEN_FILES
+INNODB_PAGE_SIZE
+INNODB_PURGE_BATCH_SIZE
+INNODB_PURGE_THREADS
+INNODB_READ_AHEAD
+INNODB_READ_AHEAD_THRESHOLD
+INNODB_READ_IO_THREADS
+INNODB_RECOVERY_STATS
+INNODB_RECOVERY_UPDATE_RELAY_LOG
+INNODB_REPLICATION_DELAY
+INNODB_ROLLBACK_ON_TIMEOUT
+INNODB_ROLLBACK_SEGMENTS
+INNODB_SHOW_LOCKS_HELD
+INNODB_SHOW_VERBOSE_LOCKS
+INNODB_SPIN_WAIT_DELAY
+INNODB_STATS_AUTO_UPDATE
+INNODB_STATS_METHOD
+INNODB_STATS_ON_METADATA
+INNODB_STATS_SAMPLE_PAGES
+INNODB_STATS_UPDATE_NEED_LOCK
+INNODB_STRICT_MODE
+INNODB_SUPPORT_XA
+INNODB_SYNC_SPIN_LOOPS
+INNODB_TABLE_LOCKS
+INNODB_THREAD_CONCURRENCY
+INNODB_THREAD_CONCURRENCY_TIMER_BASED
+INNODB_THREAD_SLEEP_DELAY
+INNODB_USE_GLOBAL_FLUSH_LOG_AT_TRX_COMMIT
+INNODB_USE_NATIVE_AIO
+INNODB_USE_SYS_MALLOC
+INNODB_USE_SYS_STATS_TABLE
+INNODB_VERSION
+INNODB_WRITE_IO_THREADS
+INSERT_ID
+INTERACTIVE_TIMEOUT
+JOIN_BUFFER_SIZE
+KEEP_FILES_ON_CREATE
+KEY_BUFFER_SIZE
+KEY_CACHE_AGE_THRESHOLD
+KEY_CACHE_BLOCK_SIZE
+KEY_CACHE_DIVISION_LIMIT
+LARGE_FILES_SUPPORT
+LARGE_PAGES
+LARGE_PAGE_SIZE
+LAST_INSERT_ID
+LC_MESSAGES
+LC_MESSAGES_DIR
+LC_TIME_NAMES
+LICENSE
+LOCAL_INFILE
+LOCKED_IN_MEMORY
+LOCK_WAIT_TIMEOUT
+LOG
+LOG_BIN
+LOG_BIN_TRUST_FUNCTION_CREATORS
+LOG_ERROR
+LOG_OUTPUT
+LOG_QUERIES_NOT_USING_INDEXES
+LOG_SLAVE_UPDATES
+LOG_SLOW_FILTER
+LOG_SLOW_QUERIES
+LOG_SLOW_RATE_LIMIT
+LOG_SLOW_SLAVE_STATEMENTS
+LOG_SLOW_SP_STATEMENTS
+LOG_SLOW_VERBOSITY
+LOG_WARNINGS
+LOG_WARNINGS_SUPPRESS
+LONG_QUERY_TIME
+LOWER_CASE_FILE_SYSTEM
+LOWER_CASE_TABLE_NAMES
+LOW_PRIORITY_UPDATES
+MAX_ALLOWED_PACKET
+MAX_BINLOG_CACHE_SIZE
+MAX_BINLOG_SIZE
+MAX_BINLOG_STMT_CACHE_SIZE
+MAX_CONNECTIONS
+MAX_CONNECT_ERRORS
+MAX_DELAYED_THREADS
+MAX_ERROR_COUNT
+MAX_HEAP_TABLE_SIZE
+MAX_INSERT_DELAYED_THREADS
+MAX_JOIN_SIZE
+MAX_LENGTH_FOR_SORT_DATA
+MAX_LONG_DATA_SIZE
+MAX_PREPARED_STMT_COUNT
+MAX_RELAY_LOG_SIZE
+MAX_SEEKS_FOR_KEY
+MAX_SORT_LENGTH
+MAX_SP_RECURSION_DEPTH
+MAX_TMP_TABLES
+MAX_USER_CONNECTIONS
+MAX_WRITE_LOCK_COUNT
+MIN_EXAMINED_ROW_LIMIT
+MULTI_RANGE_COUNT
+MYISAM_DATA_POINTER_SIZE
+MYISAM_MAX_SORT_FILE_SIZE
+MYISAM_MMAP_SIZE
+MYISAM_RECOVER_OPTIONS
+MYISAM_REPAIR_THREADS
+MYISAM_SORT_BUFFER_SIZE
+MYISAM_STATS_METHOD
+MYISAM_USE_MMAP
+NET_BUFFER_LENGTH
+NET_READ_TIMEOUT
+NET_RETRY_COUNT
+NET_WRITE_TIMEOUT
+NEW
+OLD
+OLD_ALTER_TABLE
+OLD_PASSWORDS
+OPEN_FILES_LIMIT
+OPTIMIZER_FIX
+OPTIMIZER_PRUNE_LEVEL
+OPTIMIZER_SEARCH_DEPTH
+OPTIMIZER_SWITCH
+PERFORMANCE_SCHEMA
+PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
+PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
+PERFORMANCE_SCHEMA_MAX_COND_CLASSES
+PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
+PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
+PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
+PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
+PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
+PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
+PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
+PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
+PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
+PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
+PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
+PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
+PID_FILE
+PLUGIN_DIR
+PORT
+PRELOAD_BUFFER_SIZE
+PROFILING
+PROFILING_HISTORY_SIZE
+PROTOCOL_VERSION
+PROXY_USER
+PSEUDO_THREAD_ID
+QUERY_ALLOC_BLOCK_SIZE
+QUERY_CACHE_LIMIT
+QUERY_CACHE_MIN_RES_UNIT
+QUERY_CACHE_SIZE
+QUERY_CACHE_STRIP_COMMENTS
+QUERY_CACHE_TYPE
+QUERY_CACHE_WLOCK_INVALIDATE
+QUERY_PREALLOC_SIZE
+QUERY_RESPONSE_TIME_RANGE_BASE
+QUERY_RESPONSE_TIME_STATS
+RAND_SEED1
+RAND_SEED2
+RANGE_ALLOC_BLOCK_SIZE
+READ_BUFFER_SIZE
+READ_ONLY
+READ_RND_BUFFER_SIZE
+RELAY_LOG
+RELAY_LOG_INDEX
+RELAY_LOG_INFO_FILE
+RELAY_LOG_PURGE
+RELAY_LOG_RECOVERY
+RELAY_LOG_SPACE_LIMIT
+REPORT_HOST
+REPORT_PASSWORD
+REPORT_PORT
+REPORT_USER
+RPL_RECOVERY_RANK
+SECURE_AUTH
+SECURE_FILE_PRIV
+SERVER_ID
+SKIP_EXTERNAL_LOCKING
+SKIP_NAME_RESOLVE
+SKIP_NETWORKING
+SKIP_SHOW_DATABASE
+SLAVE_COMPRESSED_PROTOCOL
+SLAVE_EXEC_MODE
+SLAVE_LOAD_TMPDIR
+SLAVE_NET_TIMEOUT
+SLAVE_SKIP_ERRORS
+SLAVE_TRANSACTION_RETRIES
+SLAVE_TYPE_CONVERSIONS
+SLOW_LAUNCH_TIME
+SLOW_QUERY_LOG
+SLOW_QUERY_LOG_FILE
+SLOW_QUERY_LOG_TIMESTAMP_ALWAYS
+SLOW_QUERY_LOG_TIMESTAMP_PRECISION
+SLOW_QUERY_LOG_USE_GLOBAL_CONTROL
+SOCKET
+SORT_BUFFER_SIZE
+SQL_AUTO_IS_NULL
+SQL_BIG_SELECTS
+SQL_BIG_TABLES
+SQL_BUFFER_RESULT
+SQL_LOG_BIN
+SQL_LOG_OFF
+SQL_LOW_PRIORITY_UPDATES
+SQL_MAX_JOIN_SIZE
+SQL_MODE
+SQL_NOTES
+SQL_QUOTE_SHOW_CREATE
+SQL_SAFE_UPDATES
+SQL_SELECT_LIMIT
+SQL_SLAVE_SKIP_COUNTER
+SQL_WARNINGS
+SSL_CA
+SSL_CAPATH
+SSL_CERT
+SSL_CIPHER
+SSL_KEY
+STORAGE_ENGINE
+SYNC_BINLOG
+SYNC_FRM
+SYNC_MASTER_INFO
+SYNC_RELAY_LOG
+SYNC_RELAY_LOG_INFO
+SYSTEM_TIME_ZONE
+TABLE_DEFINITION_CACHE
+TABLE_OPEN_CACHE
+THREAD_CACHE_SIZE
+THREAD_CONCURRENCY
+THREAD_HANDLING
+THREAD_STACK
+THREAD_STATISTICS
+TIMED_MUTEXES
+TIMESTAMP
+TIME_FORMAT
+TIME_ZONE
+TMPDIR
+TMP_TABLE_SIZE
+TRANSACTION_ALLOC_BLOCK_SIZE
+TRANSACTION_PREALLOC_SIZE
+TX_ISOLATION
+UNIQUE_CHECKS
+UPDATABLE_VIEWS_WITH_LIMIT
+USERSTAT
+VERSION
+VERSION_COMMENT
+VERSION_COMPILE_MACHINE
+VERSION_COMPILE_OS
+WAIT_TIMEOUT
+WARNING_COUNT
diff --git a/mysql-test/suite/percona/percona_server_variables_release.test b/mysql-test/suite/percona/percona_server_variables_release.test
new file mode 100644
index 00000000000..f61446aeb02
--- /dev/null
+++ b/mysql-test/suite/percona/percona_server_variables_release.test
@@ -0,0 +1,2 @@
+--source include/have_nodebug.inc
+--source include/percona_server_variables.inc
diff --git a/mysql-test/suite/percona/percona_show_slave_status_nolock.result b/mysql-test/suite/percona/percona_show_slave_status_nolock.result
new file mode 100644
index 00000000000..1d6114a001e
--- /dev/null
+++ b/mysql-test/suite/percona/percona_show_slave_status_nolock.result
@@ -0,0 +1,21 @@
+include/master-slave.inc
+[connection master]
+DROP TABLE IF EXISTS t;
+CREATE TABLE t(id INT);
+INSERT INTO t SELECT SLEEP(10);
+STOP SLAVE;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
+master count(*)
+master 1
+slave count(*)
+slave 0
+SHOW SLAVE STATUS NOLOCK;
+include/wait_for_slave_to_stop.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+slave count(*)
+slave 1
+DROP TABLE t;
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/percona_show_slave_status_nolock.test b/mysql-test/suite/percona/percona_show_slave_status_nolock.test
new file mode 100644
index 00000000000..dcb2eb26a3e
--- /dev/null
+++ b/mysql-test/suite/percona/percona_show_slave_status_nolock.test
@@ -0,0 +1,53 @@
+--source include/master-slave.inc
+--source include/have_binlog_format_statement.inc
+--disable_query_log
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement:");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+--enable_query_log
+connection master;
+ --disable_warnings
+ DROP TABLE IF EXISTS t;
+ --enable_warnings
+ CREATE TABLE t(id INT);
+ sync_slave_with_master;
+
+connection master;
+ send INSERT INTO t SELECT SLEEP(10);
+
+connection slave;
+ sleep 15;
+ send STOP SLAVE;
+
+connection master;
+ reap;
+
+ --disable_query_log
+ select "master",count(*) from t;
+ --enable_query_log
+
+connection slave1;
+ --disable_query_log
+ select "slave",count(*) from t;
+ --enable_query_log
+
+ --disable_result_log
+ SHOW SLAVE STATUS NOLOCK;
+ --enable_result_log
+
+connection slave;
+ reap;
+
+ --source include/wait_for_slave_to_stop.inc
+ START SLAVE;
+ --source include/wait_for_slave_to_start.inc
+
+ --disable_query_log
+ select "slave",count(*) from t;
+ --enable_query_log
+
+connection master;
+ DROP TABLE t;
+sync_slave_with_master;
+STOP SLAVE;
+--source include/wait_for_slave_to_stop.inc
+
diff --git a/mysql-test/suite/percona/percona_slow_query_log-log_slow_filter-master.opt b/mysql-test/suite/percona/percona_slow_extended-log_slow_filter-master.opt
index cb93f7abf05..865dc70ba38 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-log_slow_filter-master.opt
+++ b/mysql-test/suite/percona/percona_slow_extended-log_slow_filter-master.opt
@@ -1 +1 @@
---slow-query-log-file=percona_slow_query_log-log_slow_filter.log --long-query-time=1 \ No newline at end of file
+--slow-query-log-file=percona_slow_query_log-log_slow_filter.log --long-query-time=1 --slow_query_log=OFF
diff --git a/mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.result b/mysql-test/suite/percona/percona_slow_extended-log_slow_filter.result
index 9c8f69745a7..2f22ef5457b 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.result
+++ b/mysql-test/suite/percona/percona_slow_extended-log_slow_filter.result
@@ -1,4 +1,3 @@
-SET GLOBAL SLOW_QUERY_LOG=OFF;
drop table if exists t;
# Create test table
create table t(id INT PRIMARY KEY) engine=InnoDB;
@@ -20,6 +19,7 @@ sleep(2)
SELECT sleep(2);
sleep(2)
0
+SET GLOBAL SLOW_QUERY_LOG=OFF;
drop table if exists t;
-cat MYSQLD_DATADIR/percona_slow_query_log-log_slow_filter.log | grep -c Query_time
+FLUSH LOGS;
2
diff --git a/mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.test b/mysql-test/suite/percona/percona_slow_extended-log_slow_filter.test
index 44646de530a..292c1651e34 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.test
+++ b/mysql-test/suite/percona/percona_slow_extended-log_slow_filter.test
@@ -1,8 +1,4 @@
--- source include/not_windows.inc
-
-source include/have_innodb.inc;
-
-SET GLOBAL SLOW_QUERY_LOG=OFF;
+source include/have_xtradb.inc;
--disable_warnings
drop table if exists t;
@@ -24,12 +20,13 @@ set log_slow_filter=full_join;
SELECT sleep(2) union select t2.id from t as t1,t as t2;
SELECT sleep(2);
+SET GLOBAL SLOW_QUERY_LOG=OFF;
+
--disable_warnings
drop table if exists t;
--enable_warnings
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-log_slow_filter.log | grep -c Query_time;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo '$cmd';
-exec $cmd;
+FLUSH LOGS;
+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-log_slow_filter.log
+--let grep_pattern = Query_time
+--source grep.inc
diff --git a/mysql-test/suite/percona/percona_slow_extended-log_slow_sp_statements-cl-master.opt b/mysql-test/suite/percona/percona_slow_extended-log_slow_sp_statements-cl-master.opt
new file mode 100644
index 00000000000..4368453928a
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-log_slow_sp_statements-cl-master.opt
@@ -0,0 +1 @@
+--log_slow_sp_statements
diff --git a/mysql-test/suite/percona/percona_slow_extended-log_slow_sp_statements-cl.result b/mysql-test/suite/percona/percona_slow_extended-log_slow_sp_statements-cl.result
new file mode 100644
index 00000000000..c5653429327
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-log_slow_sp_statements-cl.result
@@ -0,0 +1,3 @@
+show global variables like 'log_slow_sp_statements';
+Variable_name Value
+log_slow_sp_statements ON
diff --git a/mysql-test/suite/percona/percona_slow_extended-log_slow_sp_statements-cl.test b/mysql-test/suite/percona/percona_slow_extended-log_slow_sp_statements-cl.test
new file mode 100644
index 00000000000..47bd960feb5
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-log_slow_sp_statements-cl.test
@@ -0,0 +1 @@
+show global variables like 'log_slow_sp_statements';
diff --git a/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-cl-master.opt b/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-cl-master.opt
new file mode 100644
index 00000000000..d8809c36981
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-cl-master.opt
@@ -0,0 +1 @@
+--log_slow_verbosity="full"
diff --git a/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-cl.result b/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-cl.result
new file mode 100644
index 00000000000..eb8228efb08
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-cl.result
@@ -0,0 +1,9 @@
+show global variables like 'log_slow_verbosity';
+Variable_name Value
+log_slow_verbosity microtime,query_plan,innodb
+show variables like 'log_slow_verbosity';
+Variable_name Value
+log_slow_verbosity microtime,query_plan,innodb
+select @@log_slow_verbosity;
+@@log_slow_verbosity
+microtime,query_plan,innodb
diff --git a/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-cl.test b/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-cl.test
new file mode 100644
index 00000000000..740c4deaebd
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-cl.test
@@ -0,0 +1,3 @@
+show global variables like 'log_slow_verbosity';
+show variables like 'log_slow_verbosity';
+select @@log_slow_verbosity;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity-master.opt b/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-master.opt
index 8d21f40a34f..19ae9c117f0 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity-master.opt
+++ b/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity-master.opt
@@ -1 +1 @@
---slow-query-log-file=percona_slow_query_log-log_slow_verbosity.log --long-query-time=1 \ No newline at end of file
+--slow-query-log-file=percona_slow_query_log-log_slow_verbosity.log --long-query-time=1
diff --git a/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity.result b/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity.result
new file mode 100644
index 00000000000..1e7db10c8bd
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity.result
@@ -0,0 +1,9 @@
+SELECT sleep(2);
+sleep(2)
+0
+set log_slow_verbosity=innodb;
+SELECT sleep(2);
+sleep(2)
+0
+FLUSH LOGS;
+1
diff --git a/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity.test b/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity.test
new file mode 100644
index 00000000000..e95ab54af61
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-log_slow_verbosity.test
@@ -0,0 +1,12 @@
+source include/have_xtradb.inc;
+
+SELECT sleep(2);
+
+set log_slow_verbosity=innodb;
+
+SELECT sleep(2);
+
+FLUSH LOGS;
+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-log_slow_verbosity.log
+--let grep_pattern = No InnoDB statistics available for this query
+--source grep.inc
diff --git a/mysql-test/suite/percona/percona_slow_query_log-long_query_time-master.opt b/mysql-test/suite/percona/percona_slow_extended-long_query_time-master.opt
index 5cbb82d1261..62e1e981558 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-long_query_time-master.opt
+++ b/mysql-test/suite/percona/percona_slow_extended-long_query_time-master.opt
@@ -1 +1 @@
---slow-query-log-file=percona_slow_query_log-long_query_time.log --long-query-time=3
+--slow-query-log-file=percona_slow_query_log-long_query_time.log --long-query-time=2 --slow-query-log=OFF
diff --git a/mysql-test/suite/percona/percona_slow_extended-long_query_time.result b/mysql-test/suite/percona/percona_slow_extended-long_query_time.result
new file mode 100644
index 00000000000..f2da4e4d9d6
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-long_query_time.result
@@ -0,0 +1,24 @@
+SET GLOBAL SLOW_QUERY_LOG=ON;
+SELECT sleep(1);
+sleep(1)
+0
+SELECT sleep(3);
+sleep(3)
+0
+SELECT sleep(5);
+sleep(5)
+0
+set long_query_time=4;
+SELECT sleep(1);
+sleep(1)
+0
+SELECT sleep(3);
+sleep(3)
+0
+SELECT sleep(5);
+sleep(5)
+0
+set long_query_time=2;
+SET GLOBAL SLOW_QUERY_LOG=OFF;
+FLUSH LOGS;
+3
diff --git a/mysql-test/suite/percona/percona_slow_extended-long_query_time.test b/mysql-test/suite/percona/percona_slow_extended-long_query_time.test
new file mode 100644
index 00000000000..716cc7cb0c3
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-long_query_time.test
@@ -0,0 +1,23 @@
+source include/have_xtradb.inc;
+
+SET GLOBAL SLOW_QUERY_LOG=ON;
+
+SELECT sleep(1);
+SELECT sleep(3);
+SELECT sleep(5);
+
+set long_query_time=4;
+
+SELECT sleep(1);
+SELECT sleep(3);
+SELECT sleep(5);
+
+set long_query_time=2;
+
+SET GLOBAL SLOW_QUERY_LOG=OFF;
+
+FLUSH LOGS;
+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-long_query_time.log
+--let grep_pattern = Query_time
+--source grep.inc
+
diff --git a/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log-master.opt b/mysql-test/suite/percona/percona_slow_extended-microseconds_in_slow_extended-master.opt
index 6433539d3d1..ca486d356f5 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log-master.opt
+++ b/mysql-test/suite/percona/percona_slow_extended-microseconds_in_slow_extended-master.opt
@@ -1 +1 @@
---slow-query-log-file=percona_slow_query_log-microseconds_in_slow_query_log.log --long-query-time=1 \ No newline at end of file
+--slow-query-log-file=percona_slow_query_log-microseconds_in_slow_query_log.log --long-query-time=1 --slow_query_log=OFF
diff --git a/mysql-test/suite/percona/percona_slow_extended-microseconds_in_slow_extended.result b/mysql-test/suite/percona/percona_slow_extended-microseconds_in_slow_extended.result
new file mode 100644
index 00000000000..ce27c518efe
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-microseconds_in_slow_extended.result
@@ -0,0 +1,13 @@
+SET GLOBAL SLOW_QUERY_LOG=ON;
+SELECT sleep(2);
+sleep(2)
+0
+set global slow_query_log_timestamp_precision='microsecond';
+SELECT sleep(2);
+sleep(2)
+0
+set global slow_query_log_timestamp_precision='second';
+SET GLOBAL SLOW_QUERY_LOG=OFF;
+FLUSH LOGS;
+1
+2
diff --git a/mysql-test/suite/percona/percona_slow_extended-microseconds_in_slow_extended.test b/mysql-test/suite/percona/percona_slow_extended-microseconds_in_slow_extended.test
new file mode 100644
index 00000000000..4b437b21e4c
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-microseconds_in_slow_extended.test
@@ -0,0 +1,23 @@
+source include/have_xtradb.inc;
+
+SET GLOBAL SLOW_QUERY_LOG=ON;
+
+SELECT sleep(2);
+
+set global slow_query_log_timestamp_precision='microsecond';
+
+SELECT sleep(2);
+
+set global slow_query_log_timestamp_precision='second';
+
+SET GLOBAL SLOW_QUERY_LOG=OFF;
+
+FLUSH LOGS;
+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log
+--let grep_pattern = # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+.[0-9]+
+--source grep.inc
+
+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log
+--let grep_pattern = # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+
+--source grep.inc
+
diff --git a/mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit-master.opt b/mysql-test/suite/percona/percona_slow_extended-min_examined_row_limit-master.opt
index 6f82556fb0c..c1cf3ebdb30 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit-master.opt
+++ b/mysql-test/suite/percona/percona_slow_extended-min_examined_row_limit-master.opt
@@ -1 +1 @@
---slow-query-log-file=percona_slow_query_log-min_examined_row_limit.log --long-query-time=1 \ No newline at end of file
+--slow-query-log-file=percona_slow_query_log-min_examined_row_limit.log --long-query-time=1 --slow-query-log=OFF
diff --git a/mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.result b/mysql-test/suite/percona/percona_slow_extended-min_examined_row_limit.result
index 32698a59837..1e8bc0723ac 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.result
+++ b/mysql-test/suite/percona/percona_slow_extended-min_examined_row_limit.result
@@ -1,4 +1,3 @@
-SET GLOBAL SLOW_QUERY_LOG=OFF;
drop table if exists t;
# Create test table
create table t(id INT PRIMARY KEY) engine=InnoDB;
@@ -20,6 +19,7 @@ sleep(2)
SELECT sleep(2);
sleep(2)
0
+SET GLOBAL SLOW_QUERY_LOG=OFF;
drop table if exists t;
-cat MYSQLD_DATADIR/percona_slow_query_log-min_examined_row_limit.log | grep -c Query_time
+FLUSH LOGS;
2
diff --git a/mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.test b/mysql-test/suite/percona/percona_slow_extended-min_examined_row_limit.test
index 61276423b4d..ca68658a6c5 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.test
+++ b/mysql-test/suite/percona/percona_slow_extended-min_examined_row_limit.test
@@ -1,7 +1,4 @@
-source include/not_windows.inc;
-source include/have_innodb.inc;
-
-SET GLOBAL SLOW_QUERY_LOG=OFF;
+source include/have_xtradb.inc;
--disable_warnings
drop table if exists t;
@@ -23,12 +20,13 @@ set min_examined_row_limit=5;
SELECT sleep(2) union select t2.id from t as t1,t as t2;
SELECT sleep(2);
+SET GLOBAL SLOW_QUERY_LOG=OFF;
+
--disable_warnings
drop table if exists t;
--enable_warnings
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-min_examined_row_limit.log | grep -c Query_time;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo '$cmd';
-exec $cmd;
+FLUSH LOGS;
+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-min_examined_row_limit.log
+--let grep_pattern = Query_time
+--source grep.inc
diff --git a/mysql-test/suite/percona/percona_slave_innodb_stats-master.opt b/mysql-test/suite/percona/percona_slow_extended-slave_innodb_stats-master.opt
index 286a9c4484d..286a9c4484d 100644
--- a/mysql-test/suite/percona/percona_slave_innodb_stats-master.opt
+++ b/mysql-test/suite/percona/percona_slow_extended-slave_innodb_stats-master.opt
diff --git a/mysql-test/suite/percona/percona_slave_innodb_stats-slave.opt b/mysql-test/suite/percona/percona_slow_extended-slave_innodb_stats-slave.opt
index 286a9c4484d..286a9c4484d 100644
--- a/mysql-test/suite/percona/percona_slave_innodb_stats-slave.opt
+++ b/mysql-test/suite/percona/percona_slow_extended-slave_innodb_stats-slave.opt
diff --git a/mysql-test/suite/percona/percona_slave_innodb_stats.result b/mysql-test/suite/percona/percona_slow_extended-slave_innodb_stats.result
index c2406bdfd85..51993e767c2 100644
--- a/mysql-test/suite/percona/percona_slave_innodb_stats.result
+++ b/mysql-test/suite/percona/percona_slow_extended-slave_innodb_stats.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t;
CREATE TABLE t(id INT,data CHAR(30)) ENGINE=InnoDB;
INSERT INTO t VALUES
@@ -15,7 +11,12 @@ INSERT INTO t VALUES
INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2;
INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2;
STOP SLAVE;
+include/wait_for_slave_to_stop.inc
START SLAVE;
+include/wait_for_slave_to_start.inc
INSERT INTO t SELECT t.id,t.data from t;
DROP TABLE IF EXISTS t;
+FLUSH LOGS;
4
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/percona_slave_innodb_stats.test b/mysql-test/suite/percona/percona_slow_extended-slave_innodb_stats.test
index defcd1fc406..b0a6c98870c 100644
--- a/mysql-test/suite/percona/percona_slave_innodb_stats.test
+++ b/mysql-test/suite/percona/percona_slow_extended-slave_innodb_stats.test
@@ -1,5 +1,6 @@
-source include/have_innodb.inc;
-source include/master-slave.inc;
+-- source include/have_binlog_format_mixed_or_statement.inc
+-- source include/have_xtradb.inc
+-- source include/master-slave.inc
connection master;
-- disable_warnings
@@ -40,4 +41,11 @@ connection master;
DROP TABLE IF EXISTS t;
sync_slave_with_master;
-exec cat var/mysqld.2/mysqld-slow.log | grep InnoDB_IO_r_ops | wc -l;
+connection slave;
+FLUSH LOGS;
+--let grep_file = $MYSQLTEST_VARDIR/mysqld.2/mysqld-slow.log
+--let grep_pattern = InnoDB_IO_r_ops
+--source grep.inc
+
+STOP SLAVE;
+-- source include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-master.opt b/mysql-test/suite/percona/percona_slow_extended-slave_statements-and-use_global_long_query_time-master.opt
index d600400af08..49038530c56 100644
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-master.opt
+++ b/mysql-test/suite/percona/percona_slow_extended-slave_statements-and-use_global_long_query_time-master.opt
@@ -1 +1 @@
---slow-query-log-file=percona_log_slow_slave_statements-master.log --long-query-time=1 \ No newline at end of file
+--slow-query-log-file=percona_log_slow_slave_statements-master.log --long-query-time=1
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements-slave.opt b/mysql-test/suite/percona/percona_slow_extended-slave_statements-and-use_global_long_query_time-slave.opt
index e276b0bcfc8..648f309f744 100644
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements-slave.opt
+++ b/mysql-test/suite/percona/percona_slow_extended-slave_statements-and-use_global_long_query_time-slave.opt
@@ -1 +1 @@
---slow-query-log-file=percona_log_slow_slave_statements-slave.log --long-query-time=0 \ No newline at end of file
+--slow-query-log-file=percona_log_slow_slave_statements-slave.log --long-query-time=1
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.result b/mysql-test/suite/percona/percona_slow_extended-slave_statements-and-use_global_long_query_time.result
index c17e7a3f508..e5f4568dd58 100644
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.result
+++ b/mysql-test/suite/percona/percona_slow_extended-slave_statements-and-use_global_long_query_time.result
@@ -1,19 +1,10 @@
-# Activate master-slave replication
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-# Make table t for test
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t;
CREATE TABLE t(id INT);
-# Start slave replication
START SLAVE;
+include/wait_for_slave_to_start.inc
INSERT INTO t VALUES (1);
-# Read information about master binlog
-# Sync(1) slave thread
-# Read and change log_slow_slave_statements to ON on slave
show variables like 'log_slow_slave_statements';
Variable_name Value
log_slow_slave_statements OFF
@@ -22,23 +13,20 @@ show variables like 'log_slow_slave_statements';
Variable_name Value
log_slow_slave_statements ON
INSERT INTO t VALUES (2);
-# Read information about master binlog
-# Sync slave(2) thread
-# Restart slave
STOP SLAVE;
+include/wait_for_slave_to_stop.inc
START SLAVE;
+include/wait_for_slave_to_start.inc
INSERT INTO t VALUES (3);
-# Read information about master binlog
-# Sync(3) slave thread
show variables like 'long_query_time';
Variable_name Value
long_query_time 1.000000
show global variables like 'long_query_time';
Variable_name Value
long_query_time 1.000000
-show global variables like 'use_global_long_query_time';
+show global variables like 'slow_query_log_use_global_control';
Variable_name Value
-use_global_long_query_time OFF
+slow_query_log_use_global_control
set global long_query_time=0;
show variables like 'long_query_time';
Variable_name Value
@@ -46,51 +34,49 @@ long_query_time 1.000000
show global variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
-show global variables like 'use_global_long_query_time';
+show global variables like 'slow_query_log_use_global_control';
Variable_name Value
-use_global_long_query_time OFF
+slow_query_log_use_global_control
INSERT INTO t VALUES (4);
-# Read information about master binlog
-# Sync slave(4) thread
show variables like 'long_query_time';
Variable_name Value
long_query_time 1.000000
show global variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
-show global variables like 'use_global_long_query_time';
+show global variables like 'slow_query_log_use_global_control';
Variable_name Value
-use_global_long_query_time OFF
-set global use_global_long_query_time=1;
+slow_query_log_use_global_control
+set global slow_query_log_use_global_control='long_query_time';
show variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
show global variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
-show global variables like 'use_global_long_query_time';
+show global variables like 'slow_query_log_use_global_control';
Variable_name Value
-use_global_long_query_time ON
+slow_query_log_use_global_control long_query_time
INSERT INTO t VALUES (5);
-# Read information about master binlog
-# Sync slave(5) thread
show variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
show global variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
-show global variables like 'use_global_long_query_time';
+show global variables like 'slow_query_log_use_global_control';
Variable_name Value
-use_global_long_query_time ON
+slow_query_log_use_global_control long_query_time
set global long_query_time=1;
-set global use_global_long_query_time=0;
+set global slow_query_log_use_global_control='';
+FLUSH LOGS;
# Analyse master slow_query_log
0
0
0
0
0
+FLUSH LOGS;
# Analyse slave slow_query_log
0
0
@@ -99,5 +85,5 @@ set global use_global_long_query_time=0;
1
set global log_slow_slave_statements=OFF;
DROP TABLE t;
-# Read information about master binlog
-# Sync slave(6) thread
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/percona_slow_extended-slave_statements-and-use_global_long_query_time.test b/mysql-test/suite/percona/percona_slow_extended-slave_statements-and-use_global_long_query_time.test
new file mode 100644
index 00000000000..c718b2c3d28
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-slave_statements-and-use_global_long_query_time.test
@@ -0,0 +1,107 @@
+-- source include/have_binlog_format_mixed_or_statement.inc
+-- source include/master-slave.inc
+
+connection master;
+-- disable_warnings
+DROP TABLE IF EXISTS t;
+-- enable_warnings
+CREATE TABLE t(id INT);
+
+-- disable_warnings
+connection slave;
+START SLAVE;
+-- source include/wait_for_slave_to_start.inc
+-- enable_warnings
+
+connection master;
+INSERT INTO t VALUES (1);
+sync_slave_with_master;
+
+connection slave;
+show variables like 'log_slow_slave_statements';
+set global log_slow_slave_statements=ON;
+show variables like 'log_slow_slave_statements';
+
+connection master;
+INSERT INTO t VALUES (2);
+sync_slave_with_master;
+connection slave;
+
+STOP SLAVE;
+-- source include/wait_for_slave_to_stop.inc
+START SLAVE;
+-- source include/wait_for_slave_to_start.inc
+
+connection master;
+INSERT INTO t VALUES (3);
+sync_slave_with_master;
+
+connection slave;
+show variables like 'long_query_time';
+show global variables like 'long_query_time';
+show global variables like 'slow_query_log_use_global_control';
+set global long_query_time=0;
+show variables like 'long_query_time';
+show global variables like 'long_query_time';
+show global variables like 'slow_query_log_use_global_control';
+
+connection master;
+INSERT INTO t VALUES (4);
+sync_slave_with_master;
+
+connection slave;
+show variables like 'long_query_time';
+show global variables like 'long_query_time';
+show global variables like 'slow_query_log_use_global_control';
+set global slow_query_log_use_global_control='long_query_time';
+show variables like 'long_query_time';
+show global variables like 'long_query_time';
+show global variables like 'slow_query_log_use_global_control';
+
+#-- echo # Make insert(5) on master
+connection master;
+INSERT INTO t VALUES (5);
+sync_slave_with_master;
+connection slave;
+show variables like 'long_query_time';
+show global variables like 'long_query_time';
+show global variables like 'slow_query_log_use_global_control';
+set global long_query_time=1;
+set global slow_query_log_use_global_control='';
+
+connection master;
+FLUSH LOGS;
+
+-- echo # Analyse master slow_query_log
+let $i=5;
+let $k=1;
+while($i)
+{
+ --let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_log_slow_slave_statements-master.log
+ --let grep_pattern = INSERT INTO t VALUES \($k\)
+ --source grep.inc
+ dec $i;
+ inc $k;
+}
+
+connection slave;
+FLUSH LOGS;
+
+-- echo # Analyse slave slow_query_log
+let $i=5;
+let $k=1;
+while($i)
+{
+ --let grep_file = $MYSQLTEST_VARDIR/mysqld.2/data/percona_log_slow_slave_statements-slave.log
+ --let grep_pattern = INSERT INTO t VALUES \($k\)
+ --source grep.inc
+ dec $i;
+ inc $k;
+}
+set global log_slow_slave_statements=OFF;
+
+connection master;
+DROP TABLE t;
+sync_slave_with_master;
+STOP SLAVE;
+-- source include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements-master.opt b/mysql-test/suite/percona/percona_slow_extended-slave_statements-master.opt
index dd94fd90a57..ebf25ddd37d 100644
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements-master.opt
+++ b/mysql-test/suite/percona/percona_slow_extended-slave_statements-master.opt
@@ -1 +1 @@
---slow-query-log-file=percona_log_slow_slave_statements-master.log --long-query-time=0 \ No newline at end of file
+--slow-query-log-file=percona_log_slow_slave_statements-master.log --long-query-time=0
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-slave.opt b/mysql-test/suite/percona/percona_slow_extended-slave_statements-slave.opt
index c79e637317b..96cd9004493 100644
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-slave.opt
+++ b/mysql-test/suite/percona/percona_slow_extended-slave_statements-slave.opt
@@ -1 +1 @@
---slow-query-log-file=percona_log_slow_slave_statements-slave.log --long-query-time=1 \ No newline at end of file
+--slow-query-log-file=percona_log_slow_slave_statements-slave.log --long-query-time=0
diff --git a/mysql-test/suite/percona/percona_slow_extended-slave_statements.result b/mysql-test/suite/percona/percona_slow_extended-slave_statements.result
new file mode 100644
index 00000000000..0548dc370b4
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-slave_statements.result
@@ -0,0 +1,94 @@
+include/master-slave.inc
+[connection master]
+DROP TABLE IF EXISTS t;
+CREATE TABLE t(id INT);
+START SLAVE;
+include/wait_for_slave_to_start.inc
+INSERT INTO t VALUES (1);
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements OFF
+set global log_slow_slave_statements=ON;
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements ON
+INSERT INTO t VALUES (2);
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements ON
+set global log_slow_slave_statements=ON;
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements ON
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements ON
+set global log_slow_slave_statements=ON;
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements ON
+INSERT INTO t VALUES (3);
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements ON
+set global log_slow_slave_statements=OFF;
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements OFF
+INSERT INTO t VALUES (4);
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements OFF
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements OFF
+INSERT INTO t VALUES (5);
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements OFF
+set global log_slow_slave_statements=ON;
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements ON
+INSERT INTO t VALUES (6);
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements ON
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+show variables like 'log_slow_slave_statements';
+Variable_name Value
+log_slow_slave_statements ON
+INSERT INTO t VALUES (7);
+FLUSH LOGS;
+# Analyse master slow_query_log
+1
+1
+1
+1
+1
+1
+1
+FLUSH LOGS;
+# Analyse slave slow_query_log
+0
+0
+1
+0
+0
+0
+1
+set global log_slow_slave_statements=OFF;
+DROP TABLE t;
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/percona_slow_extended-slave_statements.test b/mysql-test/suite/percona/percona_slow_extended-slave_statements.test
new file mode 100644
index 00000000000..88c74bab69b
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-slave_statements.test
@@ -0,0 +1,133 @@
+-- source include/have_binlog_format_statement.inc
+-- source include/master-slave.inc
+
+connection master;
+-- disable_warnings
+DROP TABLE IF EXISTS t;
+-- enable_warnings
+
+CREATE TABLE t(id INT);
+
+-- disable_warnings
+connection slave;
+START SLAVE;
+-- source include/wait_for_slave_to_start.inc
+-- enable_warnings
+
+connection master;
+INSERT INTO t VALUES (1);
+sync_slave_with_master;
+
+connection slave;
+show variables like 'log_slow_slave_statements';
+set global log_slow_slave_statements=ON;
+show variables like 'log_slow_slave_statements';
+
+connection master;
+INSERT INTO t VALUES (2);
+sync_slave_with_master;
+
+connection slave;
+show variables like 'log_slow_slave_statements';
+set global log_slow_slave_statements=ON;
+show variables like 'log_slow_slave_statements';
+
+STOP SLAVE;
+-- source include/wait_for_slave_to_stop.inc
+START SLAVE;
+-- source include/wait_for_slave_to_start.inc
+
+connection slave;
+show variables like 'log_slow_slave_statements';
+set global log_slow_slave_statements=ON;
+show variables like 'log_slow_slave_statements';
+
+connection master;
+INSERT INTO t VALUES (3);
+sync_slave_with_master;
+
+connection slave;
+show variables like 'log_slow_slave_statements';
+set global log_slow_slave_statements=OFF;
+show variables like 'log_slow_slave_statements';
+
+connection master;
+INSERT INTO t VALUES (4);
+sync_slave_with_master;
+
+connection slave;
+show variables like 'log_slow_slave_statements';
+
+STOP SLAVE;
+-- source include/wait_for_slave_to_stop.inc
+START SLAVE;
+-- source include/wait_for_slave_to_start.inc
+
+connection slave;
+show variables like 'log_slow_slave_statements';
+
+connection master;
+INSERT INTO t VALUES (5);
+sync_slave_with_master;
+
+connection slave;
+show variables like 'log_slow_slave_statements';
+set global log_slow_slave_statements=ON;
+show variables like 'log_slow_slave_statements';
+
+connection master;
+INSERT INTO t VALUES (6);
+sync_slave_with_master;
+
+connection slave;
+show variables like 'log_slow_slave_statements';
+
+STOP SLAVE;
+-- source include/wait_for_slave_to_stop.inc
+START SLAVE;
+-- source include/wait_for_slave_to_start.inc
+
+connection slave;
+show variables like 'log_slow_slave_statements';
+
+connection master;
+INSERT INTO t VALUES (7);
+sync_slave_with_master;
+
+connection master;
+FLUSH LOGS;
+
+-- echo # Analyse master slow_query_log
+let $i=7;
+let $k=1;
+while($i)
+{
+ --let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_log_slow_slave_statements-master.log
+ --let grep_pattern = INSERT INTO t VALUES \($k\)
+ --source grep.inc
+ dec $i;
+ inc $k;
+}
+
+connection slave;
+FLUSH LOGS;
+
+-- echo # Analyse slave slow_query_log
+let $i=7;
+let $k=1;
+while($i)
+{
+ --let grep_file = $MYSQLTEST_VARDIR/mysqld.2/data/percona_log_slow_slave_statements-slave.log
+ --let grep_pattern = INSERT INTO t VALUES \($k\)
+ --source grep.inc
+ dec $i;
+ inc $k;
+}
+set global log_slow_slave_statements=OFF;
+
+connection master;
+DROP TABLE t;
+sync_slave_with_master;
+
+STOP SLAVE;
+-- source include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/percona_slow_extended-slow_query_log_microseconds_timestamp-cl-master.opt b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_microseconds_timestamp-cl-master.opt
new file mode 100644
index 00000000000..c3ebcd95326
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_microseconds_timestamp-cl-master.opt
@@ -0,0 +1 @@
+--slow_query_log_timestamp_precision='microsecond'
diff --git a/mysql-test/suite/percona/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.result b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.result
new file mode 100644
index 00000000000..5355922bb45
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.result
@@ -0,0 +1,3 @@
+show global variables like 'slow_query_log_timestamp_precision';
+Variable_name Value
+slow_query_log_timestamp_precision microsecond
diff --git a/mysql-test/suite/percona/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.test b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.test
new file mode 100644
index 00000000000..8f6291e9897
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.test
@@ -0,0 +1 @@
+show global variables like 'slow_query_log_timestamp_precision';
diff --git a/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl-master.opt b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl-master.opt
new file mode 100644
index 00000000000..233b50a1f89
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl-master.opt
@@ -0,0 +1 @@
+--slow_query_log_timestamp_always
diff --git a/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.result b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.result
new file mode 100644
index 00000000000..13684fad10c
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.result
@@ -0,0 +1,3 @@
+show global variables like 'slow_query_log_timestamp_always';
+Variable_name Value
+slow_query_log_timestamp_always ON
diff --git a/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.test b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.test
new file mode 100644
index 00000000000..e73c4202869
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.test
@@ -0,0 +1 @@
+show global variables like 'slow_query_log_timestamp_always';
diff --git a/mysql-test/suite/percona/percona_slow_query_log-control_global_slow-master.opt b/mysql-test/suite/percona/percona_slow_extended-use_global_control-master.opt
index 91dd41305cd..bd62c08c475 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-control_global_slow-master.opt
+++ b/mysql-test/suite/percona/percona_slow_extended-use_global_control-master.opt
@@ -1 +1 @@
---slow-query-log-file=percona_slow_query_log-control_global_slow.log --long-query-time=1 \ No newline at end of file
+--slow-query-log-file=percona_slow_query_log-control_global_slow.log --long-query-time=1
diff --git a/mysql-test/suite/percona/percona_slow_extended-use_global_control.result b/mysql-test/suite/percona/percona_slow_extended-use_global_control.result
new file mode 100644
index 00000000000..699c95e9671
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-use_global_control.result
@@ -0,0 +1,12 @@
+SELECT sleep(2);
+sleep(2)
+0
+set global log_slow_verbosity=innodb;
+set global slow_query_log_use_global_control="log_slow_verbosity,long_query_time";
+SELECT sleep(2);
+sleep(2)
+0
+set global slow_query_log_use_global_control='';
+set global log_slow_verbosity='';
+FLUSH LOGS;
+1
diff --git a/mysql-test/suite/percona/percona_slow_extended-use_global_control.test b/mysql-test/suite/percona/percona_slow_extended-use_global_control.test
new file mode 100644
index 00000000000..199b652561c
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-use_global_control.test
@@ -0,0 +1,12 @@
+source include/have_xtradb.inc;
+SELECT sleep(2);
+set global log_slow_verbosity=innodb;
+set global slow_query_log_use_global_control="log_slow_verbosity,long_query_time";
+SELECT sleep(2);
+set global slow_query_log_use_global_control='';
+set global log_slow_verbosity='';
+
+FLUSH LOGS;
+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-control_global_slow.log
+--let grep_pattern = No InnoDB statistics available for this query
+--source grep.inc
diff --git a/mysql-test/suite/percona/percona_slow_extended-use_global_long_query_time-master.opt b/mysql-test/suite/percona/percona_slow_extended-use_global_long_query_time-master.opt
new file mode 100644
index 00000000000..16b6ca5b714
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-use_global_long_query_time-master.opt
@@ -0,0 +1 @@
+--slow-query-log-file=percona_slow_query_log-use_global_long_query_time.log --long-query-time=2 --slow_query_log_use_global_control=long_query_time --slow-query-log=OFF
diff --git a/mysql-test/suite/percona/percona_slow_extended-use_global_long_query_time.result b/mysql-test/suite/percona/percona_slow_extended-use_global_long_query_time.result
new file mode 100644
index 00000000000..e89edf0430f
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-use_global_long_query_time.result
@@ -0,0 +1,46 @@
+SET GLOBAL SLOW_QUERY_LOG=ON;
+SELECT sleep(1);
+sleep(1)
+0
+SELECT sleep(3);
+sleep(3)
+0
+SELECT sleep(5);
+sleep(5)
+0
+set global long_query_time=4;
+set global slow_query_log_use_global_control='long_query_time';
+SELECT sleep(1);
+sleep(1)
+0
+SELECT sleep(3);
+sleep(3)
+0
+SELECT sleep(5);
+sleep(5)
+0
+set global long_query_time=2;
+set global slow_query_log_use_global_control='';
+SET GLOBAL SLOW_QUERY_LOG=OFF;
+FLUSH LOGS;
+3
+show global variables like 'slow_query_log_use_global_control';
+Variable_name Value
+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';
+Variable_name Value
+slow_query_log_use_global_control long_query_time
+set global slow_query_log_use_global_control='log_slow_filter,long_query_time';
+show global variables like 'slow_query_log_use_global_control';
+Variable_name Value
+slow_query_log_use_global_control log_slow_filter,long_query_time
+set global slow_query_log_use_global_control='log_slow_filter';
+show global variables like 'slow_query_log_use_global_control';
+Variable_name Value
+slow_query_log_use_global_control log_slow_filter
+set global slow_query_log_use_global_control='';
+show global variables like 'slow_query_log_use_global_control';
+Variable_name Value
+slow_query_log_use_global_control
+set global slow_query_log_use_global_control='long_query_time';
diff --git a/mysql-test/suite/percona/percona_slow_extended-use_global_long_query_time.test b/mysql-test/suite/percona/percona_slow_extended-use_global_long_query_time.test
new file mode 100644
index 00000000000..61b2dabd23d
--- /dev/null
+++ b/mysql-test/suite/percona/percona_slow_extended-use_global_long_query_time.test
@@ -0,0 +1,40 @@
+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';
diff --git a/mysql-test/suite/percona/percona_slow_query_log-control_global_slow.result b/mysql-test/suite/percona/percona_slow_query_log-control_global_slow.result
deleted file mode 100644
index bc6ce100b35..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-control_global_slow.result
+++ /dev/null
@@ -1,12 +0,0 @@
-SELECT sleep(2);
-sleep(2)
-0
-set global log_slow_verbosity=innodb;
-set global use_global_log_slow_control="log_slow_verbosity,long_query_time";
-SELECT sleep(2);
-sleep(2)
-0
-set global use_global_log_slow_control=none;
-set global log_slow_verbosity=microtime;
-cat MYSQLD_DATADIR/percona_slow_query_log-control_global_slow.log | grep -c "No InnoDB statistics available for this query"
-1
diff --git a/mysql-test/suite/percona/percona_slow_query_log-control_global_slow.test b/mysql-test/suite/percona/percona_slow_query_log-control_global_slow.test
deleted file mode 100644
index 1c3dc937937..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-control_global_slow.test
+++ /dev/null
@@ -1,14 +0,0 @@
---source include/not_windows.inc
-
-source include/have_innodb.inc;
-SELECT sleep(2);
-set global log_slow_verbosity=innodb;
-set global use_global_log_slow_control="log_slow_verbosity,long_query_time";
-SELECT sleep(2);
-set global use_global_log_slow_control=none;
-set global log_slow_verbosity=microtime;
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-control_global_slow.log | grep -c "No InnoDB statistics available for this query";
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo '$cmd';
-exec $cmd;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.result b/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.result
deleted file mode 100644
index ff42937fa4a..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.result
+++ /dev/null
@@ -1,9 +0,0 @@
-SELECT sleep(2);
-sleep(2)
-0
-set log_slow_verbosity=innodb;
-SELECT sleep(2);
-sleep(2)
-0
-cat MYSQLD_DATADIR/percona_slow_query_log-log_slow_verbosity.log | grep -c "No InnoDB statistics available for this query"
-1
diff --git a/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.test b/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.test
deleted file mode 100644
index d1dc324fced..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.test
+++ /dev/null
@@ -1,15 +0,0 @@
--- source include/not_windows.inc
-
-source include/have_innodb.inc;
-
-SELECT sleep(2);
-
-set log_slow_verbosity=innodb;
-
-SELECT sleep(2);
-
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-log_slow_verbosity.log | grep -c "No InnoDB statistics available for this query";
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo '$cmd';
-exec $cmd;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-long_query_time.result b/mysql-test/suite/percona/percona_slow_query_log-long_query_time.result
deleted file mode 100644
index 03f8745ca62..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-long_query_time.result
+++ /dev/null
@@ -1,21 +0,0 @@
-SELECT sleep(1);
-sleep(1)
-0
-SELECT sleep(6);
-sleep(6)
-0
-SELECT sleep(10);
-sleep(10)
-0
-set long_query_time=8;
-SELECT sleep(1);
-sleep(1)
-0
-SELECT sleep(6);
-sleep(6)
-0
-SELECT sleep(12);
-sleep(12)
-0
-cat MYSQLD_DATADIR/percona_slow_query_log-long_query_time.log | grep -c Query_time
-3
diff --git a/mysql-test/suite/percona/percona_slow_query_log-long_query_time.test b/mysql-test/suite/percona/percona_slow_query_log-long_query_time.test
deleted file mode 100644
index 4161690e2ef..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-long_query_time.test
+++ /dev/null
@@ -1,18 +0,0 @@
-source include/not_windows.inc;
-source include/have_innodb.inc;
-
-SELECT sleep(1);
-SELECT sleep(6);
-SELECT sleep(10);
-
-set long_query_time=8;
-
-SELECT sleep(1);
-SELECT sleep(6);
-SELECT sleep(12);
-
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-long_query_time.log | grep -c Query_time;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo '$cmd';
-exec $cmd;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.result b/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.result
deleted file mode 100644
index fbfc954481e..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.result
+++ /dev/null
@@ -1,12 +0,0 @@
-SELECT sleep(2);
-sleep(2)
-0
-set global slow_query_log_microseconds_timestamp=ON;
-SELECT sleep(2);
-sleep(2)
-0
-set global slow_query_log_microseconds_timestamp=OFF;
-cat MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+'
-1
-cat MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+'
-2
diff --git a/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.test b/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.test
deleted file mode 100644
index bceada68d79..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.test
+++ /dev/null
@@ -1,21 +0,0 @@
-source include/not_windows.inc;
-source include/have_innodb.inc;
-
-SELECT sleep(2);
-
-set global slow_query_log_microseconds_timestamp=ON;
-
-SELECT sleep(2);
-
-set global slow_query_log_microseconds_timestamp=OFF;
-
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+';
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo "$cmd";
-exec $cmd;
-
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+';
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo "$cmd";
-exec $cmd;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time-master.opt b/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time-master.opt
deleted file mode 100644
index e2f3b6f2041..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_slow_query_log-use_global_long_query_time.log --long-query-time=2 \ No newline at end of file
diff --git a/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.result b/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.result
deleted file mode 100644
index e294525fdd2..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.result
+++ /dev/null
@@ -1,59 +0,0 @@
-SELECT sleep(1);
-sleep(1)
-0
-SELECT sleep(3);
-sleep(3)
-0
-SELECT sleep(5);
-sleep(5)
-0
-set global long_query_time=4;
-set global use_global_long_query_time=1;
-SELECT sleep(1);
-sleep(1)
-0
-SELECT sleep(3);
-sleep(3)
-0
-SELECT sleep(5);
-sleep(5)
-0
-set global long_query_time=2;
-set global use_global_long_query_time=0;
-cat MYSQLD_DATADIR/percona_slow_query_log-use_global_long_query_time.log | grep -c Query_time
-3
-show global variables like 'use_global_log_slow_control';
-Variable_name Value
-use_global_log_slow_control none
-show global variables like 'use_global_long_query_time';
-Variable_name Value
-use_global_long_query_time OFF
-set global use_global_log_slow_control = long_query_time;
-show global variables like 'use_global_log_slow_control';
-Variable_name Value
-use_global_log_slow_control long_query_time
-show global variables like 'use_global_long_query_time';
-Variable_name Value
-use_global_long_query_time ON
-set global use_global_log_slow_control = log_slow_filter;
-show global variables like 'use_global_log_slow_control';
-Variable_name Value
-use_global_log_slow_control log_slow_filter
-show global variables like 'use_global_long_query_time';
-Variable_name Value
-use_global_long_query_time OFF
-set global use_global_long_query_time = ON;
-show global variables like 'use_global_log_slow_control';
-Variable_name Value
-use_global_log_slow_control log_slow_filter,long_query_time
-show global variables like 'use_global_long_query_time';
-Variable_name Value
-use_global_long_query_time ON
-set global use_global_long_query_time = OFF;
-show global variables like 'use_global_log_slow_control';
-Variable_name Value
-use_global_log_slow_control log_slow_filter
-show global variables like 'use_global_long_query_time';
-Variable_name Value
-use_global_long_query_time OFF
-set global use_global_log_slow_control = none;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.test b/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.test
deleted file mode 100644
index da627ae72b0..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.test
+++ /dev/null
@@ -1,43 +0,0 @@
-source include/not_windows.inc;
-source include/have_innodb.inc;
-
-SELECT sleep(1);
-SELECT sleep(3);
-SELECT sleep(5);
-
-set global long_query_time=4;
-set global use_global_long_query_time=1;
-
-SELECT sleep(1);
-SELECT sleep(3);
-SELECT sleep(5);
-
-set global long_query_time=2;
-set global use_global_long_query_time=0;
-
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-use_global_long_query_time.log | grep -c Query_time;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo '$cmd';
-exec $cmd;
-
-show global variables like 'use_global_log_slow_control';
-show global variables like 'use_global_long_query_time';
-
-set global use_global_log_slow_control = long_query_time;
-show global variables like 'use_global_log_slow_control';
-show global variables like 'use_global_long_query_time';
-
-set global use_global_log_slow_control = log_slow_filter;
-show global variables like 'use_global_log_slow_control';
-show global variables like 'use_global_long_query_time';
-
-set global use_global_long_query_time = ON;
-show global variables like 'use_global_log_slow_control';
-show global variables like 'use_global_long_query_time';
-
-set global use_global_long_query_time = OFF;
-show global variables like 'use_global_log_slow_control';
-show global variables like 'use_global_long_query_time';
-
-set global use_global_log_slow_control = none;
diff --git a/mysql-test/suite/percona/percona_sql_no_fcache.test b/mysql-test/suite/percona/percona_sql_no_fcache.test
index da0c2ecef7d..1ed8be2196b 100644
--- a/mysql-test/suite/percona/percona_sql_no_fcache.test
+++ b/mysql-test/suite/percona/percona_sql_no_fcache.test
@@ -8,4 +8,4 @@ insert into t values (1),(2),(3);
SELECT SQL_NO_FCACHE SLEEP(0);
SELECT /*!40001 SQL_NO_CACHE */ /*!50084 SQL_NO_FCACHE */ * FROM t;
-DROP TABLE t; \ No newline at end of file
+DROP TABLE t;
diff --git a/mysql-test/suite/percona/percona_status_wait_query_cache_mutex.result b/mysql-test/suite/percona/percona_status_wait_query_cache_mutex.result
index 348dcef4d30..f951428abc7 100644
--- a/mysql-test/suite/percona/percona_status_wait_query_cache_mutex.result
+++ b/mysql-test/suite/percona/percona_status_wait_query_cache_mutex.result
@@ -18,10 +18,10 @@ SET SESSION debug="+d,status_wait_query_cache_mutex_sleep";
SELECT number from t where id > 0;
SET SESSION debug="+d,status_wait_query_cache_mutex_sleep";
SHOW PROCESSLIST;
-Id User Host db Command Time State Info
-Id root localhost test Sleep Time NULL
-Id root localhost test Query Time Waiting on query cache mutex SELECT number from t where id > 0
-Id root localhost test Query Time Waiting on query cache mutex SELECT number from t where id > 0
-Id root localhost test Query Time NULL SHOW PROCESSLIST
+Id User Host db Command Time State Info Rows_sent Rows_examined Rows_read
+Id root localhost test Sleep Time NULL Rows_sent Rows_examined Rows_read
+Id root localhost test Query Time Waiting on query cache mutex SELECT number from t where id > 0 Rows_sent Rows_examined Rows_read
+Id root localhost test Query Time Waiting on query cache mutex SELECT number from t where id > 0 Rows_sent Rows_examined Rows_read
+Id root localhost test Query Time NULL SHOW PROCESSLIST Rows_sent Rows_examined Rows_read
DROP TABLE t;
set GLOBAL query_cache_size=0;
diff --git a/mysql-test/suite/percona/percona_status_wait_query_cache_mutex.test b/mysql-test/suite/percona/percona_status_wait_query_cache_mutex.test
index 64a9fe7db71..35e2d0ac549 100644
--- a/mysql-test/suite/percona/percona_status_wait_query_cache_mutex.test
+++ b/mysql-test/suite/percona/percona_status_wait_query_cache_mutex.test
@@ -30,8 +30,8 @@ SLEEP 1.0;
--connection conn2
--error 0, ER_UNKNOWN_SYSTEM_VARIABLE
SET SESSION debug="+d,status_wait_query_cache_mutex_sleep";
---replace_column 1 Id 6 Time
+--replace_column 1 Id 6 Time 9 Rows_sent 10 Rows_examined 11 Rows_read
SHOW PROCESSLIST;
DROP TABLE t;
-set GLOBAL query_cache_size=0; \ No newline at end of file
+set GLOBAL query_cache_size=0;
diff --git a/mysql-test/suite/percona/percona_suppress_log_warning_1592.result b/mysql-test/suite/percona/percona_suppress_log_warning_1592.result
deleted file mode 100644
index 4715499b08f..00000000000
--- a/mysql-test/suite/percona/percona_suppress_log_warning_1592.result
+++ /dev/null
@@ -1,28 +0,0 @@
-SET @old_log_warnings = @@log_warnings;
-SET @old_suppress_log_warning_1592 = @@suppress_log_warning_1592;
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(20));
-SET GLOBAL SUPPRESS_LOG_WARNING_1592 = 0;
-SET GLOBAL LOG_WARNINGS = 0;
-INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-Warnings:
-Note 1592 Statement may not be safe to log in statement format.
-SET GLOBAL LOG_WARNINGS = 1;
-INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-Warnings:
-Note 1592 Statement may not be safe to log in statement format.
-SET GLOBAL SUPPRESS_LOG_WARNING_1592 = 1;
-SET GLOBAL LOG_WARNINGS = 0;
-INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-Warnings:
-Note 1592 Statement may not be safe to log in statement format.
-SET GLOBAL LOG_WARNINGS = 1;
-INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-Warnings:
-Note 1592 Statement may not be safe to log in statement format.
-DROP TABLE t1;
-SET GLOBAL log_warnings = @old_log_warnings;
-SET GLOBAL suppress_log_warning_1592 = @old_suppress_log_warning_1592;
-# Count the number of times the "Unsafe" message was printed
-# to the error log.
-Occurrences: 1
diff --git a/mysql-test/suite/percona/percona_xtradb_bug317074.result b/mysql-test/suite/percona/percona_xtradb_bug317074.result
index 82a98844652..7c1876fb7bf 100644
--- a/mysql-test/suite/percona/percona_xtradb_bug317074.result
+++ b/mysql-test/suite/percona/percona_xtradb_bug317074.result
@@ -1,4 +1,5 @@
SET @old_innodb_file_format=@@innodb_file_format;
+SET @old_innodb_file_format_max=@@innodb_file_format_max;
SET @old_innodb_file_per_table=@@innodb_file_per_table;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=ON;
diff --git a/mysql-test/suite/percona/percona_xtradb_bug317074.test b/mysql-test/suite/percona/percona_xtradb_bug317074.test
index 029e0f8fcdf..5f9db073060 100644
--- a/mysql-test/suite/percona/percona_xtradb_bug317074.test
+++ b/mysql-test/suite/percona/percona_xtradb_bug317074.test
@@ -1,8 +1,8 @@
-- source include/have_xtradb.inc
SET @old_innodb_file_format=@@innodb_file_format;
+SET @old_innodb_file_format_max=@@innodb_file_format_max;
SET @old_innodb_file_per_table=@@innodb_file_per_table;
-let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=ON;
@@ -44,5 +44,5 @@ ALTER TABLE test1 ENGINE=MyISAM;
DROP TABLE test1;
SET GLOBAL innodb_file_format=@old_innodb_file_format;
+SET GLOBAL innodb_file_format_max=@old_innodb_file_format_max;
SET GLOBAL innodb_file_per_table=@old_innodb_file_per_table;
-eval set global innodb_file_format_check=$innodb_file_format_check_orig;
diff --git a/mysql-test/suite/percona/userstat_bug602047.result b/mysql-test/suite/percona/userstat_bug602047.result
new file mode 100644
index 00000000000..966439b817d
--- /dev/null
+++ b/mysql-test/suite/percona/userstat_bug602047.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS t1;
+SET GLOBAL userstat=ON;
+CREATE TABLE t1 ( id int(10), PRIMARY KEY (id)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+10
+SELECT ROWS_READ FROM information_schema.table_statistics WHERE TABLE_NAME='t1';
+ROWS_READ
+10
+SELECT ROWS_READ FROM information_schema.index_statistics WHERE TABLE_NAME='t1';
+ROWS_READ
+10
+SET GLOBAL userstat=OFF;
+DROP TABLE t1;
diff --git a/mysql-test/suite/percona/userstat_bug602047.test b/mysql-test/suite/percona/userstat_bug602047.test
new file mode 100644
index 00000000000..31fc36b80e2
--- /dev/null
+++ b/mysql-test/suite/percona/userstat_bug602047.test
@@ -0,0 +1,12 @@
+--source include/have_xtradb.inc
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+SET GLOBAL userstat=ON;
+CREATE TABLE t1 ( id int(10), PRIMARY KEY (id)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+SELECT COUNT(*) FROM t1;
+SELECT ROWS_READ FROM information_schema.table_statistics WHERE TABLE_NAME='t1';
+SELECT ROWS_READ FROM information_schema.index_statistics WHERE TABLE_NAME='t1';
+SET GLOBAL userstat=OFF;
+DROP TABLE t1;