Merge lp:~akopytov/percona-server/slow_extended_and_rtd_fixes-5.5 into lp:percona-server/5.5

Proposed by Alexey Kopytov on 2011-07-27
Status: Merged
Merged at revision: 145
Proposed branch: lp:~akopytov/percona-server/slow_extended_and_rtd_fixes-5.5
Merge into: lp:percona-server/5.5
Diff against target: 6277 lines (+3657/-2233)
7 files modified
patches/log_connection_error.patch (+10/-9)
patches/microsec_process.patch (+5/-5)
patches/mysql-test.diff (+22/-57)
patches/response_time_distribution.patch (+2542/-1123)
patches/series (+1/-1)
patches/slow_extended.patch (+1058/-1019)
patches/userstat.patch (+19/-19)
To merge this branch: bzr merge lp:~akopytov/percona-server/slow_extended_and_rtd_fixes-5.5
Reviewer Review Type Date Requested Status
Oleg Tsarev (community) 2011-09-07 Approve on 2011-09-07
Stewart Smith (community) 2011-07-27 Needs Fixing on 2011-08-06
Review via email: mp+69409@code.launchpad.net
To post a comment you must log in.
Stewart Smith (stewart) wrote :

a few conflicts with 5.5.14

review: Needs Fixing
Alexey Kopytov (akopytov) wrote :

Fixed conflicts with trunk.

142. By Alexey Kopytov on 2011-09-06

Manual merge from trunk.

143. By Alexey Kopytov on 2011-09-06

Manual merge from trunk.

144. By Alexey Kopytov on 2011-09-06

Null merge from trunk.

Oleg Tsarev (tsarev) wrote :

1. Please remove empty mysql-test/log_connection_error.patch
2. Please remove "diff -ruN ..." strings. Looks like you don't respect quiltrc config file from root of branch

All other looks fine.

review: Needs Fixing
145. By Alexey Kopytov on 2011-09-07

Manual merge from trunk.

Alexey Kopytov (akopytov) wrote :

Removed the empty dir.
The only patches containing "diff -ruN ..." was microsec_process.patch (which I had to revert during a merge, fixed) and innodb_fake_changes.patch which I didn't touch.

Oleg Tsarev (tsarev) :
review: Approve
Oleg Tsarev (tsarev) wrote :

Ok

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'patches/log_connection_error.patch'
2--- patches/log_connection_error.patch 2011-09-03 15:15:31 +0000
3+++ patches/log_connection_error.patch 2011-09-07 14:03:34 +0000
4@@ -51,7 +51,7 @@
5 goto errorconn;
6 --- /dev/null
7 +++ b/mysql-test/r/percona_log_connection_error.result
8-@@ -0,0 +1,15 @@
9+@@ -0,0 +1,16 @@
10 +SET @old_max_connections = @@max_connections;
11 +SET @old_log_warnings = @@log_warnings;
12 +SET GLOBAL max_connections=2;
13@@ -66,7 +66,8 @@
14 +ERROR HY000: Too many connections
15 +SET GLOBAL max_connections = @old_max_connections;
16 +SET GLOBAL log_warnings = @old_log_warnings;
17-+1
18++[log_grep.inc] file: percona.log_connection_error.err pattern: Too many connections
19++[log_grep.inc] lines: 1
20 --- /dev/null
21 +++ b/mysql-test/t/percona_log_connection_error-master.opt
22 @@ -0,0 +1 @@
23@@ -121,10 +122,10 @@
24 + # does not know the location of its .err log, use default location
25 + let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err;
26 +}
27-+# Assign env variable LOG_ERROR
28-+let LOG_ERROR=$log_error_;
29-+
30-+--let grep_file = $log_error
31-+--let grep_pattern = Too many connections
32-+--source include/grep.inc
33-+exec $cmd;
34++
35++--let log_error=$log_error_
36++--let log_file=percona.log_connection_error.err
37++--let log_file_full_path=$log_error
38++--let grep_pattern= Too many connections
39++--source include/log_grep.inc
40++
41
42=== modified file 'patches/microsec_process.patch'
43--- patches/microsec_process.patch 2011-08-09 20:52:20 +0000
44+++ patches/microsec_process.patch 2011-09-07 14:03:34 +0000
45@@ -5,8 +5,8 @@
46 #!!! notice !!!
47 # Any small change to this file in the main branch
48 # should be done or reviewed by the maintainer!
49---- /dev/null
50-+++ b/patch_info/microsec_process.info
51+--- /dev/null 1970-01-01 09:00:00.000000000 +0900
52++++ b/patch_info/microsec_process.info 2010-12-02 20:41:41.616069579 +0900
53 @@ -0,0 +1,8 @@
54 +File=microsec_process.patch
55 +Name=Adds INFOMATION_SCHEMA.PROCESSLIST with TIME_MS column
56@@ -16,8 +16,8 @@
57 +Comment=
58 +2010-01
59 +Ported to 5.1.42
60---- a/sql/sql_show.cc
61-+++ b/sql/sql_show.cc
62+--- a/sql/sql_show.cc 2010-12-02 19:22:40.054024541 +0900
63++++ b/sql/sql_show.cc 2010-12-02 20:41:41.622941425 +0900
64 @@ -1890,7 +1890,8 @@
65 TABLE *table= tables->table;
66 CHARSET_INFO *cs= system_charset_info;
67@@ -39,7 +39,7 @@
68 if (schema_table_store_record(thd, table))
69 {
70 mysql_mutex_unlock(&LOCK_thread_count);
71-@@ -7441,6 +7446,8 @@
72+@@ -7409,6 +7414,8 @@
73 {"STATE", 64, MYSQL_TYPE_STRING, 0, 1, "State", SKIP_OPEN_TABLE},
74 {"INFO", PROCESS_LIST_INFO_WIDTH, MYSQL_TYPE_STRING, 0, 1, "Info",
75 SKIP_OPEN_TABLE},
76
77=== modified file 'patches/mysql-test.diff'
78--- patches/mysql-test.diff 2011-09-03 15:15:31 +0000
79+++ patches/mysql-test.diff 2011-09-07 14:03:34 +0000
80@@ -1247,9 +1247,18 @@
81
82 # This is only present in debug builds.
83 delete from t2 where variable_name='innodb_change_buffering_debug';
84+@@ -77,7 +77,7 @@
85+ where length(variable_name) > 50;
86+
87+ select variable_name as `There should be *no* variables listed below:` from t2
88+- left join t1 on variable_name=test_name where test_name is null;
89++ left join t1 on variable_name=test_name where test_name is null order by 1;
90+
91+ drop table t1;
92+ drop table t2;
93 --- a/mysql-test/suite/sys_vars/r/all_vars.result
94 +++ b/mysql-test/suite/sys_vars/r/all_vars.result
95-@@ -1,8 +1,8 @@
96+@@ -1,23 +1,23 @@
97 create table t1 (test_name text);
98 create table t2 (variable_name text);
99 load data infile "MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1;
100@@ -1260,72 +1269,27 @@
101 delete from t2 where variable_name='innodb_change_buffering_debug';
102 update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_");
103 select variable_name as `There should be *no* long test name listed below:` from t2
104-@@ -11,13 +11,13 @@
105+ where length(variable_name) > 50;
106+ There should be *no* long test name listed below:
107 select variable_name as `There should be *no* variables listed below:` from t2
108- left join t1 on variable_name=test_name where test_name is null;
109+-left join t1 on variable_name=test_name where test_name is null;
110++left join t1 on variable_name=test_name where test_name is null order by 1;
111 There should be *no* variables listed below:
112 -INNODB_ROLLBACK_SEGMENTS
113 -INNODB_STATS_METHOD
114 INNODB_FILE_FORMAT_MAX
115++INNODB_FILE_FORMAT_MAX
116++INNODB_LARGE_PREFIX
117 INNODB_LARGE_PREFIX
118 INNODB_ROLLBACK_SEGMENTS
119++INNODB_ROLLBACK_SEGMENTS
120++INNODB_STATS_METHOD
121 INNODB_STATS_METHOD
122- INNODB_FILE_FORMAT_MAX
123- INNODB_LARGE_PREFIX
124-+INNODB_ROLLBACK_SEGMENTS
125-+INNODB_STATS_METHOD
126+-INNODB_FILE_FORMAT_MAX
127+-INNODB_LARGE_PREFIX
128 drop table t1;
129 drop table t2;
130 --- /dev/null
131-+++ b/mysql-test/include/log_grep.inc
132-@@ -0,0 +1,17 @@
133-+--disable_query_log
134-+--echo [log_grep.inc] file: $log_file pattern: $grep_pattern
135-+perl;
136-+ $log_file= $ENV{'log_file'};
137-+ $log_file_full_path= $ENV{'log_file_full_path'};
138-+ $grep_pattern= $ENV{'grep_pattern'};
139-+
140-+ open(FILE, "$log_file_full_path")
141-+ or die("Cannot open file $log_file_full_path: $!\n");
142-+
143-+ $lines = 0;
144-+ while(<FILE>) {
145-+ $lines++ if (/$grep_pattern/);
146-+ }
147-+ close(FILE);
148-+ print "[log_grep.inc] lines: $lines\n";
149-+EOF
150---- /dev/null
151-+++ b/mysql-test/include/log_start.inc
152-@@ -0,0 +1,16 @@
153-+--let slow_query_log_file_old=`SELECT Variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE Variable_name = 'slow_query_log_file';`
154-+--let slow_query_log_old=`SELECT Variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE Variable_name = 'slow_query_log';`
155-+--disable_query_log
156-+--let log_file_full_path = $MYSQLTEST_VARDIR/$log_file
157-+SET GLOBAL slow_query_log=0;
158-+perl;
159-+ $log_file_full_path= $ENV{'log_file_full_path'};
160-+ unlink $log_file_full_path;
161-+ open(FILE, '>', $log_file_full_path)
162-+ or die "Cannot create log file $log_file_full_path, reason: $!";
163-+ close(FILE);
164-+EOF
165-+--echo [log_start.inc] $log_file
166-+EVAL SET GLOBAL slow_query_log_file="$log_file_full_path";
167-+SET GLOBAL slow_query_log=1;
168-+--enable_query_log
169---- /dev/null
170-+++ b/mysql-test/include/log_stop.inc
171-@@ -0,0 +1,7 @@
172-+--disable_query_log
173-+FLUSH LOGS;
174-+SET GLOBAL slow_query_log=0;
175-+--echo [log_stop.inc] $log_file
176-+EVAL SET GLOBAL slow_query_log_file= "$slow_query_log_file_old";
177-+EVAL SET GLOBAL slow_query_log= $slow_query_log_old ;
178-+--enable_query_log
179---- /dev/null
180 +++ b/mysql-test/include/percona_server_variables.inc
181 @@ -0,0 +1,3 @@
182 +--source include/have_response_time_distribution.inc
183@@ -1333,7 +1297,7 @@
184 +SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
185 --- /dev/null
186 +++ b/mysql-test/r/percona_server_variables_debug.result
187-@@ -0,0 +1,372 @@
188+@@ -0,0 +1,373 @@
189 +SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
190 +Variable_name
191 +AUTOCOMMIT
192@@ -1612,6 +1576,7 @@
193 +QUERY_CACHE_STRIP_COMMENTS
194 +QUERY_CACHE_TYPE
195 +QUERY_CACHE_WLOCK_INVALIDATE
196++QUERY_EXEC_TIME
197 +QUERY_PREALLOC_SIZE
198 +QUERY_RESPONSE_TIME_RANGE_BASE
199 +QUERY_RESPONSE_TIME_STATS
200
201=== modified file 'patches/response_time_distribution.patch'
202--- patches/response_time_distribution.patch 2011-09-03 15:15:31 +0000
203+++ patches/response_time_distribution.patch 2011-09-07 14:03:34 +0000
204@@ -40,6 +40,2531 @@
205 #define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */
206 #define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */
207 --- /dev/null
208++++ b/mysql-test/include/have_response_time_distribution.inc
209+@@ -0,0 +1,4 @@
210++-- require r/have_response_time_distribution.require
211++disable_query_log;
212++show variables like 'have_response_time_distribution';
213++enable_query_log;
214+--- /dev/null
215++++ b/mysql-test/include/query_response_time.inc
216+@@ -0,0 +1,39 @@
217++SET SESSION query_exec_time=0.1;
218++
219++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
220++EVAL SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=$base;
221++FLUSH QUERY_RESPONSE_TIME;
222++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
223++
224++SET SESSION query_exec_time=0.31; SELECT 1;
225++SET SESSION query_exec_time=0.32; SELECT 1;
226++SET SESSION query_exec_time=0.33; SELECT 1;
227++SET SESSION query_exec_time=0.34; SELECT 1;
228++SET SESSION query_exec_time=0.35; SELECT 1;
229++SET SESSION query_exec_time=0.36; SELECT 1;
230++SET SESSION query_exec_time=0.37; SELECT 1;
231++SET SESSION query_exec_time=0.38; SELECT 1;
232++SET SESSION query_exec_time=0.39; SELECT 1;
233++SET SESSION query_exec_time=0.4; SELECT 1;
234++SET SESSION query_exec_time=1.1; SELECT 1;
235++SET SESSION query_exec_time=1.2; SELECT 1;
236++SET SESSION query_exec_time=1.3; SELECT 1;
237++SET SESSION query_exec_time=1.5; SELECT 1;
238++SET SESSION query_exec_time=1.4; SELECT 1;
239++SET SESSION query_exec_time=0.5; SELECT 1;
240++SET SESSION query_exec_time=2.1; SELECT 1;
241++SET SESSION query_exec_time=2.3; SELECT 1;
242++SET SESSION query_exec_time=2.5; SELECT 1;
243++SET SESSION query_exec_time=3.1; SELECT 1;
244++SET SESSION query_exec_time=4.1; SELECT 1;
245++SET SESSION query_exec_time=5.1; SELECT 1;
246++
247++SET SESSION query_exec_time=0.1;
248++
249++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
250++
251++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
252++SHOW QUERY_RESPONSE_TIME;
253++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
254++
255++SET SESSION query_exec_time=default;
256+--- /dev/null
257++++ b/mysql-test/include/query_response_time-replication.inc
258+@@ -0,0 +1,57 @@
259++connection master;
260++
261++CREATE TABLE t(id INT);
262++
263++connection slave;
264++SET GLOBAL query_exec_time = 0.1;
265++--source include/restart_slave_sql.inc
266++
267++connection slave;
268++
269++SET SESSION query_exec_time=0.1;
270++
271++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
272++--eval SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=$base
273++FLUSH QUERY_RESPONSE_TIME;
274++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
275++
276++connection master;
277++
278++SET SESSION query_exec_time = 0.31; INSERT INTO t VALUES(1);
279++SET SESSION query_exec_time = 0.32; INSERT INTO t VALUES(1);
280++SET SESSION query_exec_time = 0.33; INSERT INTO t VALUES(1);
281++SET SESSION query_exec_time = 0.34; INSERT INTO t VALUES(1);
282++SET SESSION query_exec_time = 0.35; INSERT INTO t VALUES(1);
283++SET SESSION query_exec_time = 0.36; INSERT INTO t VALUES(1);
284++SET SESSION query_exec_time = 0.37; INSERT INTO t VALUES(1);
285++SET SESSION query_exec_time = 0.38; INSERT INTO t VALUES(1);
286++SET SESSION query_exec_time = 0.39; INSERT INTO t VALUES(1);
287++SET SESSION query_exec_time = 0.4; INSERT INTO t VALUES(1);
288++SET SESSION query_exec_time = 1.1; INSERT INTO t VALUES(1);
289++SET SESSION query_exec_time = 1.2; INSERT INTO t VALUES(1);
290++SET SESSION query_exec_time = 1.3; INSERT INTO t VALUES(1);
291++SET SESSION query_exec_time = 1.5; INSERT INTO t VALUES(1);
292++SET SESSION query_exec_time = 1.4; INSERT INTO t VALUES(1);
293++SET SESSION query_exec_time = 0.5; INSERT INTO t VALUES(1);
294++SET SESSION query_exec_time = 2.1; INSERT INTO t VALUES(1);
295++SET SESSION query_exec_time = 2.3; INSERT INTO t VALUES(1);
296++SET SESSION query_exec_time = 2.5; INSERT INTO t VALUES(1);
297++SET SESSION query_exec_time = 3.1; INSERT INTO t VALUES(1);
298++SET SESSION query_exec_time = 4.1; INSERT INTO t VALUES(1);
299++SET SESSION query_exec_time = 5.1; INSERT INTO t VALUES(1);
300++
301++sync_slave_with_master;
302++
303++connection slave;
304++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
305++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
306++SHOW QUERY_RESPONSE_TIME;
307++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
308++
309++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
310++SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
311++
312++connection master;
313++DROP TABLE t;
314++
315++sync_slave_with_master;
316+--- /dev/null
317++++ b/mysql-test/include/query_response_time-stored.inc
318+@@ -0,0 +1,37 @@
319++SET SESSION query_exec_time=0.1;
320++
321++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
322++EVAL SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=$base;
323++FLUSH QUERY_RESPONSE_TIME;
324++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
325++
326++CALL test_f(0.31);
327++CALL test_f(0.32);
328++CALL test_f(0.33);
329++CALL test_f(0.34);
330++CALL test_f(0.35);
331++CALL test_f(0.36);
332++CALL test_f(0.37);
333++CALL test_f(0.38);
334++CALL test_f(0.39);
335++CALL test_f(0.4);
336++CALL test_f(1.1);
337++CALL test_f(1.2);
338++CALL test_f(1.3);
339++CALL test_f(1.5);
340++CALL test_f(1.4);
341++CALL test_f(0.5);
342++CALL test_f(2.1);
343++CALL test_f(2.3);
344++CALL test_f(2.5);
345++CALL test_f(3.1);
346++CALL test_f(4.1);
347++CALL test_f(5.1);
348++
349++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
350++
351++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
352++SHOW QUERY_RESPONSE_TIME;
353++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
354++
355++SET SESSION query_exec_time=default;
356+--- /dev/null
357++++ b/mysql-test/r/percona_query_response_time-replication.result
358+@@ -0,0 +1,727 @@
359++SET GLOBAL query_exec_time=0.1;
360++include/master-slave.inc
361++[connection master]
362++CREATE TABLE t(id INT);
363++SET GLOBAL query_exec_time = 0.1;
364++include/restart_slave.inc
365++SET SESSION query_exec_time=0.1;
366++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
367++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
368++Warnings:
369++Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
370++FLUSH QUERY_RESPONSE_TIME;
371++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
372++SET SESSION query_exec_time = 0.31;
373++INSERT INTO t VALUES(1);
374++SET SESSION query_exec_time = 0.32;
375++INSERT INTO t VALUES(1);
376++SET SESSION query_exec_time = 0.33;
377++INSERT INTO t VALUES(1);
378++SET SESSION query_exec_time = 0.34;
379++INSERT INTO t VALUES(1);
380++SET SESSION query_exec_time = 0.35;
381++INSERT INTO t VALUES(1);
382++SET SESSION query_exec_time = 0.36;
383++INSERT INTO t VALUES(1);
384++SET SESSION query_exec_time = 0.37;
385++INSERT INTO t VALUES(1);
386++SET SESSION query_exec_time = 0.38;
387++INSERT INTO t VALUES(1);
388++SET SESSION query_exec_time = 0.39;
389++INSERT INTO t VALUES(1);
390++SET SESSION query_exec_time = 0.4;
391++INSERT INTO t VALUES(1);
392++SET SESSION query_exec_time = 1.1;
393++INSERT INTO t VALUES(1);
394++SET SESSION query_exec_time = 1.2;
395++INSERT INTO t VALUES(1);
396++SET SESSION query_exec_time = 1.3;
397++INSERT INTO t VALUES(1);
398++SET SESSION query_exec_time = 1.5;
399++INSERT INTO t VALUES(1);
400++SET SESSION query_exec_time = 1.4;
401++INSERT INTO t VALUES(1);
402++SET SESSION query_exec_time = 0.5;
403++INSERT INTO t VALUES(1);
404++SET SESSION query_exec_time = 2.1;
405++INSERT INTO t VALUES(1);
406++SET SESSION query_exec_time = 2.3;
407++INSERT INTO t VALUES(1);
408++SET SESSION query_exec_time = 2.5;
409++INSERT INTO t VALUES(1);
410++SET SESSION query_exec_time = 3.1;
411++INSERT INTO t VALUES(1);
412++SET SESSION query_exec_time = 4.1;
413++INSERT INTO t VALUES(1);
414++SET SESSION query_exec_time = 5.1;
415++INSERT INTO t VALUES(1);
416++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
417++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
418++Variable_name Value
419++query_response_time_range_base 2
420++SHOW QUERY_RESPONSE_TIME;
421++
422++ 0.000001 2 0.000000
423++ 0.000003 0 0.000000
424++ 0.000007 0 0.000000
425++ 0.000015 0 0.000000
426++ 0.000030 0 0.000000
427++ 0.000061 0 0.000000
428++ 0.000122 0 0.000000
429++ 0.000244 0 0.000000
430++ 0.000488 0 0.000000
431++ 0.000976 0 0.000000
432++ 0.001953 0 0.000000
433++ 0.003906 0 0.000000
434++ 0.007812 0 0.000000
435++ 0.015625 0 0.000000
436++ 0.031250 0 0.000000
437++ 0.062500 0 0.000000
438++ 0.125000 3 0.300000
439++ 0.250000 0 0.000000
440++ 0.500000 30 10.650000
441++ 1.000000 3 1.500000
442++ 2.000000 15 19.500000
443++ 4.000000 12 30.000000
444++ 8.000000 6 27.599997
445++ 16.000000 0 0.000000
446++ 32.000000 0 0.000000
447++ 64.000000 0 0.000000
448++ 128.000000 0 0.000000
449++ 256.000000 0 0.000000
450++ 512.000000 0 0.000000
451++ 1024.000000 0 0.000000
452++ 2048.000000 0 0.000000
453++ 4096.000000 0 0.000000
454++ 8192.000000 0 0.000000
455++ 16384.000000 0 0.000000
456++ 32768.000000 0 0.000000
457++ 65536.000000 0 0.000000
458++ 131072.000000 0 0.000000
459++ 262144.000000 0 0.000000
460++ 524288.000000 0 0.000000
461++ 1048576.00000 0 0.000000
462++ 2097152.00000 0 0.000000
463++ 4194304.00000 0 0.000000
464++ 8388608.00000 0 0.000000
465++TOO LONG 0 TOO LONG
466++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
467++time count total
468++ 0.000001 2 0.000000
469++ 0.000003 0 0.000000
470++ 0.000007 0 0.000000
471++ 0.000015 0 0.000000
472++ 0.000030 0 0.000000
473++ 0.000061 0 0.000000
474++ 0.000122 0 0.000000
475++ 0.000244 0 0.000000
476++ 0.000488 0 0.000000
477++ 0.000976 0 0.000000
478++ 0.001953 0 0.000000
479++ 0.003906 0 0.000000
480++ 0.007812 0 0.000000
481++ 0.015625 0 0.000000
482++ 0.031250 0 0.000000
483++ 0.062500 0 0.000000
484++ 0.125000 4 0.400000
485++ 0.250000 0 0.000000
486++ 0.500000 30 10.650000
487++ 1.000000 3 1.500000
488++ 2.000000 15 19.500000
489++ 4.000000 12 30.000000
490++ 8.000000 6 27.599997
491++ 16.000000 0 0.000000
492++ 32.000000 0 0.000000
493++ 64.000000 0 0.000000
494++ 128.000000 0 0.000000
495++ 256.000000 0 0.000000
496++ 512.000000 0 0.000000
497++ 1024.000000 0 0.000000
498++ 2048.000000 0 0.000000
499++ 4096.000000 0 0.000000
500++ 8192.000000 0 0.000000
501++ 16384.000000 0 0.000000
502++ 32768.000000 0 0.000000
503++ 65536.000000 0 0.000000
504++ 131072.000000 0 0.000000
505++ 262144.000000 0 0.000000
506++ 524288.000000 0 0.000000
507++ 1048576.00000 0 0.000000
508++ 2097152.00000 0 0.000000
509++ 4194304.00000 0 0.000000
510++ 8388608.00000 0 0.000000
511++TOO LONG 0 TOO LONG
512++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
513++SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
514++DROP TABLE t;
515++CREATE TABLE t(id INT);
516++SET GLOBAL query_exec_time = 0.1;
517++include/restart_slave.inc
518++SET SESSION query_exec_time=0.1;
519++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
520++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
521++FLUSH QUERY_RESPONSE_TIME;
522++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
523++SET SESSION query_exec_time = 0.31;
524++INSERT INTO t VALUES(1);
525++SET SESSION query_exec_time = 0.32;
526++INSERT INTO t VALUES(1);
527++SET SESSION query_exec_time = 0.33;
528++INSERT INTO t VALUES(1);
529++SET SESSION query_exec_time = 0.34;
530++INSERT INTO t VALUES(1);
531++SET SESSION query_exec_time = 0.35;
532++INSERT INTO t VALUES(1);
533++SET SESSION query_exec_time = 0.36;
534++INSERT INTO t VALUES(1);
535++SET SESSION query_exec_time = 0.37;
536++INSERT INTO t VALUES(1);
537++SET SESSION query_exec_time = 0.38;
538++INSERT INTO t VALUES(1);
539++SET SESSION query_exec_time = 0.39;
540++INSERT INTO t VALUES(1);
541++SET SESSION query_exec_time = 0.4;
542++INSERT INTO t VALUES(1);
543++SET SESSION query_exec_time = 1.1;
544++INSERT INTO t VALUES(1);
545++SET SESSION query_exec_time = 1.2;
546++INSERT INTO t VALUES(1);
547++SET SESSION query_exec_time = 1.3;
548++INSERT INTO t VALUES(1);
549++SET SESSION query_exec_time = 1.5;
550++INSERT INTO t VALUES(1);
551++SET SESSION query_exec_time = 1.4;
552++INSERT INTO t VALUES(1);
553++SET SESSION query_exec_time = 0.5;
554++INSERT INTO t VALUES(1);
555++SET SESSION query_exec_time = 2.1;
556++INSERT INTO t VALUES(1);
557++SET SESSION query_exec_time = 2.3;
558++INSERT INTO t VALUES(1);
559++SET SESSION query_exec_time = 2.5;
560++INSERT INTO t VALUES(1);
561++SET SESSION query_exec_time = 3.1;
562++INSERT INTO t VALUES(1);
563++SET SESSION query_exec_time = 4.1;
564++INSERT INTO t VALUES(1);
565++SET SESSION query_exec_time = 5.1;
566++INSERT INTO t VALUES(1);
567++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
568++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
569++Variable_name Value
570++query_response_time_range_base 2
571++SHOW QUERY_RESPONSE_TIME;
572++
573++ 0.000001 2 0.000000
574++ 0.000003 0 0.000000
575++ 0.000007 0 0.000000
576++ 0.000015 0 0.000000
577++ 0.000030 0 0.000000
578++ 0.000061 0 0.000000
579++ 0.000122 0 0.000000
580++ 0.000244 0 0.000000
581++ 0.000488 0 0.000000
582++ 0.000976 0 0.000000
583++ 0.001953 0 0.000000
584++ 0.003906 0 0.000000
585++ 0.007812 0 0.000000
586++ 0.015625 0 0.000000
587++ 0.031250 0 0.000000
588++ 0.062500 0 0.000000
589++ 0.125000 3 0.300000
590++ 0.250000 0 0.000000
591++ 0.500000 30 10.650000
592++ 1.000000 3 1.500000
593++ 2.000000 15 19.500000
594++ 4.000000 12 30.000000
595++ 8.000000 6 27.599997
596++ 16.000000 0 0.000000
597++ 32.000000 0 0.000000
598++ 64.000000 0 0.000000
599++ 128.000000 0 0.000000
600++ 256.000000 0 0.000000
601++ 512.000000 0 0.000000
602++ 1024.000000 0 0.000000
603++ 2048.000000 0 0.000000
604++ 4096.000000 0 0.000000
605++ 8192.000000 0 0.000000
606++ 16384.000000 0 0.000000
607++ 32768.000000 0 0.000000
608++ 65536.000000 0 0.000000
609++ 131072.000000 0 0.000000
610++ 262144.000000 0 0.000000
611++ 524288.000000 0 0.000000
612++ 1048576.00000 0 0.000000
613++ 2097152.00000 0 0.000000
614++ 4194304.00000 0 0.000000
615++ 8388608.00000 0 0.000000
616++TOO LONG 0 TOO LONG
617++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
618++time count total
619++ 0.000001 2 0.000000
620++ 0.000003 0 0.000000
621++ 0.000007 0 0.000000
622++ 0.000015 0 0.000000
623++ 0.000030 0 0.000000
624++ 0.000061 0 0.000000
625++ 0.000122 0 0.000000
626++ 0.000244 0 0.000000
627++ 0.000488 0 0.000000
628++ 0.000976 0 0.000000
629++ 0.001953 0 0.000000
630++ 0.003906 0 0.000000
631++ 0.007812 0 0.000000
632++ 0.015625 0 0.000000
633++ 0.031250 0 0.000000
634++ 0.062500 0 0.000000
635++ 0.125000 4 0.400000
636++ 0.250000 0 0.000000
637++ 0.500000 30 10.650000
638++ 1.000000 3 1.500000
639++ 2.000000 15 19.500000
640++ 4.000000 12 30.000000
641++ 8.000000 6 27.599997
642++ 16.000000 0 0.000000
643++ 32.000000 0 0.000000
644++ 64.000000 0 0.000000
645++ 128.000000 0 0.000000
646++ 256.000000 0 0.000000
647++ 512.000000 0 0.000000
648++ 1024.000000 0 0.000000
649++ 2048.000000 0 0.000000
650++ 4096.000000 0 0.000000
651++ 8192.000000 0 0.000000
652++ 16384.000000 0 0.000000
653++ 32768.000000 0 0.000000
654++ 65536.000000 0 0.000000
655++ 131072.000000 0 0.000000
656++ 262144.000000 0 0.000000
657++ 524288.000000 0 0.000000
658++ 1048576.00000 0 0.000000
659++ 2097152.00000 0 0.000000
660++ 4194304.00000 0 0.000000
661++ 8388608.00000 0 0.000000
662++TOO LONG 0 TOO LONG
663++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
664++SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
665++DROP TABLE t;
666++CREATE TABLE t(id INT);
667++SET GLOBAL query_exec_time = 0.1;
668++include/restart_slave.inc
669++SET SESSION query_exec_time=0.1;
670++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
671++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
672++FLUSH QUERY_RESPONSE_TIME;
673++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
674++SET SESSION query_exec_time = 0.31;
675++INSERT INTO t VALUES(1);
676++SET SESSION query_exec_time = 0.32;
677++INSERT INTO t VALUES(1);
678++SET SESSION query_exec_time = 0.33;
679++INSERT INTO t VALUES(1);
680++SET SESSION query_exec_time = 0.34;
681++INSERT INTO t VALUES(1);
682++SET SESSION query_exec_time = 0.35;
683++INSERT INTO t VALUES(1);
684++SET SESSION query_exec_time = 0.36;
685++INSERT INTO t VALUES(1);
686++SET SESSION query_exec_time = 0.37;
687++INSERT INTO t VALUES(1);
688++SET SESSION query_exec_time = 0.38;
689++INSERT INTO t VALUES(1);
690++SET SESSION query_exec_time = 0.39;
691++INSERT INTO t VALUES(1);
692++SET SESSION query_exec_time = 0.4;
693++INSERT INTO t VALUES(1);
694++SET SESSION query_exec_time = 1.1;
695++INSERT INTO t VALUES(1);
696++SET SESSION query_exec_time = 1.2;
697++INSERT INTO t VALUES(1);
698++SET SESSION query_exec_time = 1.3;
699++INSERT INTO t VALUES(1);
700++SET SESSION query_exec_time = 1.5;
701++INSERT INTO t VALUES(1);
702++SET SESSION query_exec_time = 1.4;
703++INSERT INTO t VALUES(1);
704++SET SESSION query_exec_time = 0.5;
705++INSERT INTO t VALUES(1);
706++SET SESSION query_exec_time = 2.1;
707++INSERT INTO t VALUES(1);
708++SET SESSION query_exec_time = 2.3;
709++INSERT INTO t VALUES(1);
710++SET SESSION query_exec_time = 2.5;
711++INSERT INTO t VALUES(1);
712++SET SESSION query_exec_time = 3.1;
713++INSERT INTO t VALUES(1);
714++SET SESSION query_exec_time = 4.1;
715++INSERT INTO t VALUES(1);
716++SET SESSION query_exec_time = 5.1;
717++INSERT INTO t VALUES(1);
718++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
719++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
720++Variable_name Value
721++query_response_time_range_base 10
722++SHOW QUERY_RESPONSE_TIME;
723++
724++ 0.000001 2 0.000000
725++ 0.000010 0 0.000000
726++ 0.000100 0 0.000000
727++ 0.001000 0 0.000000
728++ 0.010000 0 0.000000
729++ 0.100000 0 0.000000
730++ 1.000000 36 12.450000
731++ 10.000000 33 77.099997
732++ 100.000000 0 0.000000
733++ 1000.000000 0 0.000000
734++ 10000.000000 0 0.000000
735++ 100000.000000 0 0.000000
736++ 1000000.00000 0 0.000000
737++TOO LONG 0 TOO LONG
738++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
739++time count total
740++ 0.000001 2 0.000000
741++ 0.000010 0 0.000000
742++ 0.000100 0 0.000000
743++ 0.001000 0 0.000000
744++ 0.010000 0 0.000000
745++ 0.100000 0 0.000000
746++ 1.000000 37 12.550000
747++ 10.000000 33 77.099997
748++ 100.000000 0 0.000000
749++ 1000.000000 0 0.000000
750++ 10000.000000 0 0.000000
751++ 100000.000000 0 0.000000
752++ 1000000.00000 0 0.000000
753++TOO LONG 0 TOO LONG
754++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
755++SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
756++DROP TABLE t;
757++CREATE TABLE t(id INT);
758++SET GLOBAL query_exec_time = 0.1;
759++include/restart_slave.inc
760++SET SESSION query_exec_time=0.1;
761++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
762++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
763++FLUSH QUERY_RESPONSE_TIME;
764++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
765++SET SESSION query_exec_time = 0.31;
766++INSERT INTO t VALUES(1);
767++SET SESSION query_exec_time = 0.32;
768++INSERT INTO t VALUES(1);
769++SET SESSION query_exec_time = 0.33;
770++INSERT INTO t VALUES(1);
771++SET SESSION query_exec_time = 0.34;
772++INSERT INTO t VALUES(1);
773++SET SESSION query_exec_time = 0.35;
774++INSERT INTO t VALUES(1);
775++SET SESSION query_exec_time = 0.36;
776++INSERT INTO t VALUES(1);
777++SET SESSION query_exec_time = 0.37;
778++INSERT INTO t VALUES(1);
779++SET SESSION query_exec_time = 0.38;
780++INSERT INTO t VALUES(1);
781++SET SESSION query_exec_time = 0.39;
782++INSERT INTO t VALUES(1);
783++SET SESSION query_exec_time = 0.4;
784++INSERT INTO t VALUES(1);
785++SET SESSION query_exec_time = 1.1;
786++INSERT INTO t VALUES(1);
787++SET SESSION query_exec_time = 1.2;
788++INSERT INTO t VALUES(1);
789++SET SESSION query_exec_time = 1.3;
790++INSERT INTO t VALUES(1);
791++SET SESSION query_exec_time = 1.5;
792++INSERT INTO t VALUES(1);
793++SET SESSION query_exec_time = 1.4;
794++INSERT INTO t VALUES(1);
795++SET SESSION query_exec_time = 0.5;
796++INSERT INTO t VALUES(1);
797++SET SESSION query_exec_time = 2.1;
798++INSERT INTO t VALUES(1);
799++SET SESSION query_exec_time = 2.3;
800++INSERT INTO t VALUES(1);
801++SET SESSION query_exec_time = 2.5;
802++INSERT INTO t VALUES(1);
803++SET SESSION query_exec_time = 3.1;
804++INSERT INTO t VALUES(1);
805++SET SESSION query_exec_time = 4.1;
806++INSERT INTO t VALUES(1);
807++SET SESSION query_exec_time = 5.1;
808++INSERT INTO t VALUES(1);
809++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
810++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
811++Variable_name Value
812++query_response_time_range_base 7
813++SHOW QUERY_RESPONSE_TIME;
814++
815++ 0.000001 2 0.000000
816++ 0.000008 0 0.000000
817++ 0.000059 0 0.000000
818++ 0.000416 0 0.000000
819++ 0.002915 0 0.000000
820++ 0.020408 0 0.000000
821++ 0.142857 3 0.300000
822++ 1.000000 33 12.150000
823++ 7.000000 33 77.099997
824++ 49.000000 0 0.000000
825++ 343.000000 0 0.000000
826++ 2401.000000 0 0.000000
827++ 16807.000000 0 0.000000
828++ 117649.000000 0 0.000000
829++ 823543.000000 0 0.000000
830++ 5764801.00000 0 0.000000
831++TOO LONG 0 TOO LONG
832++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
833++time count total
834++ 0.000001 2 0.000000
835++ 0.000008 0 0.000000
836++ 0.000059 0 0.000000
837++ 0.000416 0 0.000000
838++ 0.002915 0 0.000000
839++ 0.020408 0 0.000000
840++ 0.142857 4 0.400000
841++ 1.000000 33 12.150000
842++ 7.000000 33 77.099997
843++ 49.000000 0 0.000000
844++ 343.000000 0 0.000000
845++ 2401.000000 0 0.000000
846++ 16807.000000 0 0.000000
847++ 117649.000000 0 0.000000
848++ 823543.000000 0 0.000000
849++ 5764801.00000 0 0.000000
850++TOO LONG 0 TOO LONG
851++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
852++SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
853++DROP TABLE t;
854++CREATE TABLE t(id INT);
855++SET GLOBAL query_exec_time = 0.1;
856++include/restart_slave.inc
857++SET SESSION query_exec_time=0.1;
858++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
859++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
860++FLUSH QUERY_RESPONSE_TIME;
861++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
862++SET SESSION query_exec_time = 0.31;
863++INSERT INTO t VALUES(1);
864++SET SESSION query_exec_time = 0.32;
865++INSERT INTO t VALUES(1);
866++SET SESSION query_exec_time = 0.33;
867++INSERT INTO t VALUES(1);
868++SET SESSION query_exec_time = 0.34;
869++INSERT INTO t VALUES(1);
870++SET SESSION query_exec_time = 0.35;
871++INSERT INTO t VALUES(1);
872++SET SESSION query_exec_time = 0.36;
873++INSERT INTO t VALUES(1);
874++SET SESSION query_exec_time = 0.37;
875++INSERT INTO t VALUES(1);
876++SET SESSION query_exec_time = 0.38;
877++INSERT INTO t VALUES(1);
878++SET SESSION query_exec_time = 0.39;
879++INSERT INTO t VALUES(1);
880++SET SESSION query_exec_time = 0.4;
881++INSERT INTO t VALUES(1);
882++SET SESSION query_exec_time = 1.1;
883++INSERT INTO t VALUES(1);
884++SET SESSION query_exec_time = 1.2;
885++INSERT INTO t VALUES(1);
886++SET SESSION query_exec_time = 1.3;
887++INSERT INTO t VALUES(1);
888++SET SESSION query_exec_time = 1.5;
889++INSERT INTO t VALUES(1);
890++SET SESSION query_exec_time = 1.4;
891++INSERT INTO t VALUES(1);
892++SET SESSION query_exec_time = 0.5;
893++INSERT INTO t VALUES(1);
894++SET SESSION query_exec_time = 2.1;
895++INSERT INTO t VALUES(1);
896++SET SESSION query_exec_time = 2.3;
897++INSERT INTO t VALUES(1);
898++SET SESSION query_exec_time = 2.5;
899++INSERT INTO t VALUES(1);
900++SET SESSION query_exec_time = 3.1;
901++INSERT INTO t VALUES(1);
902++SET SESSION query_exec_time = 4.1;
903++INSERT INTO t VALUES(1);
904++SET SESSION query_exec_time = 5.1;
905++INSERT INTO t VALUES(1);
906++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
907++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
908++Variable_name Value
909++query_response_time_range_base 156
910++SHOW QUERY_RESPONSE_TIME;
911++
912++ 0.000041 2 0.000000
913++ 0.006410 0 0.000000
914++ 1.000000 36 12.450000
915++ 156.000000 33 77.099997
916++ 24336.000000 0 0.000000
917++ 3796416.00000 0 0.000000
918++TOO LONG 0 TOO LONG
919++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
920++time count total
921++ 0.000041 2 0.000000
922++ 0.006410 0 0.000000
923++ 1.000000 37 12.550000
924++ 156.000000 33 77.099997
925++ 24336.000000 0 0.000000
926++ 3796416.00000 0 0.000000
927++TOO LONG 0 TOO LONG
928++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
929++SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
930++DROP TABLE t;
931++CREATE TABLE t(id INT);
932++SET GLOBAL query_exec_time = 0.1;
933++include/restart_slave.inc
934++SET SESSION query_exec_time=0.1;
935++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
936++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
937++FLUSH QUERY_RESPONSE_TIME;
938++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
939++SET SESSION query_exec_time = 0.31;
940++INSERT INTO t VALUES(1);
941++SET SESSION query_exec_time = 0.32;
942++INSERT INTO t VALUES(1);
943++SET SESSION query_exec_time = 0.33;
944++INSERT INTO t VALUES(1);
945++SET SESSION query_exec_time = 0.34;
946++INSERT INTO t VALUES(1);
947++SET SESSION query_exec_time = 0.35;
948++INSERT INTO t VALUES(1);
949++SET SESSION query_exec_time = 0.36;
950++INSERT INTO t VALUES(1);
951++SET SESSION query_exec_time = 0.37;
952++INSERT INTO t VALUES(1);
953++SET SESSION query_exec_time = 0.38;
954++INSERT INTO t VALUES(1);
955++SET SESSION query_exec_time = 0.39;
956++INSERT INTO t VALUES(1);
957++SET SESSION query_exec_time = 0.4;
958++INSERT INTO t VALUES(1);
959++SET SESSION query_exec_time = 1.1;
960++INSERT INTO t VALUES(1);
961++SET SESSION query_exec_time = 1.2;
962++INSERT INTO t VALUES(1);
963++SET SESSION query_exec_time = 1.3;
964++INSERT INTO t VALUES(1);
965++SET SESSION query_exec_time = 1.5;
966++INSERT INTO t VALUES(1);
967++SET SESSION query_exec_time = 1.4;
968++INSERT INTO t VALUES(1);
969++SET SESSION query_exec_time = 0.5;
970++INSERT INTO t VALUES(1);
971++SET SESSION query_exec_time = 2.1;
972++INSERT INTO t VALUES(1);
973++SET SESSION query_exec_time = 2.3;
974++INSERT INTO t VALUES(1);
975++SET SESSION query_exec_time = 2.5;
976++INSERT INTO t VALUES(1);
977++SET SESSION query_exec_time = 3.1;
978++INSERT INTO t VALUES(1);
979++SET SESSION query_exec_time = 4.1;
980++INSERT INTO t VALUES(1);
981++SET SESSION query_exec_time = 5.1;
982++INSERT INTO t VALUES(1);
983++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
984++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
985++Variable_name Value
986++query_response_time_range_base 1000
987++SHOW QUERY_RESPONSE_TIME;
988++
989++ 0.000001 2 0.000000
990++ 0.001000 0 0.000000
991++ 1.000000 36 12.450000
992++ 1000.000000 33 77.099997
993++ 1000000.00000 0 0.000000
994++TOO LONG 0 TOO LONG
995++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
996++time count total
997++ 0.000001 2 0.000000
998++ 0.001000 0 0.000000
999++ 1.000000 37 12.550000
1000++ 1000.000000 33 77.099997
1001++ 1000000.00000 0 0.000000
1002++TOO LONG 0 TOO LONG
1003++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
1004++SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
1005++DROP TABLE t;
1006++CREATE TABLE t(id INT);
1007++SET GLOBAL query_exec_time = 0.1;
1008++include/restart_slave.inc
1009++SET SESSION query_exec_time=0.1;
1010++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1011++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
1012++Warnings:
1013++Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
1014++FLUSH QUERY_RESPONSE_TIME;
1015++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1016++SET SESSION query_exec_time = 0.31;
1017++INSERT INTO t VALUES(1);
1018++SET SESSION query_exec_time = 0.32;
1019++INSERT INTO t VALUES(1);
1020++SET SESSION query_exec_time = 0.33;
1021++INSERT INTO t VALUES(1);
1022++SET SESSION query_exec_time = 0.34;
1023++INSERT INTO t VALUES(1);
1024++SET SESSION query_exec_time = 0.35;
1025++INSERT INTO t VALUES(1);
1026++SET SESSION query_exec_time = 0.36;
1027++INSERT INTO t VALUES(1);
1028++SET SESSION query_exec_time = 0.37;
1029++INSERT INTO t VALUES(1);
1030++SET SESSION query_exec_time = 0.38;
1031++INSERT INTO t VALUES(1);
1032++SET SESSION query_exec_time = 0.39;
1033++INSERT INTO t VALUES(1);
1034++SET SESSION query_exec_time = 0.4;
1035++INSERT INTO t VALUES(1);
1036++SET SESSION query_exec_time = 1.1;
1037++INSERT INTO t VALUES(1);
1038++SET SESSION query_exec_time = 1.2;
1039++INSERT INTO t VALUES(1);
1040++SET SESSION query_exec_time = 1.3;
1041++INSERT INTO t VALUES(1);
1042++SET SESSION query_exec_time = 1.5;
1043++INSERT INTO t VALUES(1);
1044++SET SESSION query_exec_time = 1.4;
1045++INSERT INTO t VALUES(1);
1046++SET SESSION query_exec_time = 0.5;
1047++INSERT INTO t VALUES(1);
1048++SET SESSION query_exec_time = 2.1;
1049++INSERT INTO t VALUES(1);
1050++SET SESSION query_exec_time = 2.3;
1051++INSERT INTO t VALUES(1);
1052++SET SESSION query_exec_time = 2.5;
1053++INSERT INTO t VALUES(1);
1054++SET SESSION query_exec_time = 3.1;
1055++INSERT INTO t VALUES(1);
1056++SET SESSION query_exec_time = 4.1;
1057++INSERT INTO t VALUES(1);
1058++SET SESSION query_exec_time = 5.1;
1059++INSERT INTO t VALUES(1);
1060++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1061++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1062++Variable_name Value
1063++query_response_time_range_base 1000
1064++SHOW QUERY_RESPONSE_TIME;
1065++
1066++ 0.000001 2 0.000000
1067++ 0.001000 0 0.000000
1068++ 1.000000 36 12.450000
1069++ 1000.000000 33 77.099997
1070++ 1000000.00000 0 0.000000
1071++TOO LONG 0 TOO LONG
1072++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1073++time count total
1074++ 0.000001 2 0.000000
1075++ 0.001000 0 0.000000
1076++ 1.000000 37 12.550000
1077++ 1000.000000 33 77.099997
1078++ 1000000.00000 0 0.000000
1079++TOO LONG 0 TOO LONG
1080++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
1081++SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
1082++DROP TABLE t;
1083++include/rpl_end.inc
1084++SET GLOBAL query_exec_time=default;
1085++SET GLOBAL query_exec_time=default;
1086+--- /dev/null
1087++++ b/mysql-test/r/percona_query_response_time.result
1088+@@ -0,0 +1,1003 @@
1089++SET SESSION query_exec_time=0.1;
1090++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1091++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
1092++Warnings:
1093++Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
1094++FLUSH QUERY_RESPONSE_TIME;
1095++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1096++SET SESSION query_exec_time=0.31;
1097++SELECT 1;
1098++1
1099++1
1100++SET SESSION query_exec_time=0.32;
1101++SELECT 1;
1102++1
1103++1
1104++SET SESSION query_exec_time=0.33;
1105++SELECT 1;
1106++1
1107++1
1108++SET SESSION query_exec_time=0.34;
1109++SELECT 1;
1110++1
1111++1
1112++SET SESSION query_exec_time=0.35;
1113++SELECT 1;
1114++1
1115++1
1116++SET SESSION query_exec_time=0.36;
1117++SELECT 1;
1118++1
1119++1
1120++SET SESSION query_exec_time=0.37;
1121++SELECT 1;
1122++1
1123++1
1124++SET SESSION query_exec_time=0.38;
1125++SELECT 1;
1126++1
1127++1
1128++SET SESSION query_exec_time=0.39;
1129++SELECT 1;
1130++1
1131++1
1132++SET SESSION query_exec_time=0.4;
1133++SELECT 1;
1134++1
1135++1
1136++SET SESSION query_exec_time=1.1;
1137++SELECT 1;
1138++1
1139++1
1140++SET SESSION query_exec_time=1.2;
1141++SELECT 1;
1142++1
1143++1
1144++SET SESSION query_exec_time=1.3;
1145++SELECT 1;
1146++1
1147++1
1148++SET SESSION query_exec_time=1.5;
1149++SELECT 1;
1150++1
1151++1
1152++SET SESSION query_exec_time=1.4;
1153++SELECT 1;
1154++1
1155++1
1156++SET SESSION query_exec_time=0.5;
1157++SELECT 1;
1158++1
1159++1
1160++SET SESSION query_exec_time=2.1;
1161++SELECT 1;
1162++1
1163++1
1164++SET SESSION query_exec_time=2.3;
1165++SELECT 1;
1166++1
1167++1
1168++SET SESSION query_exec_time=2.5;
1169++SELECT 1;
1170++1
1171++1
1172++SET SESSION query_exec_time=3.1;
1173++SELECT 1;
1174++1
1175++1
1176++SET SESSION query_exec_time=4.1;
1177++SELECT 1;
1178++1
1179++1
1180++SET SESSION query_exec_time=5.1;
1181++SELECT 1;
1182++1
1183++1
1184++SET SESSION query_exec_time=0.1;
1185++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1186++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1187++Variable_name Value
1188++query_response_time_range_base 2
1189++SHOW QUERY_RESPONSE_TIME;
1190++
1191++ 0.000001 25 0.000000
1192++ 0.000003 0 0.000000
1193++ 0.000007 0 0.000000
1194++ 0.000015 0 0.000000
1195++ 0.000030 0 0.000000
1196++ 0.000061 0 0.000000
1197++ 0.000122 0 0.000000
1198++ 0.000244 0 0.000000
1199++ 0.000488 0 0.000000
1200++ 0.000976 0 0.000000
1201++ 0.001953 0 0.000000
1202++ 0.003906 0 0.000000
1203++ 0.007812 0 0.000000
1204++ 0.015625 0 0.000000
1205++ 0.031250 0 0.000000
1206++ 0.062500 0 0.000000
1207++ 0.125000 2 0.200000
1208++ 0.250000 0 0.000000
1209++ 0.500000 10 3.550000
1210++ 1.000000 1 0.500000
1211++ 2.000000 5 6.500000
1212++ 4.000000 4 10.000000
1213++ 8.000000 2 9.199999
1214++ 16.000000 0 0.000000
1215++ 32.000000 0 0.000000
1216++ 64.000000 0 0.000000
1217++ 128.000000 0 0.000000
1218++ 256.000000 0 0.000000
1219++ 512.000000 0 0.000000
1220++ 1024.000000 0 0.000000
1221++ 2048.000000 0 0.000000
1222++ 4096.000000 0 0.000000
1223++ 8192.000000 0 0.000000
1224++ 16384.000000 0 0.000000
1225++ 32768.000000 0 0.000000
1226++ 65536.000000 0 0.000000
1227++ 131072.000000 0 0.000000
1228++ 262144.000000 0 0.000000
1229++ 524288.000000 0 0.000000
1230++ 1048576.00000 0 0.000000
1231++ 2097152.00000 0 0.000000
1232++ 4194304.00000 0 0.000000
1233++ 8388608.00000 0 0.000000
1234++TOO LONG 0 TOO LONG
1235++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1236++time count total
1237++ 0.000001 25 0.000000
1238++ 0.000003 0 0.000000
1239++ 0.000007 0 0.000000
1240++ 0.000015 0 0.000000
1241++ 0.000030 0 0.000000
1242++ 0.000061 0 0.000000
1243++ 0.000122 0 0.000000
1244++ 0.000244 0 0.000000
1245++ 0.000488 0 0.000000
1246++ 0.000976 0 0.000000
1247++ 0.001953 0 0.000000
1248++ 0.003906 0 0.000000
1249++ 0.007812 0 0.000000
1250++ 0.015625 0 0.000000
1251++ 0.031250 0 0.000000
1252++ 0.062500 0 0.000000
1253++ 0.125000 3 0.300000
1254++ 0.250000 0 0.000000
1255++ 0.500000 10 3.550000
1256++ 1.000000 1 0.500000
1257++ 2.000000 5 6.500000
1258++ 4.000000 4 10.000000
1259++ 8.000000 2 9.199999
1260++ 16.000000 0 0.000000
1261++ 32.000000 0 0.000000
1262++ 64.000000 0 0.000000
1263++ 128.000000 0 0.000000
1264++ 256.000000 0 0.000000
1265++ 512.000000 0 0.000000
1266++ 1024.000000 0 0.000000
1267++ 2048.000000 0 0.000000
1268++ 4096.000000 0 0.000000
1269++ 8192.000000 0 0.000000
1270++ 16384.000000 0 0.000000
1271++ 32768.000000 0 0.000000
1272++ 65536.000000 0 0.000000
1273++ 131072.000000 0 0.000000
1274++ 262144.000000 0 0.000000
1275++ 524288.000000 0 0.000000
1276++ 1048576.00000 0 0.000000
1277++ 2097152.00000 0 0.000000
1278++ 4194304.00000 0 0.000000
1279++ 8388608.00000 0 0.000000
1280++TOO LONG 0 TOO LONG
1281++SET SESSION query_exec_time=default;
1282++SET SESSION query_exec_time=0.1;
1283++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1284++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
1285++FLUSH QUERY_RESPONSE_TIME;
1286++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1287++SET SESSION query_exec_time=0.31;
1288++SELECT 1;
1289++1
1290++1
1291++SET SESSION query_exec_time=0.32;
1292++SELECT 1;
1293++1
1294++1
1295++SET SESSION query_exec_time=0.33;
1296++SELECT 1;
1297++1
1298++1
1299++SET SESSION query_exec_time=0.34;
1300++SELECT 1;
1301++1
1302++1
1303++SET SESSION query_exec_time=0.35;
1304++SELECT 1;
1305++1
1306++1
1307++SET SESSION query_exec_time=0.36;
1308++SELECT 1;
1309++1
1310++1
1311++SET SESSION query_exec_time=0.37;
1312++SELECT 1;
1313++1
1314++1
1315++SET SESSION query_exec_time=0.38;
1316++SELECT 1;
1317++1
1318++1
1319++SET SESSION query_exec_time=0.39;
1320++SELECT 1;
1321++1
1322++1
1323++SET SESSION query_exec_time=0.4;
1324++SELECT 1;
1325++1
1326++1
1327++SET SESSION query_exec_time=1.1;
1328++SELECT 1;
1329++1
1330++1
1331++SET SESSION query_exec_time=1.2;
1332++SELECT 1;
1333++1
1334++1
1335++SET SESSION query_exec_time=1.3;
1336++SELECT 1;
1337++1
1338++1
1339++SET SESSION query_exec_time=1.5;
1340++SELECT 1;
1341++1
1342++1
1343++SET SESSION query_exec_time=1.4;
1344++SELECT 1;
1345++1
1346++1
1347++SET SESSION query_exec_time=0.5;
1348++SELECT 1;
1349++1
1350++1
1351++SET SESSION query_exec_time=2.1;
1352++SELECT 1;
1353++1
1354++1
1355++SET SESSION query_exec_time=2.3;
1356++SELECT 1;
1357++1
1358++1
1359++SET SESSION query_exec_time=2.5;
1360++SELECT 1;
1361++1
1362++1
1363++SET SESSION query_exec_time=3.1;
1364++SELECT 1;
1365++1
1366++1
1367++SET SESSION query_exec_time=4.1;
1368++SELECT 1;
1369++1
1370++1
1371++SET SESSION query_exec_time=5.1;
1372++SELECT 1;
1373++1
1374++1
1375++SET SESSION query_exec_time=0.1;
1376++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1377++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1378++Variable_name Value
1379++query_response_time_range_base 2
1380++SHOW QUERY_RESPONSE_TIME;
1381++
1382++ 0.000001 25 0.000000
1383++ 0.000003 0 0.000000
1384++ 0.000007 0 0.000000
1385++ 0.000015 0 0.000000
1386++ 0.000030 0 0.000000
1387++ 0.000061 0 0.000000
1388++ 0.000122 0 0.000000
1389++ 0.000244 0 0.000000
1390++ 0.000488 0 0.000000
1391++ 0.000976 0 0.000000
1392++ 0.001953 0 0.000000
1393++ 0.003906 0 0.000000
1394++ 0.007812 0 0.000000
1395++ 0.015625 0 0.000000
1396++ 0.031250 0 0.000000
1397++ 0.062500 0 0.000000
1398++ 0.125000 2 0.200000
1399++ 0.250000 0 0.000000
1400++ 0.500000 10 3.550000
1401++ 1.000000 1 0.500000
1402++ 2.000000 5 6.500000
1403++ 4.000000 4 10.000000
1404++ 8.000000 2 9.199999
1405++ 16.000000 0 0.000000
1406++ 32.000000 0 0.000000
1407++ 64.000000 0 0.000000
1408++ 128.000000 0 0.000000
1409++ 256.000000 0 0.000000
1410++ 512.000000 0 0.000000
1411++ 1024.000000 0 0.000000
1412++ 2048.000000 0 0.000000
1413++ 4096.000000 0 0.000000
1414++ 8192.000000 0 0.000000
1415++ 16384.000000 0 0.000000
1416++ 32768.000000 0 0.000000
1417++ 65536.000000 0 0.000000
1418++ 131072.000000 0 0.000000
1419++ 262144.000000 0 0.000000
1420++ 524288.000000 0 0.000000
1421++ 1048576.00000 0 0.000000
1422++ 2097152.00000 0 0.000000
1423++ 4194304.00000 0 0.000000
1424++ 8388608.00000 0 0.000000
1425++TOO LONG 0 TOO LONG
1426++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1427++time count total
1428++ 0.000001 25 0.000000
1429++ 0.000003 0 0.000000
1430++ 0.000007 0 0.000000
1431++ 0.000015 0 0.000000
1432++ 0.000030 0 0.000000
1433++ 0.000061 0 0.000000
1434++ 0.000122 0 0.000000
1435++ 0.000244 0 0.000000
1436++ 0.000488 0 0.000000
1437++ 0.000976 0 0.000000
1438++ 0.001953 0 0.000000
1439++ 0.003906 0 0.000000
1440++ 0.007812 0 0.000000
1441++ 0.015625 0 0.000000
1442++ 0.031250 0 0.000000
1443++ 0.062500 0 0.000000
1444++ 0.125000 3 0.300000
1445++ 0.250000 0 0.000000
1446++ 0.500000 10 3.550000
1447++ 1.000000 1 0.500000
1448++ 2.000000 5 6.500000
1449++ 4.000000 4 10.000000
1450++ 8.000000 2 9.199999
1451++ 16.000000 0 0.000000
1452++ 32.000000 0 0.000000
1453++ 64.000000 0 0.000000
1454++ 128.000000 0 0.000000
1455++ 256.000000 0 0.000000
1456++ 512.000000 0 0.000000
1457++ 1024.000000 0 0.000000
1458++ 2048.000000 0 0.000000
1459++ 4096.000000 0 0.000000
1460++ 8192.000000 0 0.000000
1461++ 16384.000000 0 0.000000
1462++ 32768.000000 0 0.000000
1463++ 65536.000000 0 0.000000
1464++ 131072.000000 0 0.000000
1465++ 262144.000000 0 0.000000
1466++ 524288.000000 0 0.000000
1467++ 1048576.00000 0 0.000000
1468++ 2097152.00000 0 0.000000
1469++ 4194304.00000 0 0.000000
1470++ 8388608.00000 0 0.000000
1471++TOO LONG 0 TOO LONG
1472++SET SESSION query_exec_time=default;
1473++SET SESSION query_exec_time=0.1;
1474++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1475++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
1476++FLUSH QUERY_RESPONSE_TIME;
1477++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1478++SET SESSION query_exec_time=0.31;
1479++SELECT 1;
1480++1
1481++1
1482++SET SESSION query_exec_time=0.32;
1483++SELECT 1;
1484++1
1485++1
1486++SET SESSION query_exec_time=0.33;
1487++SELECT 1;
1488++1
1489++1
1490++SET SESSION query_exec_time=0.34;
1491++SELECT 1;
1492++1
1493++1
1494++SET SESSION query_exec_time=0.35;
1495++SELECT 1;
1496++1
1497++1
1498++SET SESSION query_exec_time=0.36;
1499++SELECT 1;
1500++1
1501++1
1502++SET SESSION query_exec_time=0.37;
1503++SELECT 1;
1504++1
1505++1
1506++SET SESSION query_exec_time=0.38;
1507++SELECT 1;
1508++1
1509++1
1510++SET SESSION query_exec_time=0.39;
1511++SELECT 1;
1512++1
1513++1
1514++SET SESSION query_exec_time=0.4;
1515++SELECT 1;
1516++1
1517++1
1518++SET SESSION query_exec_time=1.1;
1519++SELECT 1;
1520++1
1521++1
1522++SET SESSION query_exec_time=1.2;
1523++SELECT 1;
1524++1
1525++1
1526++SET SESSION query_exec_time=1.3;
1527++SELECT 1;
1528++1
1529++1
1530++SET SESSION query_exec_time=1.5;
1531++SELECT 1;
1532++1
1533++1
1534++SET SESSION query_exec_time=1.4;
1535++SELECT 1;
1536++1
1537++1
1538++SET SESSION query_exec_time=0.5;
1539++SELECT 1;
1540++1
1541++1
1542++SET SESSION query_exec_time=2.1;
1543++SELECT 1;
1544++1
1545++1
1546++SET SESSION query_exec_time=2.3;
1547++SELECT 1;
1548++1
1549++1
1550++SET SESSION query_exec_time=2.5;
1551++SELECT 1;
1552++1
1553++1
1554++SET SESSION query_exec_time=3.1;
1555++SELECT 1;
1556++1
1557++1
1558++SET SESSION query_exec_time=4.1;
1559++SELECT 1;
1560++1
1561++1
1562++SET SESSION query_exec_time=5.1;
1563++SELECT 1;
1564++1
1565++1
1566++SET SESSION query_exec_time=0.1;
1567++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1568++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1569++Variable_name Value
1570++query_response_time_range_base 10
1571++SHOW QUERY_RESPONSE_TIME;
1572++
1573++ 0.000001 25 0.000000
1574++ 0.000010 0 0.000000
1575++ 0.000100 0 0.000000
1576++ 0.001000 0 0.000000
1577++ 0.010000 0 0.000000
1578++ 0.100000 0 0.000000
1579++ 1.000000 13 4.250000
1580++ 10.000000 11 25.699999
1581++ 100.000000 0 0.000000
1582++ 1000.000000 0 0.000000
1583++ 10000.000000 0 0.000000
1584++ 100000.000000 0 0.000000
1585++ 1000000.00000 0 0.000000
1586++TOO LONG 0 TOO LONG
1587++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1588++time count total
1589++ 0.000001 25 0.000000
1590++ 0.000010 0 0.000000
1591++ 0.000100 0 0.000000
1592++ 0.001000 0 0.000000
1593++ 0.010000 0 0.000000
1594++ 0.100000 0 0.000000
1595++ 1.000000 14 4.350000
1596++ 10.000000 11 25.699999
1597++ 100.000000 0 0.000000
1598++ 1000.000000 0 0.000000
1599++ 10000.000000 0 0.000000
1600++ 100000.000000 0 0.000000
1601++ 1000000.00000 0 0.000000
1602++TOO LONG 0 TOO LONG
1603++SET SESSION query_exec_time=default;
1604++SET SESSION query_exec_time=0.1;
1605++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1606++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
1607++FLUSH QUERY_RESPONSE_TIME;
1608++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1609++SET SESSION query_exec_time=0.31;
1610++SELECT 1;
1611++1
1612++1
1613++SET SESSION query_exec_time=0.32;
1614++SELECT 1;
1615++1
1616++1
1617++SET SESSION query_exec_time=0.33;
1618++SELECT 1;
1619++1
1620++1
1621++SET SESSION query_exec_time=0.34;
1622++SELECT 1;
1623++1
1624++1
1625++SET SESSION query_exec_time=0.35;
1626++SELECT 1;
1627++1
1628++1
1629++SET SESSION query_exec_time=0.36;
1630++SELECT 1;
1631++1
1632++1
1633++SET SESSION query_exec_time=0.37;
1634++SELECT 1;
1635++1
1636++1
1637++SET SESSION query_exec_time=0.38;
1638++SELECT 1;
1639++1
1640++1
1641++SET SESSION query_exec_time=0.39;
1642++SELECT 1;
1643++1
1644++1
1645++SET SESSION query_exec_time=0.4;
1646++SELECT 1;
1647++1
1648++1
1649++SET SESSION query_exec_time=1.1;
1650++SELECT 1;
1651++1
1652++1
1653++SET SESSION query_exec_time=1.2;
1654++SELECT 1;
1655++1
1656++1
1657++SET SESSION query_exec_time=1.3;
1658++SELECT 1;
1659++1
1660++1
1661++SET SESSION query_exec_time=1.5;
1662++SELECT 1;
1663++1
1664++1
1665++SET SESSION query_exec_time=1.4;
1666++SELECT 1;
1667++1
1668++1
1669++SET SESSION query_exec_time=0.5;
1670++SELECT 1;
1671++1
1672++1
1673++SET SESSION query_exec_time=2.1;
1674++SELECT 1;
1675++1
1676++1
1677++SET SESSION query_exec_time=2.3;
1678++SELECT 1;
1679++1
1680++1
1681++SET SESSION query_exec_time=2.5;
1682++SELECT 1;
1683++1
1684++1
1685++SET SESSION query_exec_time=3.1;
1686++SELECT 1;
1687++1
1688++1
1689++SET SESSION query_exec_time=4.1;
1690++SELECT 1;
1691++1
1692++1
1693++SET SESSION query_exec_time=5.1;
1694++SELECT 1;
1695++1
1696++1
1697++SET SESSION query_exec_time=0.1;
1698++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1699++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1700++Variable_name Value
1701++query_response_time_range_base 7
1702++SHOW QUERY_RESPONSE_TIME;
1703++
1704++ 0.000001 25 0.000000
1705++ 0.000008 0 0.000000
1706++ 0.000059 0 0.000000
1707++ 0.000416 0 0.000000
1708++ 0.002915 0 0.000000
1709++ 0.020408 0 0.000000
1710++ 0.142857 2 0.200000
1711++ 1.000000 11 4.050000
1712++ 7.000000 11 25.699999
1713++ 49.000000 0 0.000000
1714++ 343.000000 0 0.000000
1715++ 2401.000000 0 0.000000
1716++ 16807.000000 0 0.000000
1717++ 117649.000000 0 0.000000
1718++ 823543.000000 0 0.000000
1719++ 5764801.00000 0 0.000000
1720++TOO LONG 0 TOO LONG
1721++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1722++time count total
1723++ 0.000001 25 0.000000
1724++ 0.000008 0 0.000000
1725++ 0.000059 0 0.000000
1726++ 0.000416 0 0.000000
1727++ 0.002915 0 0.000000
1728++ 0.020408 0 0.000000
1729++ 0.142857 3 0.300000
1730++ 1.000000 11 4.050000
1731++ 7.000000 11 25.699999
1732++ 49.000000 0 0.000000
1733++ 343.000000 0 0.000000
1734++ 2401.000000 0 0.000000
1735++ 16807.000000 0 0.000000
1736++ 117649.000000 0 0.000000
1737++ 823543.000000 0 0.000000
1738++ 5764801.00000 0 0.000000
1739++TOO LONG 0 TOO LONG
1740++SET SESSION query_exec_time=default;
1741++SET SESSION query_exec_time=0.1;
1742++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1743++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
1744++FLUSH QUERY_RESPONSE_TIME;
1745++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1746++SET SESSION query_exec_time=0.31;
1747++SELECT 1;
1748++1
1749++1
1750++SET SESSION query_exec_time=0.32;
1751++SELECT 1;
1752++1
1753++1
1754++SET SESSION query_exec_time=0.33;
1755++SELECT 1;
1756++1
1757++1
1758++SET SESSION query_exec_time=0.34;
1759++SELECT 1;
1760++1
1761++1
1762++SET SESSION query_exec_time=0.35;
1763++SELECT 1;
1764++1
1765++1
1766++SET SESSION query_exec_time=0.36;
1767++SELECT 1;
1768++1
1769++1
1770++SET SESSION query_exec_time=0.37;
1771++SELECT 1;
1772++1
1773++1
1774++SET SESSION query_exec_time=0.38;
1775++SELECT 1;
1776++1
1777++1
1778++SET SESSION query_exec_time=0.39;
1779++SELECT 1;
1780++1
1781++1
1782++SET SESSION query_exec_time=0.4;
1783++SELECT 1;
1784++1
1785++1
1786++SET SESSION query_exec_time=1.1;
1787++SELECT 1;
1788++1
1789++1
1790++SET SESSION query_exec_time=1.2;
1791++SELECT 1;
1792++1
1793++1
1794++SET SESSION query_exec_time=1.3;
1795++SELECT 1;
1796++1
1797++1
1798++SET SESSION query_exec_time=1.5;
1799++SELECT 1;
1800++1
1801++1
1802++SET SESSION query_exec_time=1.4;
1803++SELECT 1;
1804++1
1805++1
1806++SET SESSION query_exec_time=0.5;
1807++SELECT 1;
1808++1
1809++1
1810++SET SESSION query_exec_time=2.1;
1811++SELECT 1;
1812++1
1813++1
1814++SET SESSION query_exec_time=2.3;
1815++SELECT 1;
1816++1
1817++1
1818++SET SESSION query_exec_time=2.5;
1819++SELECT 1;
1820++1
1821++1
1822++SET SESSION query_exec_time=3.1;
1823++SELECT 1;
1824++1
1825++1
1826++SET SESSION query_exec_time=4.1;
1827++SELECT 1;
1828++1
1829++1
1830++SET SESSION query_exec_time=5.1;
1831++SELECT 1;
1832++1
1833++1
1834++SET SESSION query_exec_time=0.1;
1835++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1836++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1837++Variable_name Value
1838++query_response_time_range_base 156
1839++SHOW QUERY_RESPONSE_TIME;
1840++
1841++ 0.000041 25 0.000000
1842++ 0.006410 0 0.000000
1843++ 1.000000 13 4.250000
1844++ 156.000000 11 25.699999
1845++ 24336.000000 0 0.000000
1846++ 3796416.00000 0 0.000000
1847++TOO LONG 0 TOO LONG
1848++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1849++time count total
1850++ 0.000041 25 0.000000
1851++ 0.006410 0 0.000000
1852++ 1.000000 14 4.350000
1853++ 156.000000 11 25.699999
1854++ 24336.000000 0 0.000000
1855++ 3796416.00000 0 0.000000
1856++TOO LONG 0 TOO LONG
1857++SET SESSION query_exec_time=default;
1858++SET SESSION query_exec_time=0.1;
1859++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1860++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
1861++FLUSH QUERY_RESPONSE_TIME;
1862++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1863++SET SESSION query_exec_time=0.31;
1864++SELECT 1;
1865++1
1866++1
1867++SET SESSION query_exec_time=0.32;
1868++SELECT 1;
1869++1
1870++1
1871++SET SESSION query_exec_time=0.33;
1872++SELECT 1;
1873++1
1874++1
1875++SET SESSION query_exec_time=0.34;
1876++SELECT 1;
1877++1
1878++1
1879++SET SESSION query_exec_time=0.35;
1880++SELECT 1;
1881++1
1882++1
1883++SET SESSION query_exec_time=0.36;
1884++SELECT 1;
1885++1
1886++1
1887++SET SESSION query_exec_time=0.37;
1888++SELECT 1;
1889++1
1890++1
1891++SET SESSION query_exec_time=0.38;
1892++SELECT 1;
1893++1
1894++1
1895++SET SESSION query_exec_time=0.39;
1896++SELECT 1;
1897++1
1898++1
1899++SET SESSION query_exec_time=0.4;
1900++SELECT 1;
1901++1
1902++1
1903++SET SESSION query_exec_time=1.1;
1904++SELECT 1;
1905++1
1906++1
1907++SET SESSION query_exec_time=1.2;
1908++SELECT 1;
1909++1
1910++1
1911++SET SESSION query_exec_time=1.3;
1912++SELECT 1;
1913++1
1914++1
1915++SET SESSION query_exec_time=1.5;
1916++SELECT 1;
1917++1
1918++1
1919++SET SESSION query_exec_time=1.4;
1920++SELECT 1;
1921++1
1922++1
1923++SET SESSION query_exec_time=0.5;
1924++SELECT 1;
1925++1
1926++1
1927++SET SESSION query_exec_time=2.1;
1928++SELECT 1;
1929++1
1930++1
1931++SET SESSION query_exec_time=2.3;
1932++SELECT 1;
1933++1
1934++1
1935++SET SESSION query_exec_time=2.5;
1936++SELECT 1;
1937++1
1938++1
1939++SET SESSION query_exec_time=3.1;
1940++SELECT 1;
1941++1
1942++1
1943++SET SESSION query_exec_time=4.1;
1944++SELECT 1;
1945++1
1946++1
1947++SET SESSION query_exec_time=5.1;
1948++SELECT 1;
1949++1
1950++1
1951++SET SESSION query_exec_time=0.1;
1952++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1953++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1954++Variable_name Value
1955++query_response_time_range_base 1000
1956++SHOW QUERY_RESPONSE_TIME;
1957++
1958++ 0.000001 25 0.000000
1959++ 0.001000 0 0.000000
1960++ 1.000000 13 4.250000
1961++ 1000.000000 11 25.699999
1962++ 1000000.00000 0 0.000000
1963++TOO LONG 0 TOO LONG
1964++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1965++time count total
1966++ 0.000001 25 0.000000
1967++ 0.001000 0 0.000000
1968++ 1.000000 14 4.350000
1969++ 1000.000000 11 25.699999
1970++ 1000000.00000 0 0.000000
1971++TOO LONG 0 TOO LONG
1972++SET SESSION query_exec_time=default;
1973++SET SESSION query_exec_time=0.1;
1974++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1975++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
1976++Warnings:
1977++Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
1978++FLUSH QUERY_RESPONSE_TIME;
1979++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1980++SET SESSION query_exec_time=0.31;
1981++SELECT 1;
1982++1
1983++1
1984++SET SESSION query_exec_time=0.32;
1985++SELECT 1;
1986++1
1987++1
1988++SET SESSION query_exec_time=0.33;
1989++SELECT 1;
1990++1
1991++1
1992++SET SESSION query_exec_time=0.34;
1993++SELECT 1;
1994++1
1995++1
1996++SET SESSION query_exec_time=0.35;
1997++SELECT 1;
1998++1
1999++1
2000++SET SESSION query_exec_time=0.36;
2001++SELECT 1;
2002++1
2003++1
2004++SET SESSION query_exec_time=0.37;
2005++SELECT 1;
2006++1
2007++1
2008++SET SESSION query_exec_time=0.38;
2009++SELECT 1;
2010++1
2011++1
2012++SET SESSION query_exec_time=0.39;
2013++SELECT 1;
2014++1
2015++1
2016++SET SESSION query_exec_time=0.4;
2017++SELECT 1;
2018++1
2019++1
2020++SET SESSION query_exec_time=1.1;
2021++SELECT 1;
2022++1
2023++1
2024++SET SESSION query_exec_time=1.2;
2025++SELECT 1;
2026++1
2027++1
2028++SET SESSION query_exec_time=1.3;
2029++SELECT 1;
2030++1
2031++1
2032++SET SESSION query_exec_time=1.5;
2033++SELECT 1;
2034++1
2035++1
2036++SET SESSION query_exec_time=1.4;
2037++SELECT 1;
2038++1
2039++1
2040++SET SESSION query_exec_time=0.5;
2041++SELECT 1;
2042++1
2043++1
2044++SET SESSION query_exec_time=2.1;
2045++SELECT 1;
2046++1
2047++1
2048++SET SESSION query_exec_time=2.3;
2049++SELECT 1;
2050++1
2051++1
2052++SET SESSION query_exec_time=2.5;
2053++SELECT 1;
2054++1
2055++1
2056++SET SESSION query_exec_time=3.1;
2057++SELECT 1;
2058++1
2059++1
2060++SET SESSION query_exec_time=4.1;
2061++SELECT 1;
2062++1
2063++1
2064++SET SESSION query_exec_time=5.1;
2065++SELECT 1;
2066++1
2067++1
2068++SET SESSION query_exec_time=0.1;
2069++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2070++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2071++Variable_name Value
2072++query_response_time_range_base 1000
2073++SHOW QUERY_RESPONSE_TIME;
2074++
2075++ 0.000001 25 0.000000
2076++ 0.001000 0 0.000000
2077++ 1.000000 13 4.250000
2078++ 1000.000000 11 25.699999
2079++ 1000000.00000 0 0.000000
2080++TOO LONG 0 TOO LONG
2081++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2082++time count total
2083++ 0.000001 25 0.000000
2084++ 0.001000 0 0.000000
2085++ 1.000000 14 4.350000
2086++ 1000.000000 11 25.699999
2087++ 1000000.00000 0 0.000000
2088++TOO LONG 0 TOO LONG
2089++SET SESSION query_exec_time=default;
2090++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
2091++SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
2092+--- /dev/null
2093++++ b/mysql-test/r/percona_query_response_time-stored.result
2094+@@ -0,0 +1,544 @@
2095++CREATE TABLE t(a INT);
2096++CREATE PROCEDURE test_f(t DECIMAL(3,2))
2097++BEGIN
2098++SET SESSION query_exec_time=t;
2099++INSERT INTO t VALUES(1);
2100++SET SESSION query_exec_time=0.1;
2101++DELETE FROM t;
2102++END^
2103++SET SESSION query_exec_time=0.1;
2104++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2105++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
2106++Warnings:
2107++Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
2108++FLUSH QUERY_RESPONSE_TIME;
2109++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
2110++CALL test_f(0.31);
2111++CALL test_f(0.32);
2112++CALL test_f(0.33);
2113++CALL test_f(0.34);
2114++CALL test_f(0.35);
2115++CALL test_f(0.36);
2116++CALL test_f(0.37);
2117++CALL test_f(0.38);
2118++CALL test_f(0.39);
2119++CALL test_f(0.4);
2120++CALL test_f(1.1);
2121++CALL test_f(1.2);
2122++CALL test_f(1.3);
2123++CALL test_f(1.5);
2124++CALL test_f(1.4);
2125++CALL test_f(0.5);
2126++CALL test_f(2.1);
2127++CALL test_f(2.3);
2128++CALL test_f(2.5);
2129++CALL test_f(3.1);
2130++CALL test_f(4.1);
2131++CALL test_f(5.1);
2132++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2133++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2134++Variable_name Value
2135++query_response_time_range_base 2
2136++SHOW QUERY_RESPONSE_TIME;
2137++
2138++ 0.000001 46 0.000000
2139++ 0.000003 0 0.000000
2140++ 0.000007 0 0.000000
2141++ 0.000015 0 0.000000
2142++ 0.000030 0 0.000000
2143++ 0.000061 0 0.000000
2144++ 0.000122 0 0.000000
2145++ 0.000244 0 0.000000
2146++ 0.000488 0 0.000000
2147++ 0.000976 0 0.000000
2148++ 0.001953 0 0.000000
2149++ 0.003906 0 0.000000
2150++ 0.007812 0 0.000000
2151++ 0.015625 0 0.000000
2152++ 0.031250 0 0.000000
2153++ 0.062500 0 0.000000
2154++ 0.125000 46 4.600000
2155++ 0.250000 0 0.000000
2156++ 0.500000 10 3.550000
2157++ 1.000000 1 0.500000
2158++ 2.000000 5 6.500000
2159++ 4.000000 4 10.000000
2160++ 8.000000 2 9.199999
2161++ 16.000000 0 0.000000
2162++ 32.000000 0 0.000000
2163++ 64.000000 0 0.000000
2164++ 128.000000 0 0.000000
2165++ 256.000000 0 0.000000
2166++ 512.000000 0 0.000000
2167++ 1024.000000 0 0.000000
2168++ 2048.000000 0 0.000000
2169++ 4096.000000 0 0.000000
2170++ 8192.000000 0 0.000000
2171++ 16384.000000 0 0.000000
2172++ 32768.000000 0 0.000000
2173++ 65536.000000 0 0.000000
2174++ 131072.000000 0 0.000000
2175++ 262144.000000 0 0.000000
2176++ 524288.000000 0 0.000000
2177++ 1048576.00000 0 0.000000
2178++ 2097152.00000 0 0.000000
2179++ 4194304.00000 0 0.000000
2180++ 8388608.00000 0 0.000000
2181++TOO LONG 0 TOO LONG
2182++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2183++time count total
2184++ 0.000001 46 0.000000
2185++ 0.000003 0 0.000000
2186++ 0.000007 0 0.000000
2187++ 0.000015 0 0.000000
2188++ 0.000030 0 0.000000
2189++ 0.000061 0 0.000000
2190++ 0.000122 0 0.000000
2191++ 0.000244 0 0.000000
2192++ 0.000488 0 0.000000
2193++ 0.000976 0 0.000000
2194++ 0.001953 0 0.000000
2195++ 0.003906 0 0.000000
2196++ 0.007812 0 0.000000
2197++ 0.015625 0 0.000000
2198++ 0.031250 0 0.000000
2199++ 0.062500 0 0.000000
2200++ 0.125000 47 4.700000
2201++ 0.250000 0 0.000000
2202++ 0.500000 10 3.550000
2203++ 1.000000 1 0.500000
2204++ 2.000000 5 6.500000
2205++ 4.000000 4 10.000000
2206++ 8.000000 2 9.199999
2207++ 16.000000 0 0.000000
2208++ 32.000000 0 0.000000
2209++ 64.000000 0 0.000000
2210++ 128.000000 0 0.000000
2211++ 256.000000 0 0.000000
2212++ 512.000000 0 0.000000
2213++ 1024.000000 0 0.000000
2214++ 2048.000000 0 0.000000
2215++ 4096.000000 0 0.000000
2216++ 8192.000000 0 0.000000
2217++ 16384.000000 0 0.000000
2218++ 32768.000000 0 0.000000
2219++ 65536.000000 0 0.000000
2220++ 131072.000000 0 0.000000
2221++ 262144.000000 0 0.000000
2222++ 524288.000000 0 0.000000
2223++ 1048576.00000 0 0.000000
2224++ 2097152.00000 0 0.000000
2225++ 4194304.00000 0 0.000000
2226++ 8388608.00000 0 0.000000
2227++TOO LONG 0 TOO LONG
2228++SET SESSION query_exec_time=default;
2229++SET SESSION query_exec_time=0.1;
2230++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2231++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
2232++FLUSH QUERY_RESPONSE_TIME;
2233++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
2234++CALL test_f(0.31);
2235++CALL test_f(0.32);
2236++CALL test_f(0.33);
2237++CALL test_f(0.34);
2238++CALL test_f(0.35);
2239++CALL test_f(0.36);
2240++CALL test_f(0.37);
2241++CALL test_f(0.38);
2242++CALL test_f(0.39);
2243++CALL test_f(0.4);
2244++CALL test_f(1.1);
2245++CALL test_f(1.2);
2246++CALL test_f(1.3);
2247++CALL test_f(1.5);
2248++CALL test_f(1.4);
2249++CALL test_f(0.5);
2250++CALL test_f(2.1);
2251++CALL test_f(2.3);
2252++CALL test_f(2.5);
2253++CALL test_f(3.1);
2254++CALL test_f(4.1);
2255++CALL test_f(5.1);
2256++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2257++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2258++Variable_name Value
2259++query_response_time_range_base 2
2260++SHOW QUERY_RESPONSE_TIME;
2261++
2262++ 0.000001 46 0.000000
2263++ 0.000003 0 0.000000
2264++ 0.000007 0 0.000000
2265++ 0.000015 0 0.000000
2266++ 0.000030 0 0.000000
2267++ 0.000061 0 0.000000
2268++ 0.000122 0 0.000000
2269++ 0.000244 0 0.000000
2270++ 0.000488 0 0.000000
2271++ 0.000976 0 0.000000
2272++ 0.001953 0 0.000000
2273++ 0.003906 0 0.000000
2274++ 0.007812 0 0.000000
2275++ 0.015625 0 0.000000
2276++ 0.031250 0 0.000000
2277++ 0.062500 0 0.000000
2278++ 0.125000 46 4.600000
2279++ 0.250000 0 0.000000
2280++ 0.500000 10 3.550000
2281++ 1.000000 1 0.500000
2282++ 2.000000 5 6.500000
2283++ 4.000000 4 10.000000
2284++ 8.000000 2 9.199999
2285++ 16.000000 0 0.000000
2286++ 32.000000 0 0.000000
2287++ 64.000000 0 0.000000
2288++ 128.000000 0 0.000000
2289++ 256.000000 0 0.000000
2290++ 512.000000 0 0.000000
2291++ 1024.000000 0 0.000000
2292++ 2048.000000 0 0.000000
2293++ 4096.000000 0 0.000000
2294++ 8192.000000 0 0.000000
2295++ 16384.000000 0 0.000000
2296++ 32768.000000 0 0.000000
2297++ 65536.000000 0 0.000000
2298++ 131072.000000 0 0.000000
2299++ 262144.000000 0 0.000000
2300++ 524288.000000 0 0.000000
2301++ 1048576.00000 0 0.000000
2302++ 2097152.00000 0 0.000000
2303++ 4194304.00000 0 0.000000
2304++ 8388608.00000 0 0.000000
2305++TOO LONG 0 TOO LONG
2306++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2307++time count total
2308++ 0.000001 46 0.000000
2309++ 0.000003 0 0.000000
2310++ 0.000007 0 0.000000
2311++ 0.000015 0 0.000000
2312++ 0.000030 0 0.000000
2313++ 0.000061 0 0.000000
2314++ 0.000122 0 0.000000
2315++ 0.000244 0 0.000000
2316++ 0.000488 0 0.000000
2317++ 0.000976 0 0.000000
2318++ 0.001953 0 0.000000
2319++ 0.003906 0 0.000000
2320++ 0.007812 0 0.000000
2321++ 0.015625 0 0.000000
2322++ 0.031250 0 0.000000
2323++ 0.062500 0 0.000000
2324++ 0.125000 47 4.700000
2325++ 0.250000 0 0.000000
2326++ 0.500000 10 3.550000
2327++ 1.000000 1 0.500000
2328++ 2.000000 5 6.500000
2329++ 4.000000 4 10.000000
2330++ 8.000000 2 9.199999
2331++ 16.000000 0 0.000000
2332++ 32.000000 0 0.000000
2333++ 64.000000 0 0.000000
2334++ 128.000000 0 0.000000
2335++ 256.000000 0 0.000000
2336++ 512.000000 0 0.000000
2337++ 1024.000000 0 0.000000
2338++ 2048.000000 0 0.000000
2339++ 4096.000000 0 0.000000
2340++ 8192.000000 0 0.000000
2341++ 16384.000000 0 0.000000
2342++ 32768.000000 0 0.000000
2343++ 65536.000000 0 0.000000
2344++ 131072.000000 0 0.000000
2345++ 262144.000000 0 0.000000
2346++ 524288.000000 0 0.000000
2347++ 1048576.00000 0 0.000000
2348++ 2097152.00000 0 0.000000
2349++ 4194304.00000 0 0.000000
2350++ 8388608.00000 0 0.000000
2351++TOO LONG 0 TOO LONG
2352++SET SESSION query_exec_time=default;
2353++SET SESSION query_exec_time=0.1;
2354++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2355++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
2356++FLUSH QUERY_RESPONSE_TIME;
2357++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
2358++CALL test_f(0.31);
2359++CALL test_f(0.32);
2360++CALL test_f(0.33);
2361++CALL test_f(0.34);
2362++CALL test_f(0.35);
2363++CALL test_f(0.36);
2364++CALL test_f(0.37);
2365++CALL test_f(0.38);
2366++CALL test_f(0.39);
2367++CALL test_f(0.4);
2368++CALL test_f(1.1);
2369++CALL test_f(1.2);
2370++CALL test_f(1.3);
2371++CALL test_f(1.5);
2372++CALL test_f(1.4);
2373++CALL test_f(0.5);
2374++CALL test_f(2.1);
2375++CALL test_f(2.3);
2376++CALL test_f(2.5);
2377++CALL test_f(3.1);
2378++CALL test_f(4.1);
2379++CALL test_f(5.1);
2380++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2381++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2382++Variable_name Value
2383++query_response_time_range_base 10
2384++SHOW QUERY_RESPONSE_TIME;
2385++
2386++ 0.000001 46 0.000000
2387++ 0.000010 0 0.000000
2388++ 0.000100 0 0.000000
2389++ 0.001000 0 0.000000
2390++ 0.010000 0 0.000000
2391++ 0.100000 0 0.000000
2392++ 1.000000 57 8.650000
2393++ 10.000000 11 25.699999
2394++ 100.000000 0 0.000000
2395++ 1000.000000 0 0.000000
2396++ 10000.000000 0 0.000000
2397++ 100000.000000 0 0.000000
2398++ 1000000.00000 0 0.000000
2399++TOO LONG 0 TOO LONG
2400++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2401++time count total
2402++ 0.000001 46 0.000000
2403++ 0.000010 0 0.000000
2404++ 0.000100 0 0.000000
2405++ 0.001000 0 0.000000
2406++ 0.010000 0 0.000000
2407++ 0.100000 0 0.000000
2408++ 1.000000 58 8.750000
2409++ 10.000000 11 25.699999
2410++ 100.000000 0 0.000000
2411++ 1000.000000 0 0.000000
2412++ 10000.000000 0 0.000000
2413++ 100000.000000 0 0.000000
2414++ 1000000.00000 0 0.000000
2415++TOO LONG 0 TOO LONG
2416++SET SESSION query_exec_time=default;
2417++SET SESSION query_exec_time=0.1;
2418++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2419++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
2420++FLUSH QUERY_RESPONSE_TIME;
2421++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
2422++CALL test_f(0.31);
2423++CALL test_f(0.32);
2424++CALL test_f(0.33);
2425++CALL test_f(0.34);
2426++CALL test_f(0.35);
2427++CALL test_f(0.36);
2428++CALL test_f(0.37);
2429++CALL test_f(0.38);
2430++CALL test_f(0.39);
2431++CALL test_f(0.4);
2432++CALL test_f(1.1);
2433++CALL test_f(1.2);
2434++CALL test_f(1.3);
2435++CALL test_f(1.5);
2436++CALL test_f(1.4);
2437++CALL test_f(0.5);
2438++CALL test_f(2.1);
2439++CALL test_f(2.3);
2440++CALL test_f(2.5);
2441++CALL test_f(3.1);
2442++CALL test_f(4.1);
2443++CALL test_f(5.1);
2444++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2445++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2446++Variable_name Value
2447++query_response_time_range_base 7
2448++SHOW QUERY_RESPONSE_TIME;
2449++
2450++ 0.000001 46 0.000000
2451++ 0.000008 0 0.000000
2452++ 0.000059 0 0.000000
2453++ 0.000416 0 0.000000
2454++ 0.002915 0 0.000000
2455++ 0.020408 0 0.000000
2456++ 0.142857 46 4.600000
2457++ 1.000000 11 4.050000
2458++ 7.000000 11 25.699999
2459++ 49.000000 0 0.000000
2460++ 343.000000 0 0.000000
2461++ 2401.000000 0 0.000000
2462++ 16807.000000 0 0.000000
2463++ 117649.000000 0 0.000000
2464++ 823543.000000 0 0.000000
2465++ 5764801.00000 0 0.000000
2466++TOO LONG 0 TOO LONG
2467++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2468++time count total
2469++ 0.000001 46 0.000000
2470++ 0.000008 0 0.000000
2471++ 0.000059 0 0.000000
2472++ 0.000416 0 0.000000
2473++ 0.002915 0 0.000000
2474++ 0.020408 0 0.000000
2475++ 0.142857 47 4.700000
2476++ 1.000000 11 4.050000
2477++ 7.000000 11 25.699999
2478++ 49.000000 0 0.000000
2479++ 343.000000 0 0.000000
2480++ 2401.000000 0 0.000000
2481++ 16807.000000 0 0.000000
2482++ 117649.000000 0 0.000000
2483++ 823543.000000 0 0.000000
2484++ 5764801.00000 0 0.000000
2485++TOO LONG 0 TOO LONG
2486++SET SESSION query_exec_time=default;
2487++SET SESSION query_exec_time=0.1;
2488++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2489++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
2490++FLUSH QUERY_RESPONSE_TIME;
2491++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
2492++CALL test_f(0.31);
2493++CALL test_f(0.32);
2494++CALL test_f(0.33);
2495++CALL test_f(0.34);
2496++CALL test_f(0.35);
2497++CALL test_f(0.36);
2498++CALL test_f(0.37);
2499++CALL test_f(0.38);
2500++CALL test_f(0.39);
2501++CALL test_f(0.4);
2502++CALL test_f(1.1);
2503++CALL test_f(1.2);
2504++CALL test_f(1.3);
2505++CALL test_f(1.5);
2506++CALL test_f(1.4);
2507++CALL test_f(0.5);
2508++CALL test_f(2.1);
2509++CALL test_f(2.3);
2510++CALL test_f(2.5);
2511++CALL test_f(3.1);
2512++CALL test_f(4.1);
2513++CALL test_f(5.1);
2514++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2515++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2516++Variable_name Value
2517++query_response_time_range_base 156
2518++SHOW QUERY_RESPONSE_TIME;
2519++
2520++ 0.000041 46 0.000000
2521++ 0.006410 0 0.000000
2522++ 1.000000 57 8.650000
2523++ 156.000000 11 25.699999
2524++ 24336.000000 0 0.000000
2525++ 3796416.00000 0 0.000000
2526++TOO LONG 0 TOO LONG
2527++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2528++time count total
2529++ 0.000041 46 0.000000
2530++ 0.006410 0 0.000000
2531++ 1.000000 58 8.750000
2532++ 156.000000 11 25.699999
2533++ 24336.000000 0 0.000000
2534++ 3796416.00000 0 0.000000
2535++TOO LONG 0 TOO LONG
2536++SET SESSION query_exec_time=default;
2537++SET SESSION query_exec_time=0.1;
2538++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2539++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
2540++FLUSH QUERY_RESPONSE_TIME;
2541++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
2542++CALL test_f(0.31);
2543++CALL test_f(0.32);
2544++CALL test_f(0.33);
2545++CALL test_f(0.34);
2546++CALL test_f(0.35);
2547++CALL test_f(0.36);
2548++CALL test_f(0.37);
2549++CALL test_f(0.38);
2550++CALL test_f(0.39);
2551++CALL test_f(0.4);
2552++CALL test_f(1.1);
2553++CALL test_f(1.2);
2554++CALL test_f(1.3);
2555++CALL test_f(1.5);
2556++CALL test_f(1.4);
2557++CALL test_f(0.5);
2558++CALL test_f(2.1);
2559++CALL test_f(2.3);
2560++CALL test_f(2.5);
2561++CALL test_f(3.1);
2562++CALL test_f(4.1);
2563++CALL test_f(5.1);
2564++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2565++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2566++Variable_name Value
2567++query_response_time_range_base 1000
2568++SHOW QUERY_RESPONSE_TIME;
2569++
2570++ 0.000001 46 0.000000
2571++ 0.001000 0 0.000000
2572++ 1.000000 57 8.650000
2573++ 1000.000000 11 25.699999
2574++ 1000000.00000 0 0.000000
2575++TOO LONG 0 TOO LONG
2576++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2577++time count total
2578++ 0.000001 46 0.000000
2579++ 0.001000 0 0.000000
2580++ 1.000000 58 8.750000
2581++ 1000.000000 11 25.699999
2582++ 1000000.00000 0 0.000000
2583++TOO LONG 0 TOO LONG
2584++SET SESSION query_exec_time=default;
2585++SET SESSION query_exec_time=0.1;
2586++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2587++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
2588++Warnings:
2589++Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
2590++FLUSH QUERY_RESPONSE_TIME;
2591++SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
2592++CALL test_f(0.31);
2593++CALL test_f(0.32);
2594++CALL test_f(0.33);
2595++CALL test_f(0.34);
2596++CALL test_f(0.35);
2597++CALL test_f(0.36);
2598++CALL test_f(0.37);
2599++CALL test_f(0.38);
2600++CALL test_f(0.39);
2601++CALL test_f(0.4);
2602++CALL test_f(1.1);
2603++CALL test_f(1.2);
2604++CALL test_f(1.3);
2605++CALL test_f(1.5);
2606++CALL test_f(1.4);
2607++CALL test_f(0.5);
2608++CALL test_f(2.1);
2609++CALL test_f(2.3);
2610++CALL test_f(2.5);
2611++CALL test_f(3.1);
2612++CALL test_f(4.1);
2613++CALL test_f(5.1);
2614++SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2615++SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2616++Variable_name Value
2617++query_response_time_range_base 1000
2618++SHOW QUERY_RESPONSE_TIME;
2619++
2620++ 0.000001 46 0.000000
2621++ 0.001000 0 0.000000
2622++ 1.000000 57 8.650000
2623++ 1000.000000 11 25.699999
2624++ 1000000.00000 0 0.000000
2625++TOO LONG 0 TOO LONG
2626++SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2627++time count total
2628++ 0.000001 46 0.000000
2629++ 0.001000 0 0.000000
2630++ 1.000000 58 8.750000
2631++ 1000.000000 11 25.699999
2632++ 1000000.00000 0 0.000000
2633++TOO LONG 0 TOO LONG
2634++SET SESSION query_exec_time=default;
2635++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
2636++SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
2637++DROP PROCEDURE test_f;
2638++DROP TABLE t;
2639+--- /dev/null
2640++++ b/mysql-test/t/percona_query_response_time-replication.test
2641+@@ -0,0 +1,28 @@
2642++SET GLOBAL query_exec_time=0.1;
2643++
2644++--source include/have_response_time_distribution.inc
2645++--source include/have_debug.inc
2646++--source include/have_binlog_format_statement.inc
2647++--source include/master-slave.inc
2648++
2649++--let base=1
2650++--source include/query_response_time-replication.inc
2651++--let base=2
2652++--source include/query_response_time-replication.inc
2653++--let base=10
2654++--source include/query_response_time-replication.inc
2655++--let base=7
2656++--source include/query_response_time-replication.inc
2657++--let base=156
2658++--source include/query_response_time-replication.inc
2659++--let base=1000
2660++--source include/query_response_time-replication.inc
2661++--let base=1001
2662++--source include/query_response_time-replication.inc
2663++
2664++--source include/rpl_end.inc
2665++
2666++SET GLOBAL query_exec_time=default;
2667++
2668++connection slave;
2669++SET GLOBAL query_exec_time=default;
2670+--- /dev/null
2671++++ b/mysql-test/t/percona_query_response_time-stored.test
2672+@@ -0,0 +1,36 @@
2673++--source include/have_response_time_distribution.inc
2674++--source include/have_debug.inc
2675++
2676++CREATE TABLE t(a INT);
2677++
2678++delimiter ^;
2679++CREATE PROCEDURE test_f(t DECIMAL(3,2))
2680++BEGIN
2681++ SET SESSION query_exec_time=t;
2682++ INSERT INTO t VALUES(1);
2683++ SET SESSION query_exec_time=0.1;
2684++ DELETE FROM t;
2685++END^
2686++delimiter ;^
2687++
2688++--let base=1
2689++--source include/query_response_time-stored.inc
2690++--let base=2
2691++--source include/query_response_time-stored.inc
2692++--let base=10
2693++--source include/query_response_time-stored.inc
2694++--let base=7
2695++--source include/query_response_time-stored.inc
2696++--let base=156
2697++--source include/query_response_time-stored.inc
2698++--let base=1000
2699++--source include/query_response_time-stored.inc
2700++--let base=1001
2701++--source include/query_response_time-stored.inc
2702++
2703++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
2704++SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
2705++
2706++DROP PROCEDURE test_f;
2707++
2708++DROP TABLE t;
2709+--- /dev/null
2710++++ b/mysql-test/t/percona_query_response_time.test
2711+@@ -0,0 +1,20 @@
2712++--source include/have_response_time_distribution.inc
2713++--source include/have_debug.inc
2714++
2715++--let base=1
2716++--source include/query_response_time.inc
2717++--let base=2
2718++--source include/query_response_time.inc
2719++--let base=10
2720++--source include/query_response_time.inc
2721++--let base=7
2722++--source include/query_response_time.inc
2723++--let base=156
2724++--source include/query_response_time.inc
2725++--let base=1000
2726++--source include/query_response_time.inc
2727++--let base=1001
2728++--source include/query_response_time.inc
2729++
2730++SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
2731++SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
2732+--- /dev/null
2733 +++ b/patch_info/response-time-distribution.info
2734 @@ -0,0 +1,9 @@
2735 +File=response-time-distribution.patch
2736@@ -574,93 +3099,15 @@
2737 #include "transaction.h"
2738 #include "sql_audit.h"
2739 #include "sql_prepare.h"
2740-@@ -1482,22 +1483,74 @@
2741- Do not log administrative statements unless the appropriate option is
2742- set.
2743- */
2744-+ #ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
2745-+ if (opt_query_response_time_stats || thd->enable_slow_log)
2746-+#else // HAVE_RESPONSE_TIME_DISTRIBUTION
2747- if (thd->enable_slow_log)
2748-+#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
2749- {
2750-- ulonglong end_utime_of_query= thd->current_utime();
2751-- thd_proc_info(thd, "logging slow query");
2752-+ ulonglong end_utime_of_query = thd->current_utime();
2753-+ ulonglong query_execution_time = end_utime_of_query - thd->utime_after_lock;
2754-+#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
2755-+
2756-+#define DBUG_TEST_QRT(t,v) \
2757-+ DBUG_EXECUTE_IF(t, \
2758-+ { \
2759-+ query_execution_time= v; \
2760-+ DBUG_SET("-d,"t); \
2761-+ })
2762-+
2763-+ DBUG_EXECUTE_IF("query_exec_time_debug", query_execution_time= 0; );
2764-+
2765-+ DBUG_TEST_QRT("query_exec_time_0.31", 310000UL);
2766-+ DBUG_TEST_QRT("query_exec_time_0.32", 320000UL);
2767-+ DBUG_TEST_QRT("query_exec_time_0.33", 330000UL);
2768-+ DBUG_TEST_QRT("query_exec_time_0.34", 340000UL);
2769-+ DBUG_TEST_QRT("query_exec_time_0.35", 350000UL);
2770-+ DBUG_TEST_QRT("query_exec_time_0.36", 360000UL);
2771-+ DBUG_TEST_QRT("query_exec_time_0.37", 370000UL);
2772-+ DBUG_TEST_QRT("query_exec_time_0.38", 380000UL);
2773-+ DBUG_TEST_QRT("query_exec_time_0.39", 390000UL);
2774-+ DBUG_TEST_QRT("query_exec_time_0.4", 400000UL);
2775-+ DBUG_TEST_QRT("query_exec_time_0.5", 500000UL);
2776-+ DBUG_TEST_QRT("query_exec_time_1.1", 1100000UL);
2777-+ DBUG_TEST_QRT("query_exec_time_1.2", 1200000UL);
2778-+ DBUG_TEST_QRT("query_exec_time_1.3", 1300000UL);
2779-+ DBUG_TEST_QRT("query_exec_time_1.4", 1400000UL);
2780-+ DBUG_TEST_QRT("query_exec_time_1.5", 1500000UL);
2781-+ DBUG_TEST_QRT("query_exec_time_2.1", 2100000UL);
2782-+ DBUG_TEST_QRT("query_exec_time_2.3", 2300000UL);
2783-+ DBUG_TEST_QRT("query_exec_time_2.5", 2500000UL);
2784-+
2785-+ DBUG_EXECUTE_IF("query_exec_time_debug",
2786-+ if (query_execution_time == 0)
2787-+ opt_query_response_time_stats= 0;
2788-+ else
2789-+ opt_query_response_time_stats= 1;);
2790-
2791-- if (((thd->server_status & SERVER_QUERY_WAS_SLOW) ||
2792-- ((thd->server_status &
2793-- (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
2794-- opt_log_queries_not_using_indexes &&
2795-- !(sql_command_flags[thd->lex->sql_command] & CF_STATUS_COMMAND))) &&
2796-- thd->examined_row_count >= thd->variables.min_examined_row_limit)
2797-+#undef DBUG_TEST_QRT
2798-+
2799-+ if(opt_query_response_time_stats)
2800-+ {
2801-+ query_response_time_collect(query_execution_time);
2802-+ }
2803-+#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
2804-+ if (thd->enable_slow_log)
2805- {
2806- thd_proc_info(thd, "logging slow query");
2807-- thd->status_var.long_query_count++;
2808-- slow_log_print(thd, thd->query(), thd->query_length(),
2809-- end_utime_of_query);
2810-+
2811-+ if (((thd->server_status & SERVER_QUERY_WAS_SLOW) ||
2812-+ ((thd->server_status &
2813-+ (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
2814-+ opt_log_queries_not_using_indexes &&
2815-+ !(sql_command_flags[thd->lex->sql_command] & CF_STATUS_COMMAND))) &&
2816-+ thd->examined_row_count >= thd->variables.min_examined_row_limit)
2817-+ {
2818-+ thd_proc_info(thd, "logging slow query");
2819-+ thd->status_var.long_query_count++;
2820-+ slow_log_print(thd, thd->query(), thd->query_length(),
2821-+ end_utime_of_query);
2822-+ }
2823- }
2824- }
2825- DBUG_VOID_RETURN;
2826-@@ -1616,6 +1669,7 @@
2827+@@ -1507,6 +1508,7 @@
2828+
2829+ ulonglong end_utime_of_query= thd->current_utime();
2830+ ulonglong query_exec_time= get_query_exec_time(thd, end_utime_of_query);
2831++ query_response_time_collect(query_exec_time);
2832+
2833+ /*
2834+ Low long_query_time value most likely means user is debugging stuff and even
2835+@@ -1671,6 +1673,7 @@
2836 case SCH_CHARSETS:
2837 case SCH_ENGINES:
2838 case SCH_COLLATIONS:
2839@@ -788,7 +3235,7 @@
2840 /*
2841 This forward declaration is needed because including sql_base.h
2842 causes further includes. [TODO] Eliminate this forward declaration
2843-@@ -1837,6 +1838,26 @@
2844+@@ -1860,6 +1861,26 @@
2845 DEFAULT(FALSE));
2846 #endif /* HAVE_QUERY_CACHE */
2847
2848@@ -815,8 +3262,13 @@
2849 static Sys_var_mybool Sys_secure_auth(
2850 "secure_auth",
2851 "Disallow authentication for accounts that have old (pre-4.1) "
2852---- a/include/atomic/x86-gcc.h
2853-+++ b/include/atomic/x86-gcc.h
2854+--- /dev/null
2855++++ b/mysql-test/r/have_response_time_distribution.require
2856+@@ -0,0 +1,2 @@
2857++Variable_name Value
2858++have_response_time_distribution YES
2859+--- a/include/atomic/x86-gcc.h 2011-05-11 14:54:11.000000000 +0300
2860++++ b/include/atomic/x86-gcc.h 2011-07-21 16:20:24.563057000 +0300
2861 @@ -108,27 +108,22 @@
2862 v=tmp;
2863
2864@@ -856,1036 +3308,3 @@
2865 #endif
2866
2867 /*
2868---- /dev/null
2869-+++ b/mysql-test/include/have_response_time_distribution.inc
2870-@@ -0,0 +1,4 @@
2871-+-- require r/have_response_time_distribution.require
2872-+disable_query_log;
2873-+show variables like 'have_response_time_distribution';
2874-+enable_query_log;
2875---- /dev/null
2876-+++ b/mysql-test/include/percona_query_response_time_flush.inc
2877-@@ -0,0 +1 @@
2878-+FLUSH QUERY_RESPONSE_TIME;
2879---- /dev/null
2880-+++ b/mysql-test/include/percona_query_response_time_show.inc
2881-@@ -0,0 +1,8 @@
2882-+SELECT d.count,
2883-+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
2884-+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
2885-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
2886-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
2887-+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
2888-+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2889-+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2890---- /dev/null
2891-+++ b/mysql-test/include/percona_query_response_time_sleep.inc
2892-@@ -0,0 +1,19 @@
2893-+SET SESSION debug="+d,query_exec_time_0.31";
2894-+SET SESSION debug="+d,query_exec_time_0.32";
2895-+SET SESSION debug="+d,query_exec_time_0.33";
2896-+SET SESSION debug="+d,query_exec_time_0.34";
2897-+SET SESSION debug="+d,query_exec_time_0.35";
2898-+SET SESSION debug="+d,query_exec_time_0.36";
2899-+SET SESSION debug="+d,query_exec_time_0.37";
2900-+SET SESSION debug="+d,query_exec_time_0.38";
2901-+SET SESSION debug="+d,query_exec_time_0.39";
2902-+SET SESSION debug="+d,query_exec_time_0.4";
2903-+SET SESSION debug="+d,query_exec_time_1.1";
2904-+SET SESSION debug="+d,query_exec_time_1.2";
2905-+SET SESSION debug="+d,query_exec_time_1.3";
2906-+SET SESSION debug="+d,query_exec_time_1.5";
2907-+SET SESSION debug="+d,query_exec_time_1.4";
2908-+SET SESSION debug="+d,query_exec_time_0.5";
2909-+SET SESSION debug="+d,query_exec_time_2.1";
2910-+SET SESSION debug="+d,query_exec_time_2.3";
2911-+SET SESSION debug="+d,query_exec_time_2.5";
2912---- /dev/null
2913-+++ b/mysql-test/r/have_response_time_distribution.require
2914-@@ -0,0 +1,2 @@
2915-+Variable_name Value
2916-+have_response_time_distribution YES
2917---- /dev/null
2918-+++ b/mysql-test/r/percona_query_response_time-replication.result
2919-@@ -0,0 +1,66 @@
2920-+include/master-slave.inc
2921-+[connection master]
2922-+DROP TABLE IF EXISTS t;
2923-+CREATE TABLE t(id INT);
2924-+SELECT * from t;
2925-+id
2926-+SELECT * from t;
2927-+id
2928-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
2929-+Warnings:
2930-+Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
2931-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2932-+Variable_name Value
2933-+query_response_time_range_base 2
2934-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
2935-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2936-+Variable_name Value
2937-+query_response_time_range_base 10
2938-+FLUSH QUERY_RESPONSE_TIME;
2939-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=ON;
2940-+INSERT INTO t SELECT SLEEP(0.4);
2941-+Warnings:
2942-+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.
2943-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2944-+SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
2945-+0
2946-+INSERT INTO t SELECT SLEEP(0.4);
2947-+Warnings:
2948-+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.
2949-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2950-+SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
2951-+0
2952-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2953-+SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
2954-+2
2955-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2956-+SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
2957-+3
2958-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
2959-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2960-+Variable_name Value
2961-+query_response_time_range_base 2
2962-+FLUSH QUERY_RESPONSE_TIME;
2963-+INSERT INTO t SELECT SLEEP(0.4);
2964-+Warnings:
2965-+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.
2966-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2967-+SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
2968-+0
2969-+INSERT INTO t SELECT SLEEP(0.4);
2970-+Warnings:
2971-+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.
2972-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2973-+SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
2974-+0
2975-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2976-+SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
2977-+2
2978-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2979-+SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
2980-+3
2981-+DROP TABLE IF EXISTS t;
2982-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
2983-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=OFF;
2984-+STOP SLAVE;
2985-+include/wait_for_slave_to_stop.inc
2986---- /dev/null
2987-+++ b/mysql-test/r/percona_query_response_time-stored.result
2988-@@ -0,0 +1,306 @@
2989-+SET GLOBAL debug="d,query_exec_time_debug";
2990-+CREATE FUNCTION test_f()
2991-+RETURNS CHAR(30) DETERMINISTIC
2992-+BEGIN
2993-+SET SESSION debug="+d,query_exec_time_1.1";
2994-+RETURN 'Hello, world!';
2995-+END/
2996-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
2997-+Warnings:
2998-+Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
2999-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3000-+Variable_name Value
3001-+query_response_time_range_base 2
3002-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
3003-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3004-+Variable_name Value
3005-+query_response_time_range_base 2
3006-+FLUSH QUERY_RESPONSE_TIME;
3007-+SELECT d.count,
3008-+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
3009-+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
3010-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
3011-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
3012-+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
3013-+count query_count query_total not_zero_region_count region_count
3014-+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3015-+region_count
3016-+44
3017-+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3018-+time
3019-+ 0.000001
3020-+ 0.000003
3021-+ 0.000007
3022-+ 0.000015
3023-+ 0.000030
3024-+ 0.000061
3025-+ 0.000122
3026-+ 0.000244
3027-+ 0.000488
3028-+ 0.000976
3029-+ 0.001953
3030-+ 0.003906
3031-+ 0.007812
3032-+ 0.015625
3033-+ 0.031250
3034-+ 0.062500
3035-+ 0.125000
3036-+ 0.250000
3037-+ 0.500000
3038-+ 1.000000
3039-+ 2.000000
3040-+ 4.000000
3041-+ 8.000000
3042-+ 16.000000
3043-+ 32.000000
3044-+ 64.000000
3045-+ 128.000000
3046-+ 256.000000
3047-+ 512.000000
3048-+ 1024.000000
3049-+ 2048.000000
3050-+ 4096.000000
3051-+ 8192.000000
3052-+ 16384.000000
3053-+ 32768.000000
3054-+ 65536.000000
3055-+ 131072.000000
3056-+ 262144.000000
3057-+ 524288.000000
3058-+ 1048576.00000
3059-+ 2097152.00000
3060-+ 4194304.00000
3061-+ 8388608.00000
3062-+TOO LONG
3063-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3064-+SELECT test_f();
3065-+test_f()
3066-+Hello, world!
3067-+SELECT test_f();
3068-+test_f()
3069-+Hello, world!
3070-+SELECT test_f();
3071-+test_f()
3072-+Hello, world!
3073-+SELECT test_f();
3074-+test_f()
3075-+Hello, world!
3076-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3077-+SELECT d.count,
3078-+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
3079-+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
3080-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
3081-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
3082-+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
3083-+count query_count query_total not_zero_region_count region_count
3084-+4 4 4 1 44
3085-+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3086-+region_count
3087-+44
3088-+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3089-+time
3090-+ 0.000001
3091-+ 0.000003
3092-+ 0.000007
3093-+ 0.000015
3094-+ 0.000030
3095-+ 0.000061
3096-+ 0.000122
3097-+ 0.000244
3098-+ 0.000488
3099-+ 0.000976
3100-+ 0.001953
3101-+ 0.003906
3102-+ 0.007812
3103-+ 0.015625
3104-+ 0.031250
3105-+ 0.062500
3106-+ 0.125000
3107-+ 0.250000
3108-+ 0.500000
3109-+ 1.000000
3110-+ 2.000000
3111-+ 4.000000
3112-+ 8.000000
3113-+ 16.000000
3114-+ 32.000000
3115-+ 64.000000
3116-+ 128.000000
3117-+ 256.000000
3118-+ 512.000000
3119-+ 1024.000000
3120-+ 2048.000000
3121-+ 4096.000000
3122-+ 8192.000000
3123-+ 16384.000000
3124-+ 32768.000000
3125-+ 65536.000000
3126-+ 131072.000000
3127-+ 262144.000000
3128-+ 524288.000000
3129-+ 1048576.00000
3130-+ 2097152.00000
3131-+ 4194304.00000
3132-+ 8388608.00000
3133-+TOO LONG
3134-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3135-+Variable_name Value
3136-+query_response_time_range_base 2
3137-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
3138-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3139-+Variable_name Value
3140-+query_response_time_range_base 10
3141-+FLUSH QUERY_RESPONSE_TIME;
3142-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3143-+SELECT test_f();
3144-+test_f()
3145-+Hello, world!
3146-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3147-+SELECT d.count,
3148-+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
3149-+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
3150-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
3151-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
3152-+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
3153-+count query_count query_total not_zero_region_count region_count
3154-+1 1 1 1 14
3155-+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3156-+region_count
3157-+14
3158-+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3159-+time
3160-+ 0.000001
3161-+ 0.000010
3162-+ 0.000100
3163-+ 0.001000
3164-+ 0.010000
3165-+ 0.100000
3166-+ 1.000000
3167-+ 10.000000
3168-+ 100.000000
3169-+ 1000.000000
3170-+ 10000.000000
3171-+ 100000.000000
3172-+ 1000000.00000
3173-+TOO LONG
3174-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3175-+Variable_name Value
3176-+query_response_time_range_base 10
3177-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
3178-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3179-+Variable_name Value
3180-+query_response_time_range_base 7
3181-+FLUSH QUERY_RESPONSE_TIME;
3182-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3183-+SELECT test_f();
3184-+test_f()
3185-+Hello, world!
3186-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3187-+SELECT d.count,
3188-+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
3189-+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
3190-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
3191-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
3192-+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
3193-+count query_count query_total not_zero_region_count region_count
3194-+1 1 1 1 17
3195-+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3196-+region_count
3197-+17
3198-+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3199-+time
3200-+ 0.000001
3201-+ 0.000008
3202-+ 0.000059
3203-+ 0.000416
3204-+ 0.002915
3205-+ 0.020408
3206-+ 0.142857
3207-+ 1.000000
3208-+ 7.000000
3209-+ 49.000000
3210-+ 343.000000
3211-+ 2401.000000
3212-+ 16807.000000
3213-+ 117649.000000
3214-+ 823543.000000
3215-+ 5764801.00000
3216-+TOO LONG
3217-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3218-+Variable_name Value
3219-+query_response_time_range_base 7
3220-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
3221-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3222-+Variable_name Value
3223-+query_response_time_range_base 156
3224-+FLUSH QUERY_RESPONSE_TIME;
3225-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3226-+SELECT test_f();
3227-+test_f()
3228-+Hello, world!
3229-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3230-+SELECT d.count,
3231-+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
3232-+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
3233-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
3234-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
3235-+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
3236-+count query_count query_total not_zero_region_count region_count
3237-+1 1 1 1 7
3238-+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3239-+region_count
3240-+7
3241-+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3242-+time
3243-+ 0.000041
3244-+ 0.006410
3245-+ 1.000000
3246-+ 156.000000
3247-+ 24336.000000
3248-+ 3796416.00000
3249-+TOO LONG
3250-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3251-+Variable_name Value
3252-+query_response_time_range_base 156
3253-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
3254-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3255-+Variable_name Value
3256-+query_response_time_range_base 1000
3257-+FLUSH QUERY_RESPONSE_TIME;
3258-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3259-+SELECT test_f();
3260-+test_f()
3261-+Hello, world!
3262-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3263-+SELECT d.count,
3264-+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
3265-+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
3266-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
3267-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
3268-+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
3269-+count query_count query_total not_zero_region_count region_count
3270-+1 1 1 1 6
3271-+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3272-+region_count
3273-+6
3274-+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3275-+time
3276-+ 0.000001
3277-+ 0.001000
3278-+ 1.000000
3279-+ 1000.000000
3280-+ 1000000.00000
3281-+TOO LONG
3282-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3283-+Variable_name Value
3284-+query_response_time_range_base 1000
3285-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
3286-+Warnings:
3287-+Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
3288-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3289-+Variable_name Value
3290-+query_response_time_range_base 1000
3291-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3292-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
3293-+DROP FUNCTION test_f;
3294-+SET GLOBAL debug=default;
3295---- /dev/null
3296-+++ b/mysql-test/r/percona_query_response_time.result
3297-@@ -0,0 +1,377 @@
3298-+SET GLOBAL debug="d,query_exec_time_debug";
3299-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
3300-+Warnings:
3301-+Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
3302-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3303-+Variable_name Value
3304-+query_response_time_range_base 2
3305-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
3306-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3307-+Variable_name Value
3308-+query_response_time_range_base 2
3309-+FLUSH QUERY_RESPONSE_TIME;
3310-+SELECT d.count,
3311-+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
3312-+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
3313-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
3314-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
3315-+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
3316-+count query_count query_total not_zero_region_count region_count
3317-+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3318-+region_count
3319-+44
3320-+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3321-+time
3322-+ 0.000001
3323-+ 0.000003
3324-+ 0.000007
3325-+ 0.000015
3326-+ 0.000030
3327-+ 0.000061
3328-+ 0.000122
3329-+ 0.000244
3330-+ 0.000488
3331-+ 0.000976
3332-+ 0.001953
3333-+ 0.003906
3334-+ 0.007812
3335-+ 0.015625
3336-+ 0.031250
3337-+ 0.062500
3338-+ 0.125000
3339-+ 0.250000
3340-+ 0.500000
3341-+ 1.000000
3342-+ 2.000000
3343-+ 4.000000
3344-+ 8.000000
3345-+ 16.000000
3346-+ 32.000000
3347-+ 64.000000
3348-+ 128.000000
3349-+ 256.000000
3350-+ 512.000000
3351-+ 1024.000000
3352-+ 2048.000000
3353-+ 4096.000000
3354-+ 8192.000000
3355-+ 16384.000000
3356-+ 32768.000000
3357-+ 65536.000000
3358-+ 131072.000000
3359-+ 262144.000000
3360-+ 524288.000000
3361-+ 1048576.00000
3362-+ 2097152.00000
3363-+ 4194304.00000
3364-+ 8388608.00000
3365-+TOO LONG
3366-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3367-+SET SESSION debug="+d,query_exec_time_0.31";
3368-+SET SESSION debug="+d,query_exec_time_0.32";
3369-+SET SESSION debug="+d,query_exec_time_0.33";
3370-+SET SESSION debug="+d,query_exec_time_0.34";
3371-+SET SESSION debug="+d,query_exec_time_0.35";
3372-+SET SESSION debug="+d,query_exec_time_0.36";
3373-+SET SESSION debug="+d,query_exec_time_0.37";
3374-+SET SESSION debug="+d,query_exec_time_0.38";
3375-+SET SESSION debug="+d,query_exec_time_0.39";
3376-+SET SESSION debug="+d,query_exec_time_0.4";
3377-+SET SESSION debug="+d,query_exec_time_1.1";
3378-+SET SESSION debug="+d,query_exec_time_1.2";
3379-+SET SESSION debug="+d,query_exec_time_1.3";
3380-+SET SESSION debug="+d,query_exec_time_1.5";
3381-+SET SESSION debug="+d,query_exec_time_1.4";
3382-+SET SESSION debug="+d,query_exec_time_0.5";
3383-+SET SESSION debug="+d,query_exec_time_2.1";
3384-+SET SESSION debug="+d,query_exec_time_2.3";
3385-+SET SESSION debug="+d,query_exec_time_2.5";
3386-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3387-+SELECT d.count,
3388-+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
3389-+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
3390-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
3391-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
3392-+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
3393-+count query_count query_total not_zero_region_count region_count
3394-+10 19 15 4 44
3395-+1 19 15 4 44
3396-+5 19 15 4 44
3397-+3 19 15 4 44
3398-+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3399-+region_count
3400-+44
3401-+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3402-+time
3403-+ 0.000001
3404-+ 0.000003
3405-+ 0.000007
3406-+ 0.000015
3407-+ 0.000030
3408-+ 0.000061
3409-+ 0.000122
3410-+ 0.000244
3411-+ 0.000488
3412-+ 0.000976
3413-+ 0.001953
3414-+ 0.003906
3415-+ 0.007812
3416-+ 0.015625
3417-+ 0.031250
3418-+ 0.062500
3419-+ 0.125000
3420-+ 0.250000
3421-+ 0.500000
3422-+ 1.000000
3423-+ 2.000000
3424-+ 4.000000
3425-+ 8.000000
3426-+ 16.000000
3427-+ 32.000000
3428-+ 64.000000
3429-+ 128.000000
3430-+ 256.000000
3431-+ 512.000000
3432-+ 1024.000000
3433-+ 2048.000000
3434-+ 4096.000000
3435-+ 8192.000000
3436-+ 16384.000000
3437-+ 32768.000000
3438-+ 65536.000000
3439-+ 131072.000000
3440-+ 262144.000000
3441-+ 524288.000000
3442-+ 1048576.00000
3443-+ 2097152.00000
3444-+ 4194304.00000
3445-+ 8388608.00000
3446-+TOO LONG
3447-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3448-+Variable_name Value
3449-+query_response_time_range_base 2
3450-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
3451-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3452-+Variable_name Value
3453-+query_response_time_range_base 10
3454-+FLUSH QUERY_RESPONSE_TIME;
3455-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3456-+SET SESSION debug="+d,query_exec_time_0.31";
3457-+SET SESSION debug="+d,query_exec_time_0.32";
3458-+SET SESSION debug="+d,query_exec_time_0.33";
3459-+SET SESSION debug="+d,query_exec_time_0.34";
3460-+SET SESSION debug="+d,query_exec_time_0.35";
3461-+SET SESSION debug="+d,query_exec_time_0.36";
3462-+SET SESSION debug="+d,query_exec_time_0.37";
3463-+SET SESSION debug="+d,query_exec_time_0.38";
3464-+SET SESSION debug="+d,query_exec_time_0.39";
3465-+SET SESSION debug="+d,query_exec_time_0.4";
3466-+SET SESSION debug="+d,query_exec_time_1.1";
3467-+SET SESSION debug="+d,query_exec_time_1.2";
3468-+SET SESSION debug="+d,query_exec_time_1.3";
3469-+SET SESSION debug="+d,query_exec_time_1.5";
3470-+SET SESSION debug="+d,query_exec_time_1.4";
3471-+SET SESSION debug="+d,query_exec_time_0.5";
3472-+SET SESSION debug="+d,query_exec_time_2.1";
3473-+SET SESSION debug="+d,query_exec_time_2.3";
3474-+SET SESSION debug="+d,query_exec_time_2.5";
3475-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3476-+SELECT d.count,
3477-+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
3478-+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
3479-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
3480-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
3481-+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
3482-+count query_count query_total not_zero_region_count region_count
3483-+11 19 17 2 14
3484-+8 19 17 2 14
3485-+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3486-+region_count
3487-+14
3488-+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3489-+time
3490-+ 0.000001
3491-+ 0.000010
3492-+ 0.000100
3493-+ 0.001000
3494-+ 0.010000
3495-+ 0.100000
3496-+ 1.000000
3497-+ 10.000000
3498-+ 100.000000
3499-+ 1000.000000
3500-+ 10000.000000
3501-+ 100000.000000
3502-+ 1000000.00000
3503-+TOO LONG
3504-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3505-+Variable_name Value
3506-+query_response_time_range_base 10
3507-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
3508-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3509-+Variable_name Value
3510-+query_response_time_range_base 7
3511-+FLUSH QUERY_RESPONSE_TIME;
3512-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3513-+SET SESSION debug="+d,query_exec_time_0.31";
3514-+SET SESSION debug="+d,query_exec_time_0.32";
3515-+SET SESSION debug="+d,query_exec_time_0.33";
3516-+SET SESSION debug="+d,query_exec_time_0.34";
3517-+SET SESSION debug="+d,query_exec_time_0.35";
3518-+SET SESSION debug="+d,query_exec_time_0.36";
3519-+SET SESSION debug="+d,query_exec_time_0.37";
3520-+SET SESSION debug="+d,query_exec_time_0.38";
3521-+SET SESSION debug="+d,query_exec_time_0.39";
3522-+SET SESSION debug="+d,query_exec_time_0.4";
3523-+SET SESSION debug="+d,query_exec_time_1.1";
3524-+SET SESSION debug="+d,query_exec_time_1.2";
3525-+SET SESSION debug="+d,query_exec_time_1.3";
3526-+SET SESSION debug="+d,query_exec_time_1.5";
3527-+SET SESSION debug="+d,query_exec_time_1.4";
3528-+SET SESSION debug="+d,query_exec_time_0.5";
3529-+SET SESSION debug="+d,query_exec_time_2.1";
3530-+SET SESSION debug="+d,query_exec_time_2.3";
3531-+SET SESSION debug="+d,query_exec_time_2.5";
3532-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3533-+SELECT d.count,
3534-+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
3535-+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
3536-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
3537-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
3538-+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
3539-+count query_count query_total not_zero_region_count region_count
3540-+11 19 17 2 17
3541-+8 19 17 2 17
3542-+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3543-+region_count
3544-+17
3545-+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3546-+time
3547-+ 0.000001
3548-+ 0.000008
3549-+ 0.000059
3550-+ 0.000416
3551-+ 0.002915
3552-+ 0.020408
3553-+ 0.142857
3554-+ 1.000000
3555-+ 7.000000
3556-+ 49.000000
3557-+ 343.000000
3558-+ 2401.000000
3559-+ 16807.000000
3560-+ 117649.000000
3561-+ 823543.000000
3562-+ 5764801.00000
3563-+TOO LONG
3564-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3565-+Variable_name Value
3566-+query_response_time_range_base 7
3567-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
3568-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3569-+Variable_name Value
3570-+query_response_time_range_base 156
3571-+FLUSH QUERY_RESPONSE_TIME;
3572-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3573-+SET SESSION debug="+d,query_exec_time_0.31";
3574-+SET SESSION debug="+d,query_exec_time_0.32";
3575-+SET SESSION debug="+d,query_exec_time_0.33";
3576-+SET SESSION debug="+d,query_exec_time_0.34";
3577-+SET SESSION debug="+d,query_exec_time_0.35";
3578-+SET SESSION debug="+d,query_exec_time_0.36";
3579-+SET SESSION debug="+d,query_exec_time_0.37";
3580-+SET SESSION debug="+d,query_exec_time_0.38";
3581-+SET SESSION debug="+d,query_exec_time_0.39";
3582-+SET SESSION debug="+d,query_exec_time_0.4";
3583-+SET SESSION debug="+d,query_exec_time_1.1";
3584-+SET SESSION debug="+d,query_exec_time_1.2";
3585-+SET SESSION debug="+d,query_exec_time_1.3";
3586-+SET SESSION debug="+d,query_exec_time_1.5";
3587-+SET SESSION debug="+d,query_exec_time_1.4";
3588-+SET SESSION debug="+d,query_exec_time_0.5";
3589-+SET SESSION debug="+d,query_exec_time_2.1";
3590-+SET SESSION debug="+d,query_exec_time_2.3";
3591-+SET SESSION debug="+d,query_exec_time_2.5";
3592-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3593-+SELECT d.count,
3594-+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
3595-+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
3596-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
3597-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
3598-+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
3599-+count query_count query_total not_zero_region_count region_count
3600-+11 19 17 2 7
3601-+8 19 17 2 7
3602-+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3603-+region_count
3604-+7
3605-+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3606-+time
3607-+ 0.000041
3608-+ 0.006410
3609-+ 1.000000
3610-+ 156.000000
3611-+ 24336.000000
3612-+ 3796416.00000
3613-+TOO LONG
3614-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3615-+Variable_name Value
3616-+query_response_time_range_base 156
3617-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
3618-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3619-+Variable_name Value
3620-+query_response_time_range_base 1000
3621-+FLUSH QUERY_RESPONSE_TIME;
3622-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3623-+SET SESSION debug="+d,query_exec_time_0.31";
3624-+SET SESSION debug="+d,query_exec_time_0.32";
3625-+SET SESSION debug="+d,query_exec_time_0.33";
3626-+SET SESSION debug="+d,query_exec_time_0.34";
3627-+SET SESSION debug="+d,query_exec_time_0.35";
3628-+SET SESSION debug="+d,query_exec_time_0.36";
3629-+SET SESSION debug="+d,query_exec_time_0.37";
3630-+SET SESSION debug="+d,query_exec_time_0.38";
3631-+SET SESSION debug="+d,query_exec_time_0.39";
3632-+SET SESSION debug="+d,query_exec_time_0.4";
3633-+SET SESSION debug="+d,query_exec_time_1.1";
3634-+SET SESSION debug="+d,query_exec_time_1.2";
3635-+SET SESSION debug="+d,query_exec_time_1.3";
3636-+SET SESSION debug="+d,query_exec_time_1.5";
3637-+SET SESSION debug="+d,query_exec_time_1.4";
3638-+SET SESSION debug="+d,query_exec_time_0.5";
3639-+SET SESSION debug="+d,query_exec_time_2.1";
3640-+SET SESSION debug="+d,query_exec_time_2.3";
3641-+SET SESSION debug="+d,query_exec_time_2.5";
3642-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3643-+SELECT d.count,
3644-+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
3645-+(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
3646-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
3647-+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
3648-+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
3649-+count query_count query_total not_zero_region_count region_count
3650-+11 19 17 2 6
3651-+8 19 17 2 6
3652-+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3653-+region_count
3654-+6
3655-+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3656-+time
3657-+ 0.000001
3658-+ 0.001000
3659-+ 1.000000
3660-+ 1000.000000
3661-+ 1000000.00000
3662-+TOO LONG
3663-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3664-+Variable_name Value
3665-+query_response_time_range_base 1000
3666-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
3667-+Warnings:
3668-+Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
3669-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3670-+Variable_name Value
3671-+query_response_time_range_base 1000
3672-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3673-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
3674-+SET GLOBAL debug=default;
3675---- /dev/null
3676-+++ b/mysql-test/t/percona_query_response_time-replication.test
3677-@@ -0,0 +1,61 @@
3678-+--source include/have_response_time_distribution.inc
3679-+--source include/master-slave.inc
3680-+--source include/have_binlog_format_statement.inc
3681-+--source include/have_debug.inc
3682-+--disable_query_log
3683-+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:");
3684-+--enable_query_log
3685-+
3686-+connection master;
3687-+-- disable_warnings
3688-+DROP TABLE IF EXISTS t;
3689-+-- enable_warnings
3690-+CREATE TABLE t(id INT);
3691-+SELECT * from t;
3692-+
3693-+sync_slave_with_master;
3694-+
3695-+connection slave;
3696-+SELECT * from t;
3697-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
3698-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3699-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
3700-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3701-+source include/percona_query_response_time_flush.inc;
3702-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=ON;
3703-+
3704-+connection master;
3705-+INSERT INTO t SELECT SLEEP(0.4);
3706-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3707-+INSERT INTO t SELECT SLEEP(0.4);
3708-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3709-+sync_slave_with_master;
3710-+
3711-+connection slave;
3712-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3713-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3714-+
3715-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
3716-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3717-+source include/percona_query_response_time_flush.inc;
3718-+
3719-+connection master;
3720-+INSERT INTO t SELECT SLEEP(0.4);
3721-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3722-+INSERT INTO t SELECT SLEEP(0.4);
3723-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3724-+sync_slave_with_master;
3725-+
3726-+connection slave;
3727-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3728-+SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
3729-+
3730-+connection master;
3731-+DROP TABLE IF EXISTS t;
3732-+sync_slave_with_master;
3733-+connection slave;
3734-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
3735-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=OFF;
3736-+
3737-+STOP SLAVE;
3738-+-- source include/wait_for_slave_to_stop.inc
3739---- /dev/null
3740-+++ b/mysql-test/t/percona_query_response_time-stored.test
3741-@@ -0,0 +1,85 @@
3742-+--source include/have_response_time_distribution.inc
3743-+--source include/have_debug.inc
3744-+
3745-+SET GLOBAL debug="d,query_exec_time_debug";
3746-+
3747-+delimiter /;
3748-+CREATE FUNCTION test_f()
3749-+RETURNS CHAR(30) DETERMINISTIC
3750-+BEGIN
3751-+ SET SESSION debug="+d,query_exec_time_1.1";
3752-+ RETURN 'Hello, world!';
3753-+END/
3754-+delimiter ;/
3755-+
3756-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
3757-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3758-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
3759-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3760-+
3761-+source include/percona_query_response_time_flush.inc;
3762-+source include/percona_query_response_time_show.inc;
3763-+
3764-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3765-+SELECT test_f();
3766-+SELECT test_f();
3767-+SELECT test_f();
3768-+SELECT test_f();
3769-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3770-+
3771-+source include/percona_query_response_time_show.inc;
3772-+
3773-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3774-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
3775-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3776-+
3777-+source include/percona_query_response_time_flush.inc;
3778-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3779-+SELECT test_f();
3780-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3781-+
3782-+source include/percona_query_response_time_show.inc;
3783-+
3784-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3785-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
3786-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3787-+
3788-+source include/percona_query_response_time_flush.inc;
3789-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3790-+SELECT test_f();
3791-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3792-+
3793-+source include/percona_query_response_time_show.inc;
3794-+
3795-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3796-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
3797-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3798-+
3799-+source include/percona_query_response_time_flush.inc;
3800-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3801-+SELECT test_f();
3802-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3803-+
3804-+source include/percona_query_response_time_show.inc;
3805-+
3806-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3807-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
3808-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3809-+
3810-+source include/percona_query_response_time_flush.inc;
3811-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3812-+SELECT test_f();
3813-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3814-+
3815-+source include/percona_query_response_time_show.inc;
3816-+
3817-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3818-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
3819-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3820-+
3821-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3822-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
3823-+
3824-+DROP FUNCTION test_f;
3825-+
3826-+SET GLOBAL debug=default;
3827---- /dev/null
3828-+++ b/mysql-test/t/percona_query_response_time.test
3829-@@ -0,0 +1,71 @@
3830-+--source include/have_response_time_distribution.inc
3831-+--source include/have_debug.inc
3832-+
3833-+SET GLOBAL debug="d,query_exec_time_debug";
3834-+
3835-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
3836-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3837-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
3838-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3839-+
3840-+source include/percona_query_response_time_flush.inc;
3841-+source include/percona_query_response_time_show.inc;
3842-+
3843-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3844-+source include/percona_query_response_time_sleep.inc;
3845-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3846-+
3847-+source include/percona_query_response_time_show.inc;
3848-+
3849-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3850-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
3851-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3852-+
3853-+source include/percona_query_response_time_flush.inc;
3854-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3855-+source include/percona_query_response_time_sleep.inc;
3856-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3857-+
3858-+source include/percona_query_response_time_show.inc;
3859-+
3860-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3861-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
3862-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3863-+
3864-+source include/percona_query_response_time_flush.inc;
3865-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3866-+source include/percona_query_response_time_sleep.inc;
3867-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3868-+
3869-+source include/percona_query_response_time_show.inc;
3870-+
3871-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3872-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
3873-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3874-+
3875-+source include/percona_query_response_time_flush.inc;
3876-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3877-+source include/percona_query_response_time_sleep.inc;
3878-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3879-+
3880-+source include/percona_query_response_time_show.inc;
3881-+
3882-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3883-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
3884-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3885-+
3886-+source include/percona_query_response_time_flush.inc;
3887-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
3888-+source include/percona_query_response_time_sleep.inc;
3889-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3890-+
3891-+source include/percona_query_response_time_show.inc;
3892-+
3893-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3894-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
3895-+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
3896-+
3897-+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
3898-+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
3899-+
3900-+SET GLOBAL debug=default;
3901
3902=== modified file 'patches/series'
3903--- patches/series 2011-09-03 15:15:31 +0000
3904+++ patches/series 2011-09-07 14:03:34 +0000
3905@@ -34,8 +34,8 @@
3906 query_cache_enhance.patch
3907 log_connection_error.patch
3908 mysql_syslog.patch
3909+error_pad.patch
3910 response_time_distribution.patch
3911-error_pad.patch
3912 remove_fcntl_excessive_calls.patch
3913 sql_no_fcache.patch
3914 show_slave_status_nolock.patch
3915
3916=== modified file 'patches/slow_extended.patch'
3917--- patches/slow_extended.patch 2011-09-03 15:15:31 +0000
3918+++ patches/slow_extended.patch 2011-09-07 14:03:34 +0000
3919@@ -634,10 +634,14 @@
3920 enum enum_slave_exec_mode { SLAVE_EXEC_MODE_STRICT,
3921 SLAVE_EXEC_MODE_IDEMPOTENT,
3922 SLAVE_EXEC_MODE_LAST_BIT};
3923-@@ -508,6 +535,17 @@
3924+@@ -508,6 +535,21 @@
3925
3926 my_bool sysdate_is_now;
3927
3928++#ifndef DBUG_OFF
3929++ ulonglong query_exec_time;
3930++ double query_exec_time_double;
3931++#endif
3932 + ulong log_slow_rate_limit;
3933 + ulonglong log_slow_filter;
3934 + ulonglong log_slow_verbosity;
3935@@ -652,7 +656,7 @@
3936 double long_query_time_double;
3937
3938 } SV;
3939-@@ -1140,6 +1178,14 @@
3940+@@ -1140,6 +1182,14 @@
3941 uint in_sub_stmt;
3942 bool enable_slow_log;
3943 bool last_insert_id_used;
3944@@ -667,7 +671,7 @@
3945 SAVEPOINT *savepoints;
3946 enum enum_check_fields count_cuted_fields;
3947 };
3948-@@ -1588,6 +1634,26 @@
3949+@@ -1588,6 +1638,26 @@
3950 thr_lock_type update_lock_default;
3951 Delayed_insert *di;
3952
3953@@ -714,15 +718,76 @@
3954 }
3955 --- a/sql/sql_parse.cc
3956 +++ b/sql/sql_parse.cc
3957-@@ -1430,7 +1430,6 @@
3958+@@ -114,6 +114,7 @@
3959+
3960+ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables);
3961+ static void sql_kill(THD *thd, ulong id, bool only_kill_query);
3962++static inline ulonglong get_query_exec_time(THD *thd, ulonglong cur_utime);
3963+
3964+ const char *any_db="*any*"; // Special symbol for check_access
3965+
3966+@@ -1430,6 +1431,60 @@
3967 DBUG_RETURN(error);
3968 }
3969
3970--
3971++/**
3972++ Calculate execution time for the current query.
3973++
3974++ For debug builds, check the session value of query_exec_time
3975++ and if it is not zero, return it instead of the actual execution time.
3976++
3977++ SET queries are ignored so that statements changing query_exec_time are not
3978++ affected by themselves.
3979++
3980++ @param thd thread handle
3981++ @param lex current relative time in microseconds
3982++
3983++ @return time in microseconds from utime_after_lock
3984++*/
3985++
3986++static inline ulonglong get_query_exec_time(THD *thd, ulonglong cur_utime)
3987++{
3988++ ulonglong res;
3989++#ifndef DBUG_OFF
3990++ if (thd->variables.query_exec_time != 0)
3991++ res= thd->lex->sql_command != SQLCOM_SET_OPTION ?
3992++ thd->variables.query_exec_time : 0;
3993++ else
3994++#endif
3995++
3996++ res= cur_utime - thd->utime_after_lock;
3997++
3998++ if (res > thd->variables.long_query_time)
3999++ thd->server_status|= SERVER_QUERY_WAS_SLOW;
4000++ else
4001++ thd->server_status&= ~SERVER_QUERY_WAS_SLOW;
4002++
4003++ return res;
4004++}
4005++
4006++
4007++static inline void copy_global_to_session(THD *thd, ulong flag,
4008++ const ulong *val)
4009++{
4010++ my_ptrdiff_t offset = ((char *)val - (char *)&global_system_variables);
4011++ if (opt_slow_query_log_use_global_control & (1ULL << flag))
4012++ *(ulong *)((char *) &thd->variables + offset) = *val;
4013++}
4014++
4015++
4016++static inline void copy_global_to_session(THD *thd, ulong flag,
4017++ const ulonglong *val)
4018++{
4019++ my_ptrdiff_t offset = ((char *)val - (char *)&global_system_variables);
4020++ if (opt_slow_query_log_use_global_control & (1ULL << flag))
4021++ *(ulonglong *)((char *) &thd->variables + offset) = *val;
4022++}
4023++
4024++
4025+
4026 void log_slow_statement(THD *thd)
4027 {
4028- DBUG_ENTER("log_slow_statement");
4029-@@ -1443,6 +1442,42 @@
4030+@@ -1443,13 +1498,48 @@
4031 if (unlikely(thd->in_sub_stmt))
4032 DBUG_VOID_RETURN; // Don't set time for sub stmt
4033
4034@@ -733,6 +798,9 @@
4035 + (thd->query_plan_flags & QPLAN_QC))))
4036 + DBUG_VOID_RETURN;
4037 +
4038++ ulonglong end_utime_of_query= thd->current_utime();
4039++ ulonglong query_exec_time= get_query_exec_time(thd, end_utime_of_query);
4040++
4041 + /*
4042 + Low long_query_time value most likely means user is debugging stuff and even
4043 + though some thread's queries are not supposed to be logged b/c of the rate
4044@@ -740,32 +808,36 @@
4045 + to make an exception and write to slow log anyway.
4046 + */
4047 +
4048-+ ulonglong end_utime_of_query= thd->current_utime();
4049-+#define USE_GLOBAL_UPDATE(variable_name,enum_value_name) \
4050-+ if (opt_slow_query_log_use_global_control & (ULL(1) << enum_value_name)) \
4051-+ { \
4052-+ thd->variables. variable_name= \
4053-+ global_system_variables. variable_name; \
4054-+ }
4055-+ USE_GLOBAL_UPDATE(log_slow_filter,SLOG_UG_LOG_SLOW_FILTER);
4056-+ USE_GLOBAL_UPDATE(log_slow_rate_limit,SLOG_UG_LOG_SLOW_RATE_LIMIT);
4057-+ USE_GLOBAL_UPDATE(log_slow_verbosity,SLOG_UG_LOG_SLOW_VERBOSITY);
4058-+ USE_GLOBAL_UPDATE(long_query_time,SLOG_UG_LONG_QUERY_TIME);
4059-+ USE_GLOBAL_UPDATE(long_query_time_double,SLOG_UG_LONG_QUERY_TIME);
4060-+ USE_GLOBAL_UPDATE(min_examined_row_limit,SLOG_UG_MIN_EXAMINED_ROW_LIMIT);
4061-+#undef USE_GLOBAL_UPDATE
4062++ system_variables const &g= global_system_variables;
4063++ copy_global_to_session(thd, SLOG_UG_LOG_SLOW_FILTER,
4064++ &g.log_slow_filter);
4065++ copy_global_to_session(thd, SLOG_UG_LOG_SLOW_RATE_LIMIT,
4066++ &g.log_slow_rate_limit);
4067++ copy_global_to_session(thd, SLOG_UG_LOG_SLOW_VERBOSITY,
4068++ &g.log_slow_verbosity);
4069++ copy_global_to_session(thd, SLOG_UG_LONG_QUERY_TIME,
4070++ &g.long_query_time);
4071++ copy_global_to_session(thd, SLOG_UG_MIN_EXAMINED_ROW_LIMIT,
4072++ &g.min_examined_row_limit);
4073 +
4074 + /* Do not log this thread's queries due to rate limiting. */
4075 + if (thd->write_to_slow_log != TRUE
4076 + && (thd->variables.long_query_time >= 1000000
4077-+ || (ulong) (end_utime_of_query - thd->utime_after_lock) < 1000000))
4078++ || (ulong) query_exec_time < 1000000))
4079 + DBUG_VOID_RETURN;
4080 +
4081 +
4082 /*
4083 Do not log administrative statements unless the appropriate option is
4084 set.
4085-@@ -1879,6 +1914,9 @@
4086+ */
4087+ if (thd->enable_slow_log)
4088+ {
4089+- ulonglong end_utime_of_query= thd->current_utime();
4090+ thd_proc_info(thd, "logging slow query");
4091+
4092+ if (((thd->server_status & SERVER_QUERY_WAS_SLOW) ||
4093+@@ -1879,6 +1969,9 @@
4094 context.resolve_in_table_list_only(select_lex->
4095 table_list.first);
4096
4097@@ -775,7 +847,7 @@
4098 /*
4099 Reset warning count for each query that uses tables
4100 A better approach would be to reset this for any commands
4101-@@ -5297,6 +5335,21 @@
4102+@@ -5297,6 +5390,21 @@
4103 thd->rand_used= 0;
4104 thd->sent_row_count= thd->examined_row_count= 0;
4105
4106@@ -876,7 +948,37 @@
4107 {
4108 --- a/sql/sys_vars.cc
4109 +++ b/sql/sys_vars.cc
4110-@@ -2898,6 +2898,117 @@
4111+@@ -972,6 +972,29 @@
4112+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
4113+ ON_UPDATE(update_cached_long_query_time));
4114+
4115++#ifndef DBUG_OFF
4116++static bool update_cached_query_exec_time(sys_var *self, THD *thd,
4117++ enum_var_type type)
4118++{
4119++ if (type == OPT_SESSION)
4120++ thd->variables.query_exec_time=
4121++ double2ulonglong(thd->variables.query_exec_time_double * 1e6);
4122++ else
4123++ global_system_variables.query_exec_time=
4124++ double2ulonglong(global_system_variables.query_exec_time_double * 1e6);
4125++ return false;
4126++}
4127++
4128++static Sys_var_double Sys_query_exec_time(
4129++ "query_exec_time",
4130++ "Pretend queries take this many seconds. When 0 (the default) use the "
4131++ "actual execution time. Used only for debugging.",
4132++ SESSION_VAR(query_exec_time_double),
4133++ NO_CMD_LINE, VALID_RANGE(0, LONG_TIMEOUT), DEFAULT(0),
4134++ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0),
4135++ ON_UPDATE(update_cached_query_exec_time));
4136++#endif
4137++
4138+ static bool fix_low_prio_updates(sys_var *self, THD *thd, enum_var_type type)
4139+ {
4140+ if (type == OPT_SESSION)
4141+@@ -2898,6 +2921,117 @@
4142 DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
4143 ON_UPDATE(fix_log_state));
4144
4145@@ -1243,24 +1345,55 @@
4146
4147 # endif /* HAVE_PROFILING */
4148 --- /dev/null
4149-+++ b/mysql-test/include/grep.inc
4150-@@ -0,0 +1,16 @@
4151++++ b/mysql-test/include/log_grep.inc
4152+@@ -0,0 +1,17 @@
4153++--disable_query_log
4154++--echo [log_grep.inc] file: $log_file pattern: $grep_pattern
4155 +perl;
4156-+
4157-+ $file = $ENV{'grep_file'};
4158-+ $pattern = $ENV{'grep_pattern'};
4159-+
4160-+ open(FILE, "$file")
4161-+ or die("Cannot open file $file: $!\n");
4162++ $log_file= $ENV{'log_file'};
4163++ $log_file_full_path= $ENV{'log_file_full_path'};
4164++ $grep_pattern= $ENV{'grep_pattern'};
4165++
4166++ open(FILE, "$log_file_full_path")
4167++ or die("Cannot open file $log_file_full_path: $!\n");
4168 +
4169 + $lines = 0;
4170 + while(<FILE>) {
4171-+ $lines++ if (/$pattern/);
4172++ $lines++ if (/$grep_pattern/);
4173 + }
4174-+ print "$lines\n";
4175-+
4176-+ close(FILE);
4177-+EOF
4178++ close(FILE);
4179++ print "[log_grep.inc] lines: $lines\n";
4180++EOF
4181+--- /dev/null
4182++++ b/mysql-test/include/log_start.inc
4183+@@ -0,0 +1,16 @@
4184++--disable_query_log
4185++--let log_file_full_path = $MYSQLTEST_VARDIR/$log_file
4186++SET @slow_query_log_old=@@slow_query_log;
4187++SET @slow_query_log_file_old= @@slow_query_log_file;
4188++SET GLOBAL slow_query_log=OFF;
4189++perl;
4190++ $log_file_full_path= $ENV{'log_file_full_path'};
4191++ unlink $log_file_full_path;
4192++ open(FILE, '>', $log_file_full_path)
4193++ or die "Cannot create log file $log_file_full_path, reason: $!";
4194++ close(FILE);
4195++EOF
4196++--echo [log_start.inc] $log_file
4197++EVAL SET GLOBAL slow_query_log_file="$log_file_full_path";
4198++SET GLOBAL slow_query_log=ON;
4199++--enable_query_log
4200+\ No newline at end of file
4201+--- /dev/null
4202++++ b/mysql-test/include/log_stop.inc
4203+@@ -0,0 +1,7 @@
4204++--disable_query_log
4205++FLUSH LOGS;
4206++SET GLOBAL slow_query_log=OFF;
4207++--echo [log_stop.inc] $log_file
4208++SET GLOBAL slow_query_log_file= @slow_query_log_file_old;
4209++SET GLOBAL slow_query_log= @slow_query_log_old;
4210++--enable_query_log
4211 --- /dev/null
4212 +++ b/mysql-test/r/percona_bug643149.result
4213 @@ -0,0 +1,21 @@
4214@@ -1286,424 +1419,313 @@
4215 +# Profile_total: X.X Profile_total_cpu: X.X
4216 +SET GLOBAL slow_query_log_file=@old_slow_query_log_file;
4217 --- /dev/null
4218-+++ b/mysql-test/r/percona_slow_extended-log_slow_filter.result
4219-@@ -0,0 +1,25 @@
4220-+drop table if exists t;
4221-+# Create test table
4222-+create table t(id INT PRIMARY KEY) engine=InnoDB;
4223-+# Insert two rows to test table
4224-+insert into t values(1);
4225-+insert into t values(2);
4226-+insert into t values(3);
4227-+SET GLOBAL SLOW_QUERY_LOG=ON;
4228-+SELECT sleep(2);
4229-+sleep(2)
4230-+0
4231-+set log_slow_filter=full_join;
4232-+SELECT sleep(2) union select t2.id from t as t1,t as t2;
4233-+sleep(2)
4234-+0
4235-+1
4236-+2
4237-+3
4238-+SELECT sleep(2);
4239-+sleep(2)
4240-+0
4241-+SET GLOBAL SLOW_QUERY_LOG=OFF;
4242-+drop table if exists t;
4243-+FLUSH LOGS;
4244-+2
4245---- /dev/null
4246-+++ b/mysql-test/r/percona_slow_extended-log_slow_sp_statements-cl.result
4247-@@ -0,0 +1,3 @@
4248-+show global variables like 'log_slow_sp_statements';
4249-+Variable_name Value
4250-+log_slow_sp_statements ON
4251---- /dev/null
4252-+++ b/mysql-test/r/percona_slow_extended-log_slow_verbosity-cl.result
4253-@@ -0,0 +1,9 @@
4254-+show global variables like 'log_slow_verbosity';
4255-+Variable_name Value
4256-+log_slow_verbosity microtime,query_plan,innodb
4257-+show variables like 'log_slow_verbosity';
4258-+Variable_name Value
4259-+log_slow_verbosity microtime,query_plan,innodb
4260-+select @@log_slow_verbosity;
4261-+@@log_slow_verbosity
4262-+microtime,query_plan,innodb
4263---- /dev/null
4264-+++ b/mysql-test/r/percona_slow_extended-log_slow_verbosity.result
4265-@@ -0,0 +1,9 @@
4266-+SELECT sleep(2);
4267-+sleep(2)
4268-+0
4269-+set log_slow_verbosity=innodb;
4270-+SELECT sleep(2);
4271-+sleep(2)
4272-+0
4273-+FLUSH LOGS;
4274-+1
4275---- /dev/null
4276-+++ b/mysql-test/r/percona_slow_extended-long_query_time.result
4277++++ b/mysql-test/r/percona_log_slow_filter-cl.result
4278+@@ -0,0 +1,6 @@
4279++SHOW VARIABLES LIKE 'log_slow_filter';
4280++Variable_name Value
4281++log_slow_filter full_join
4282++SHOW GLOBAL VARIABLES LIKE 'log_slow_filter';
4283++Variable_name Value
4284++log_slow_filter full_join
4285+--- /dev/null
4286++++ b/mysql-test/r/percona_log_slow_filter.result
4287+@@ -0,0 +1,15 @@
4288++CREATE TABLE t(id INT PRIMARY KEY);
4289++INSERT INTO t VALUES(1);
4290++INSERT INTO t VALUES(2);
4291++INSERT INTO t VALUES(3);
4292++SET long_query_time=1;
4293++SET log_slow_filter=full_join;
4294++[log_start.inc] percona.slow_extended.log_slow_filter
4295++SET query_exec_time = 1.1;
4296++SELECT * FROM t AS t1, t AS t2;
4297++SET query_exec_time = default;
4298++[log_stop.inc] percona.slow_extended.log_slow_filter
4299++SET log_slow_filter=default;
4300++SET long_query_time=default;
4301++[log_grep.inc] file: percona.slow_extended.log_slow_filter pattern: Query_time
4302++[log_grep.inc] lines: 1
4303+--- /dev/null
4304++++ b/mysql-test/r/percona_log_slow_slave_statements-cl.result
4305+@@ -0,0 +1,6 @@
4306++SHOW VARIABLES LIKE 'log_slow_slave_statements';
4307++Variable_name Value
4308++log_slow_slave_statements ON
4309++SHOW GLOBAL VARIABLES LIKE 'log_slow_slave_statements';
4310++Variable_name Value
4311++log_slow_slave_statements ON
4312+--- /dev/null
4313++++ b/mysql-test/r/percona_log_slow_slave_statements-innodb.result
4314+@@ -0,0 +1,18 @@
4315++include/master-slave.inc
4316++[connection master]
4317++DROP TABLE IF EXISTS t;
4318++CREATE TABLE t(id INT,data CHAR(30)) ENGINE=InnoDB;
4319++INSERT INTO t VALUES
4320++(1,"aaaaabbbbbcccccdddddeeeeefffff"),
4321++(2,"aaaaabbbbbcccccdddddeeeeefffff"),
4322++(3,"aaaaabbbbbcccccdddddeeeeefffff"),
4323++(4,"aaaaabbbbbcccccdddddeeeeefffff"),
4324++(5,"aaaaabbbbbcccccdddddeeeeefffff");
4325++INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2;
4326++INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2;
4327++[log_start.inc] percona.slow_extended.log_slow_slave_statements-innodb
4328++INSERT INTO t SELECT t.id,t.data from t;
4329++[log_stop.inc] percona.slow_extended.log_slow_slave_statements-innodb
4330++[log_grep.inc] file: percona.slow_extended.log_slow_slave_statements-innodb pattern: InnoDB_IO_r_ops
4331++[log_grep.inc] lines: 1
4332++include/rpl_end.inc
4333+--- /dev/null
4334++++ b/mysql-test/r/percona_log_slow_slave_statements.result
4335+@@ -0,0 +1,44 @@
4336++include/master-slave.inc
4337++[connection master]
4338++DROP TABLE IF EXISTS t;
4339++CREATE TABLE t(id INT);
4340++[log_start.inc] percona.slow_extended.log_slow_slave_statements
4341++LINE 1
4342++LOG_SLOW_SLAVE_STATAMENTS is OFF
4343++LOG_SLOW_SLAVE_STATEMENTS=ON
4344++LOG_SLOW_SLAVE_STATAMENTS is ON
4345++LINE 2
4346++include/restart_slave.inc
4347++LOG_SLOW_SLAVE_STATAMENTS is ON
4348++LINE 3
4349++LOG_SLOW_SLAVE_STATAMENTS is ON
4350++LOG_SLOW_SLAVE_STATEMENTS=OFF
4351++LOG_SLOW_SLAVE_STATAMENTS is OFF
4352++LINE 4
4353++include/restart_slave.inc
4354++LOG_SLOW_SLAVE_STATAMENTS is OFF
4355++LINE 5
4356++LOG_SLOW_SLAVE_STATAMENTS is OFF
4357++LOG_SLOW_SLAVE_STATEMENTS=ON
4358++LOG_SLOW_SLAVE_STATAMENTS is ON
4359++LINE 6
4360++include/restart_slave.inc
4361++LOG_SLOW_SLAVE_STATAMENTS is ON
4362++LINE 7
4363++[log_stop.inc] percona.slow_extended.log_slow_slave_statements
4364++SET GLOBAL log_slow_slave_statements=default;
4365++[log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(1\)
4366++[log_grep.inc] lines: 0
4367++[log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(2\)
4368++[log_grep.inc] lines: 0
4369++[log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(3\)
4370++[log_grep.inc] lines: 1
4371++[log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(4\)
4372++[log_grep.inc] lines: 0
4373++[log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(5\)
4374++[log_grep.inc] lines: 0
4375++[log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(6\)
4376++[log_grep.inc] lines: 0
4377++[log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(7\)
4378++[log_grep.inc] lines: 1
4379++include/rpl_end.inc
4380+--- /dev/null
4381++++ b/mysql-test/r/percona_log_slow_sp_statements-cl.result
4382+@@ -0,0 +1,6 @@
4383++SHOW VARIABLES LIKE 'log_slow_sp_statements';
4384++Variable_name Value
4385++log_slow_sp_statements ON
4386++SHOW GLOBAL VARIABLES LIKE 'log_slow_sp_statements';
4387++Variable_name Value
4388++log_slow_sp_statements ON
4389+--- /dev/null
4390++++ b/mysql-test/r/percona_log_slow_sp_statements.result
4391 @@ -0,0 +1,24 @@
4392-+SET GLOBAL SLOW_QUERY_LOG=ON;
4393-+SELECT sleep(1);
4394-+sleep(1)
4395-+0
4396-+SELECT sleep(3);
4397-+sleep(3)
4398-+0
4399-+SELECT sleep(5);
4400-+sleep(5)
4401-+0
4402-+set long_query_time=4;
4403-+SELECT sleep(1);
4404-+sleep(1)
4405-+0
4406-+SELECT sleep(3);
4407-+sleep(3)
4408-+0
4409-+SELECT sleep(5);
4410-+sleep(5)
4411-+0
4412-+set long_query_time=2;
4413-+SET GLOBAL SLOW_QUERY_LOG=OFF;
4414-+FLUSH LOGS;
4415-+3
4416---- /dev/null
4417-+++ b/mysql-test/r/percona_slow_extended-microseconds_in_slow_extended.result
4418-@@ -0,0 +1,13 @@
4419-+SET GLOBAL SLOW_QUERY_LOG=ON;
4420-+SELECT sleep(2);
4421-+sleep(2)
4422-+0
4423-+set global slow_query_log_timestamp_precision='microsecond';
4424-+SELECT sleep(2);
4425-+sleep(2)
4426-+0
4427-+set global slow_query_log_timestamp_precision='second';
4428-+SET GLOBAL SLOW_QUERY_LOG=OFF;
4429-+FLUSH LOGS;
4430-+1
4431-+2
4432---- /dev/null
4433-+++ b/mysql-test/r/percona_slow_extended-min_examined_row_limit.result
4434-@@ -0,0 +1,25 @@
4435-+drop table if exists t;
4436-+# Create test table
4437-+create table t(id INT PRIMARY KEY) engine=InnoDB;
4438-+# Insert two rows to test table
4439-+insert into t values(1);
4440-+insert into t values(2);
4441-+insert into t values(3);
4442-+SET GLOBAL SLOW_QUERY_LOG=ON;
4443-+SELECT sleep(2);
4444-+sleep(2)
4445-+0
4446-+set min_examined_row_limit=5;
4447-+SELECT sleep(2) union select t2.id from t as t1,t as t2;
4448-+sleep(2)
4449-+0
4450-+1
4451-+2
4452-+3
4453-+SELECT sleep(2);
4454-+sleep(2)
4455-+0
4456-+SET GLOBAL SLOW_QUERY_LOG=OFF;
4457-+drop table if exists t;
4458-+FLUSH LOGS;
4459-+2
4460---- /dev/null
4461-+++ b/mysql-test/r/percona_slow_extended-slave_innodb_stats.result
4462-@@ -0,0 +1,22 @@
4463-+include/master-slave.inc
4464-+[connection master]
4465-+DROP TABLE IF EXISTS t;
4466-+CREATE TABLE t(id INT,data CHAR(30)) ENGINE=InnoDB;
4467-+INSERT INTO t VALUES
4468-+(1,"aaaaabbbbbcccccdddddeeeeefffff"),
4469-+(2,"aaaaabbbbbcccccdddddeeeeefffff"),
4470-+(3,"aaaaabbbbbcccccdddddeeeeefffff"),
4471-+(4,"aaaaabbbbbcccccdddddeeeeefffff"),
4472-+(5,"aaaaabbbbbcccccdddddeeeeefffff");
4473-+INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2;
4474-+INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2;
4475-+STOP SLAVE;
4476-+include/wait_for_slave_to_stop.inc
4477-+START SLAVE;
4478-+include/wait_for_slave_to_start.inc
4479-+INSERT INTO t SELECT t.id,t.data from t;
4480-+DROP TABLE IF EXISTS t;
4481-+FLUSH LOGS;
4482-+4
4483-+STOP SLAVE;
4484-+include/wait_for_slave_to_stop.inc
4485---- /dev/null
4486-+++ b/mysql-test/r/percona_slow_extended-slave_statements-and-use_global_long_query_time.result
4487-@@ -0,0 +1,89 @@
4488-+include/master-slave.inc
4489-+[connection master]
4490-+DROP TABLE IF EXISTS t;
4491-+CREATE TABLE t(id INT);
4492-+START SLAVE;
4493-+include/wait_for_slave_to_start.inc
4494-+INSERT INTO t VALUES (1);
4495-+show variables like 'log_slow_slave_statements';
4496-+Variable_name Value
4497-+log_slow_slave_statements OFF
4498-+set global log_slow_slave_statements=ON;
4499-+show variables like 'log_slow_slave_statements';
4500-+Variable_name Value
4501-+log_slow_slave_statements ON
4502-+INSERT INTO t VALUES (2);
4503-+STOP SLAVE;
4504-+include/wait_for_slave_to_stop.inc
4505-+START SLAVE;
4506-+include/wait_for_slave_to_start.inc
4507-+INSERT INTO t VALUES (3);
4508-+show variables like 'long_query_time';
4509-+Variable_name Value
4510-+long_query_time 1.000000
4511-+show global variables like 'long_query_time';
4512-+Variable_name Value
4513-+long_query_time 1.000000
4514-+show global variables like 'slow_query_log_use_global_control';
4515-+Variable_name Value
4516-+slow_query_log_use_global_control
4517-+set global long_query_time=0;
4518-+show variables like 'long_query_time';
4519-+Variable_name Value
4520-+long_query_time 1.000000
4521-+show global variables like 'long_query_time';
4522-+Variable_name Value
4523-+long_query_time 0.000000
4524-+show global variables like 'slow_query_log_use_global_control';
4525-+Variable_name Value
4526-+slow_query_log_use_global_control
4527-+INSERT INTO t VALUES (4);
4528-+show variables like 'long_query_time';
4529-+Variable_name Value
4530-+long_query_time 1.000000
4531-+show global variables like 'long_query_time';
4532-+Variable_name Value
4533-+long_query_time 0.000000
4534-+show global variables like 'slow_query_log_use_global_control';
4535-+Variable_name Value
4536-+slow_query_log_use_global_control
4537-+set global slow_query_log_use_global_control='long_query_time';
4538-+show variables like 'long_query_time';
4539-+Variable_name Value
4540-+long_query_time 0.000000
4541-+show global variables like 'long_query_time';
4542-+Variable_name Value
4543-+long_query_time 0.000000
4544-+show global variables like 'slow_query_log_use_global_control';
4545-+Variable_name Value
4546-+slow_query_log_use_global_control long_query_time
4547-+INSERT INTO t VALUES (5);
4548-+show variables like 'long_query_time';
4549-+Variable_name Value
4550-+long_query_time 0.000000
4551-+show global variables like 'long_query_time';
4552-+Variable_name Value
4553-+long_query_time 0.000000
4554-+show global variables like 'slow_query_log_use_global_control';
4555-+Variable_name Value
4556-+slow_query_log_use_global_control long_query_time
4557-+set global long_query_time=1;
4558-+set global slow_query_log_use_global_control='';
4559-+FLUSH LOGS;
4560-+# Analyse master slow_query_log
4561-+0
4562-+0
4563-+0
4564-+0
4565-+0
4566-+FLUSH LOGS;
4567-+# Analyse slave slow_query_log
4568-+0
4569-+0
4570-+0
4571-+0
4572-+1
4573-+set global log_slow_slave_statements=OFF;
4574-+DROP TABLE t;
4575-+STOP SLAVE;
4576-+include/wait_for_slave_to_stop.inc
4577---- /dev/null
4578-+++ b/mysql-test/r/percona_slow_extended-slave_statements.result
4579-@@ -0,0 +1,94 @@
4580-+include/master-slave.inc
4581-+[connection master]
4582-+DROP TABLE IF EXISTS t;
4583-+CREATE TABLE t(id INT);
4584-+START SLAVE;
4585-+include/wait_for_slave_to_start.inc
4586-+INSERT INTO t VALUES (1);
4587-+show variables like 'log_slow_slave_statements';
4588-+Variable_name Value
4589-+log_slow_slave_statements OFF
4590-+set global log_slow_slave_statements=ON;
4591-+show variables like 'log_slow_slave_statements';
4592-+Variable_name Value
4593-+log_slow_slave_statements ON
4594-+INSERT INTO t VALUES (2);
4595-+show variables like 'log_slow_slave_statements';
4596-+Variable_name Value
4597-+log_slow_slave_statements ON
4598-+set global log_slow_slave_statements=ON;
4599-+show variables like 'log_slow_slave_statements';
4600-+Variable_name Value
4601-+log_slow_slave_statements ON
4602-+STOP SLAVE;
4603-+include/wait_for_slave_to_stop.inc
4604-+START SLAVE;
4605-+include/wait_for_slave_to_start.inc
4606-+show variables like 'log_slow_slave_statements';
4607-+Variable_name Value
4608-+log_slow_slave_statements ON
4609-+set global log_slow_slave_statements=ON;
4610-+show variables like 'log_slow_slave_statements';
4611-+Variable_name Value
4612-+log_slow_slave_statements ON
4613-+INSERT INTO t VALUES (3);
4614-+show variables like 'log_slow_slave_statements';
4615-+Variable_name Value
4616-+log_slow_slave_statements ON
4617-+set global log_slow_slave_statements=OFF;
4618-+show variables like 'log_slow_slave_statements';
4619-+Variable_name Value
4620-+log_slow_slave_statements OFF
4621-+INSERT INTO t VALUES (4);
4622-+show variables like 'log_slow_slave_statements';
4623-+Variable_name Value
4624-+log_slow_slave_statements OFF
4625-+STOP SLAVE;
4626-+include/wait_for_slave_to_stop.inc
4627-+START SLAVE;
4628-+include/wait_for_slave_to_start.inc
4629-+show variables like 'log_slow_slave_statements';
4630-+Variable_name Value
4631-+log_slow_slave_statements OFF
4632-+INSERT INTO t VALUES (5);
4633-+show variables like 'log_slow_slave_statements';
4634-+Variable_name Value
4635-+log_slow_slave_statements OFF
4636-+set global log_slow_slave_statements=ON;
4637-+show variables like 'log_slow_slave_statements';
4638-+Variable_name Value
4639-+log_slow_slave_statements ON
4640-+INSERT INTO t VALUES (6);
4641-+show variables like 'log_slow_slave_statements';
4642-+Variable_name Value
4643-+log_slow_slave_statements ON
4644-+STOP SLAVE;
4645-+include/wait_for_slave_to_stop.inc
4646-+START SLAVE;
4647-+include/wait_for_slave_to_start.inc
4648-+show variables like 'log_slow_slave_statements';
4649-+Variable_name Value
4650-+log_slow_slave_statements ON
4651-+INSERT INTO t VALUES (7);
4652-+FLUSH LOGS;
4653-+# Analyse master slow_query_log
4654-+1
4655-+1
4656-+1
4657-+1
4658-+1
4659-+1
4660-+1
4661-+FLUSH LOGS;
4662-+# Analyse slave slow_query_log
4663-+0
4664-+0
4665-+1
4666-+0
4667-+0
4668-+0
4669-+1
4670-+set global log_slow_slave_statements=OFF;
4671-+DROP TABLE t;
4672-+STOP SLAVE;
4673-+include/wait_for_slave_to_stop.inc
4674---- /dev/null
4675-+++ b/mysql-test/r/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.result
4676-@@ -0,0 +1,3 @@
4677-+show global variables like 'slow_query_log_timestamp_precision';
4678-+Variable_name Value
4679-+slow_query_log_timestamp_precision microsecond
4680---- /dev/null
4681-+++ b/mysql-test/r/percona_slow_extended-slow_query_log_timestamp_always-cl.result
4682-@@ -0,0 +1,3 @@
4683-+show global variables like 'slow_query_log_timestamp_always';
4684-+Variable_name Value
4685-+slow_query_log_timestamp_always ON
4686---- /dev/null
4687-+++ b/mysql-test/r/percona_slow_extended-use_global_control.result
4688-@@ -0,0 +1,12 @@
4689-+SELECT sleep(2);
4690-+sleep(2)
4691-+0
4692-+set global log_slow_verbosity=innodb;
4693-+set global slow_query_log_use_global_control="log_slow_verbosity,long_query_time";
4694-+SELECT sleep(2);
4695-+sleep(2)
4696-+0
4697-+set global slow_query_log_use_global_control='';
4698-+set global log_slow_verbosity='';
4699-+FLUSH LOGS;
4700-+1
4701---- /dev/null
4702-+++ b/mysql-test/r/percona_slow_extended-use_global_long_query_time.result
4703-@@ -0,0 +1,46 @@
4704-+SET GLOBAL SLOW_QUERY_LOG=ON;
4705-+SELECT sleep(1);
4706-+sleep(1)
4707-+0
4708-+SELECT sleep(3);
4709-+sleep(3)
4710-+0
4711-+SELECT sleep(5);
4712-+sleep(5)
4713-+0
4714-+set global long_query_time=4;
4715-+set global slow_query_log_use_global_control='long_query_time';
4716-+SELECT sleep(1);
4717-+sleep(1)
4718-+0
4719-+SELECT sleep(3);
4720-+sleep(3)
4721-+0
4722-+SELECT sleep(5);
4723-+sleep(5)
4724-+0
4725-+set global long_query_time=2;
4726-+set global slow_query_log_use_global_control='';
4727-+SET GLOBAL SLOW_QUERY_LOG=OFF;
4728-+FLUSH LOGS;
4729-+3
4730-+show global variables like 'slow_query_log_use_global_control';
4731-+Variable_name Value
4732-+slow_query_log_use_global_control
4733-+set global slow_query_log_use_global_control='long_query_time';
4734-+show global variables like 'slow_query_log_use_global_control';
4735-+Variable_name Value
4736-+slow_query_log_use_global_control long_query_time
4737-+set global slow_query_log_use_global_control='log_slow_filter,long_query_time';
4738-+show global variables like 'slow_query_log_use_global_control';
4739-+Variable_name Value
4740-+slow_query_log_use_global_control log_slow_filter,long_query_time
4741-+set global slow_query_log_use_global_control='log_slow_filter';
4742-+show global variables like 'slow_query_log_use_global_control';
4743-+Variable_name Value
4744-+slow_query_log_use_global_control log_slow_filter
4745-+set global slow_query_log_use_global_control='';
4746-+show global variables like 'slow_query_log_use_global_control';
4747-+Variable_name Value
4748-+slow_query_log_use_global_control
4749-+set global slow_query_log_use_global_control='long_query_time';
4750++SET long_query_time=1;
4751++SET GLOBAL log_slow_sp_statements=ON;
4752++SET SESSION query_exec_time=0.1;
4753++[log_start.inc] percona.slow_extended.log_slow_sp_statements
4754++CREATE PROCEDURE test_f()
4755++BEGIN
4756++SET SESSION query_exec_time=1.1; SELECT 1;
4757++SET SESSION query_exec_time=2.1; SELECT 1;
4758++SET SESSION query_exec_time=3.1; SELECT 1;
4759++SET SESSION query_exec_time=0.1;
4760++END^
4761++CALL test_f();
4762++1
4763++1
4764++1
4765++1
4766++1
4767++1
4768++[log_stop.inc] percona.slow_extended.log_slow_sp_statements
4769++SET SESSION query_exec_time=default;
4770++SET GLOBAL log_slow_sp_statements=default;
4771++SET long_query_time=default;
4772++[log_grep.inc] file: percona.slow_extended.log_slow_sp_statements pattern: Query_time
4773++[log_grep.inc] lines: 3
4774+--- /dev/null
4775++++ b/mysql-test/r/percona_log_slow_verbosity-cl.result
4776+@@ -0,0 +1,6 @@
4777++SHOW VARIABLES LIKE 'log_slow_verbosity';
4778++Variable_name Value
4779++log_slow_verbosity microtime,query_plan,innodb
4780++SHOW GLOBAL VARIABLES LIKE 'log_slow_verbosity';
4781++Variable_name Value
4782++log_slow_verbosity microtime,query_plan,innodb
4783+--- /dev/null
4784++++ b/mysql-test/r/percona_log_slow_verbosity.result
4785+@@ -0,0 +1,16 @@
4786++SET SESSION long_query_time=1;
4787++[log_start.inc] percona.slow_extended.log_slow_verbosity
4788++SET SESSION query_exec_time=2.1;
4789++SELECT 1;
4790++1
4791++1
4792++SET SESSION log_slow_verbosity=innodb;
4793++SELECT 1;
4794++1
4795++1
4796++SET SESSION query_exec_time=default;
4797++[log_stop.inc] percona.slow_extended.log_slow_verbosity
4798++SET log_slow_verbosity=default;
4799++SET long_query_time=default;
4800++[log_grep.inc] file: percona.slow_extended.log_slow_verbosity pattern: No InnoDB statistics available for this query
4801++[log_grep.inc] lines: 1
4802+--- /dev/null
4803++++ b/mysql-test/r/percona_long_query_time.result
4804+@@ -0,0 +1,33 @@
4805++SET long_query_time=2;
4806++[log_start.inc] percona.slow_extended.long_query_time
4807++SET SESSION query_exec_time=1.1;
4808++SELECT 1;
4809++1
4810++1
4811++SET SESSION query_exec_time=3.1;
4812++SELECT 1;
4813++1
4814++1
4815++SET SESSION query_exec_time=5.1;
4816++SELECT 1;
4817++1
4818++1
4819++SET long_query_time=4;
4820++SET SESSION query_exec_time=1.1;
4821++SELECT 1;
4822++1
4823++1
4824++SET SESSION query_exec_time=3.1;
4825++SELECT 1;
4826++1
4827++1
4828++SET SESSION query_exec_time=5.1;
4829++SELECT 1;
4830++1
4831++1
4832++SET SESSION query_exec_time=default;
4833++SET long_query_time=2;
4834++[log_stop.inc] percona.slow_extended.long_query_time
4835++SET long_query_time=default;
4836++[log_grep.inc] file: percona.slow_extended.long_query_time pattern: Query_time
4837++[log_grep.inc] lines: 3
4838+--- /dev/null
4839++++ b/mysql-test/r/percona_slow_query_log_timestamp_always-cl.result
4840+@@ -0,0 +1,6 @@
4841++SHOW VARIABLES LIKE 'slow_query_log_timestamp_always';
4842++Variable_name Value
4843++slow_query_log_timestamp_always ON
4844++SHOW GLOBAL VARIABLES LIKE 'slow_query_log_timestamp_always';
4845++Variable_name Value
4846++slow_query_log_timestamp_always ON
4847+--- /dev/null
4848++++ b/mysql-test/r/percona_slow_query_log_timestamp_always.result
4849+@@ -0,0 +1,41 @@
4850++SET long_query_time=2;
4851++SET GLOBAL slow_query_log_timestamp_always=ON;
4852++[log_start.inc] percona.slow_extended.slow_query_log_timestamp_always
4853++SET SESSION query_exec_time=2.1;
4854++SELECT 1;
4855++1
4856++1
4857++SELECT 1;
4858++1
4859++1
4860++SELECT 1;
4861++1
4862++1
4863++SET GLOBAL slow_query_log_timestamp_always=OFF;
4864++SET SESSION query_exec_time=2.1;
4865++SELECT 1;
4866++1
4867++1
4868++SELECT 1;
4869++1
4870++1
4871++SELECT 1;
4872++1
4873++1
4874++SET GLOBAL slow_query_log_timestamp_always=ON;
4875++SET SESSION query_exec_time=2.1;
4876++SELECT 1;
4877++1
4878++1
4879++SELECT 1;
4880++1
4881++1
4882++SELECT 1;
4883++1
4884++1
4885++SET SESSION query_exec_time=default;
4886++[log_stop.inc] percona.slow_extended.slow_query_log_timestamp_always
4887++SET GLOBAL slow_query_log_timestamp_always=default;
4888++SET long_query_time=default;
4889++[log_grep.inc] file: percona.slow_extended.slow_query_log_timestamp_always pattern: # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+
4890++[log_grep.inc] lines: 6
4891+--- /dev/null
4892++++ b/mysql-test/r/percona_slow_query_log_timestamp_precision-cl.result
4893+@@ -0,0 +1,6 @@
4894++SHOW VARIABLES LIKE 'slow_query_log_timestamp_precision';
4895++Variable_name Value
4896++slow_query_log_timestamp_precision microsecond
4897++SHOW GLOBAL VARIABLES LIKE 'slow_query_log_timestamp_precision';
4898++Variable_name Value
4899++slow_query_log_timestamp_precision microsecond
4900+--- /dev/null
4901++++ b/mysql-test/r/percona_slow_query_log_timestamp_precision.result
4902+@@ -0,0 +1,18 @@
4903++SET long_query_time=2;
4904++[log_start.inc] percona.slow_extended.slow_query_log_timestamp_precision
4905++SET SESSION query_exec_time=2.1;
4906++SELECT 1;
4907++1
4908++1
4909++SET GLOBAL slow_query_log_timestamp_precision='microsecond';
4910++SELECT 1;
4911++1
4912++1
4913++SET SESSION query_exec_time=default;
4914++[log_stop.inc] percona.slow_extended.slow_query_log_timestamp_precision
4915++SET GLOBAL slow_query_log_timestamp_precision=default;
4916++SET long_query_time=default;
4917++[log_grep.inc] file: percona.slow_extended.slow_query_log_timestamp_precision pattern: # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+.[0-9]+
4918++[log_grep.inc] lines: 1
4919++[log_grep.inc] file: percona.slow_extended.slow_query_log_timestamp_precision pattern: # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+
4920++[log_grep.inc] lines: 2
4921+--- /dev/null
4922++++ b/mysql-test/r/percona_slow_query_log_use_global_control.result
4923+@@ -0,0 +1,18 @@
4924++SET GLOBAL long_query_time=1;
4925++[log_start.inc] percona.slow_extended.slow_query_log_use_global_control
4926++SET SESSION query_exec_time=1.1;
4927++SELECT 1;
4928++1
4929++1
4930++SET GLOBAL log_slow_verbosity=innodb;
4931++SET GLOBAL slow_query_log_use_global_control="log_slow_verbosity,long_query_time";
4932++SELECT 1;
4933++1
4934++1
4935++SET SESSION query_exec_time=default;
4936++[log_stop.inc] percona.slow_extended.slow_query_log_use_global_control
4937++SET GLOBAL slow_query_log_use_global_control=default;
4938++SET GLOBAL log_slow_verbosity=default;
4939++SET GLOBAL long_query_time=default;
4940++[log_grep.inc] file: percona.slow_extended.slow_query_log_use_global_control pattern: No InnoDB statistics available for this query
4941++[log_grep.inc] lines: 1
4942 --- /dev/null
4943 +++ b/mysql-test/t/percona_bug643149.test
4944 @@ -0,0 +1,49 @@
4945@@ -1757,583 +1779,600 @@
4946 + --enable_query_log
4947 +}
4948 --- /dev/null
4949-+++ b/mysql-test/t/percona_slow_extended-log_slow_filter-master.opt
4950++++ b/mysql-test/t/percona_log_slow_filter-cl-master.opt
4951 @@ -0,0 +1 @@
4952-+--slow-query-log-file=percona_slow_query_log-log_slow_filter.log --long-query-time=1 --slow_query_log=OFF
4953---- /dev/null
4954-+++ b/mysql-test/t/percona_slow_extended-log_slow_filter.test
4955-@@ -0,0 +1,32 @@
4956-+source include/have_innodb.inc;
4957-+
4958-+--disable_warnings
4959-+drop table if exists t;
4960-+--enable_warnings
4961-+
4962-+--echo # Create test table
4963-+create table t(id INT PRIMARY KEY) engine=InnoDB;
4964-+--echo # Insert two rows to test table
4965-+insert into t values(1);
4966-+insert into t values(2);
4967-+insert into t values(3);
4968-+
4969-+SET GLOBAL SLOW_QUERY_LOG=ON;
4970-+
4971-+SELECT sleep(2);
4972-+
4973-+set log_slow_filter=full_join;
4974-+
4975-+SELECT sleep(2) union select t2.id from t as t1,t as t2;
4976-+SELECT sleep(2);
4977-+
4978-+SET GLOBAL SLOW_QUERY_LOG=OFF;
4979-+
4980-+--disable_warnings
4981-+drop table if exists t;
4982-+--enable_warnings
4983-+
4984-+FLUSH LOGS;
4985-+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-log_slow_filter.log
4986++--log_slow_filter=full_join
4987+--- /dev/null
4988++++ b/mysql-test/t/percona_log_slow_filter-cl.test
4989+@@ -0,0 +1,2 @@
4990++SHOW VARIABLES LIKE 'log_slow_filter';
4991++SHOW GLOBAL VARIABLES LIKE 'log_slow_filter';
4992+--- /dev/null
4993++++ b/mysql-test/t/percona_log_slow_filter.test
4994+@@ -0,0 +1,26 @@
4995++--source include/have_debug.inc
4996++
4997++CREATE TABLE t(id INT PRIMARY KEY);
4998++INSERT INTO t VALUES(1);
4999++INSERT INTO t VALUES(2);
5000++INSERT INTO t VALUES(3);
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches