Merge lp:~tsarev/percona-server/5.5_query_response_time_fix_bug_803867 into lp:percona-server/5.5

Proposed by Oleg Tsarev
Status: Superseded
Proposed branch: lp:~tsarev/percona-server/5.5_query_response_time_fix_bug_803867
Merge into: lp:percona-server/5.5
Diff against target: 3477 lines (+2018/-1140)
17 files modified
mysql-test/have_response_time_distribution.inc (+0/-4)
mysql-test/have_response_time_distribution.require (+0/-2)
mysql-test/response-time-distribution.patch/percona_query_response_time-replication.result (+0/-66)
mysql-test/response-time-distribution.patch/percona_query_response_time-replication.test (+0/-61)
mysql-test/response-time-distribution.patch/percona_query_response_time-stored.result (+0/-306)
mysql-test/response-time-distribution.patch/percona_query_response_time-stored.test (+0/-85)
mysql-test/response-time-distribution.patch/percona_query_response_time.result (+0/-377)
mysql-test/response-time-distribution.patch/percona_query_response_time.test (+0/-71)
mysql-test/response-time-distribution.patch/percona_query_response_time_flush.inc (+0/-1)
mysql-test/response-time-distribution.patch/percona_query_response_time_show.inc (+0/-8)
mysql-test/response-time-distribution.patch/percona_query_response_time_sleep.inc (+0/-19)
percona_suite.patch (+12/-0)
response_time_distribution.patch (+1901/-122)
series (+1/-0)
show_slave_status_nolock.patch (+2/-2)
slow_extended.patch (+94/-8)
userstat.patch (+8/-8)
To merge this branch: bzr merge lp:~tsarev/percona-server/5.5_query_response_time_fix_bug_803867
Reviewer Review Type Date Requested Status
Alexey Kopytov Pending
Review via email: mp+67024@code.launchpad.net

This proposal supersedes a proposal from 2011-07-04.

Description of the change

http://jenkins.percona.com/view/Percona%20Server%205.5/job/percona-server-5.5-param/33/

Fixes for bugs #712393 #803867
1) I move query_response_time_collect call from intermediate of log_slow_statement to begin.
Reason of bug #712393 - log_slow_statement exit before call query_response_time_collect
2) I move all DBUG_EXECUTE_IF (what used in percona_query_response_time.test) from response_time_distribution.patch to slow_extended.patch
This functionality requires in the slow_extended sporadic fails
3) If we set "debug" variable:
    SET [SESSION|GLOBAL] debug="+d,query_exec_time_debug"
we can setup exact query_exec_time through set "debug" variable:
    SET [SESSION|GLOBAL] debug="+d,query_exec_time_TIMES";
where TIMES is [0.31|0.32|0.33|0.34|0.35|0.36|0.37|0.38|0.39|0.4|0.5|1.1|1.2|1.3|1.4|1.5|2.1|2.3|2.5]
After this commit we can also add special comment to the begin of query:
    /* query_exec_time="TIMES" */ QUERY;
This changes requires for test SQL_Slave_Thread query execution.
4) I replace logic:
/*----------------------------------------*/
    DBUG_EXECUTE_IF("query_exec_time_debug",
                    if (query_execution_time == 0)
                      opt_query_response_time_stats= 0;
                    else
                      opt_query_response_time_stats= 1;);
/*----------------------------------------*/
By following:
/*----------------------------------------*/
void query_response_time_collect_with_check(ulonglong query_exec_time)
{
  DBUG_ENTER("query_response_time_collect_with_check");
  bool collect= opt_query_response_time_stats;
  DBUG_EXECUTE_IF("query_exec_time_debug",
                  {
                    if (0 == query_exec_time)
                    {
                      collect= false;
                    }
                  });
  if(collect)
  {
    query_response_time_collect(query_exec_time);
  }
  DBUG_VOID_RETURN;
}
/*----------------------------------------*/
Otherwise debug-code has bad side-effect - set QUERY_RESPONSE_TIME_STATS to OFF if query shouldn't collect
5) I rewrite tests for response_time_distribution.patch, now all test unified and wouldn't have sporadic fails in the feature.
This change fixes the bug #803867.
6) I also remove mysql-test/response_time_distribution.patch and move to patch.
  Now this is the suite "percona" and tests "query_response_time[-[stored|replication]]"

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote : Posted in a previous version of this proposal

Same comment as in MP #66741.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'mysql-test/have_response_time_distribution.inc'
--- mysql-test/have_response_time_distribution.inc 2011-01-17 01:49:51 +0000
+++ mysql-test/have_response_time_distribution.inc 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1-- require r/have_response_time_distribution.require
2disable_query_log;
3show variables like 'have_response_time_distribution';
4enable_query_log;
50
=== removed file 'mysql-test/have_response_time_distribution.require'
--- mysql-test/have_response_time_distribution.require 2011-01-17 01:49:51 +0000
+++ mysql-test/have_response_time_distribution.require 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
1Variable_name Value
2have_response_time_distribution YES
30
=== removed directory 'mysql-test/response-time-distribution.patch'
=== removed file 'mysql-test/response-time-distribution.patch/percona_query_response_time-replication.result'
--- mysql-test/response-time-distribution.patch/percona_query_response_time-replication.result 2011-04-10 07:34:52 +0000
+++ mysql-test/response-time-distribution.patch/percona_query_response_time-replication.result 1970-01-01 00:00:00 +0000
@@ -1,66 +0,0 @@
1include/master-slave.inc
2[connection master]
3DROP TABLE IF EXISTS t;
4CREATE TABLE t(id INT);
5SELECT * from t;
6id
7SELECT * from t;
8id
9SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
10Warnings:
11Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
12SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
13Variable_name Value
14query_response_time_range_base 2
15SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
16SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
17Variable_name Value
18query_response_time_range_base 10
19FLUSH QUERY_RESPONSE_TIME;
20SET GLOBAL QUERY_RESPONSE_TIME_STATS=ON;
21INSERT INTO t SELECT SLEEP(0.4);
22Warnings:
23Note 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.
24SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
25SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
260
27INSERT INTO t SELECT SLEEP(0.4);
28Warnings:
29Note 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.
30SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
31SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
320
33SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
34SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
352
36SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
37SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
383
39SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
40SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
41Variable_name Value
42query_response_time_range_base 2
43FLUSH QUERY_RESPONSE_TIME;
44INSERT INTO t SELECT SLEEP(0.4);
45Warnings:
46Note 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.
47SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
48SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
490
50INSERT INTO t SELECT SLEEP(0.4);
51Warnings:
52Note 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.
53SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
54SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
550
56SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
57SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
582
59SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
60SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
613
62DROP TABLE IF EXISTS t;
63SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
64SET GLOBAL QUERY_RESPONSE_TIME_STATS=OFF;
65STOP SLAVE;
66include/wait_for_slave_to_stop.inc
670
=== removed file 'mysql-test/response-time-distribution.patch/percona_query_response_time-replication.test'
--- mysql-test/response-time-distribution.patch/percona_query_response_time-replication.test 2011-04-10 07:34:52 +0000
+++ mysql-test/response-time-distribution.patch/percona_query_response_time-replication.test 1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
1--source include/have_response_time_distribution.inc
2--source include/master-slave.inc
3--source include/have_binlog_format_statement.inc
4--source include/have_debug.inc
5--disable_query_log
6call 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:");
7--enable_query_log
8
9connection master;
10-- disable_warnings
11DROP TABLE IF EXISTS t;
12-- enable_warnings
13CREATE TABLE t(id INT);
14SELECT * from t;
15
16sync_slave_with_master;
17
18connection slave;
19SELECT * from t;
20SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
21SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
22SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
23SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
24source include/percona_query_response_time_flush.inc;
25SET GLOBAL QUERY_RESPONSE_TIME_STATS=ON;
26
27connection master;
28INSERT INTO t SELECT SLEEP(0.4);
29SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
30INSERT INTO t SELECT SLEEP(0.4);
31SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
32sync_slave_with_master;
33
34connection slave;
35SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
36SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
37
38SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
39SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
40source include/percona_query_response_time_flush.inc;
41
42connection master;
43INSERT INTO t SELECT SLEEP(0.4);
44SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
45INSERT INTO t SELECT SLEEP(0.4);
46SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
47sync_slave_with_master;
48
49connection slave;
50SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
51SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
52
53connection master;
54DROP TABLE IF EXISTS t;
55sync_slave_with_master;
56connection slave;
57SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
58SET GLOBAL QUERY_RESPONSE_TIME_STATS=OFF;
59
60STOP SLAVE;
61-- source include/wait_for_slave_to_stop.inc
620
=== removed file 'mysql-test/response-time-distribution.patch/percona_query_response_time-stored.result'
--- mysql-test/response-time-distribution.patch/percona_query_response_time-stored.result 2011-04-10 07:34:52 +0000
+++ mysql-test/response-time-distribution.patch/percona_query_response_time-stored.result 1970-01-01 00:00:00 +0000
@@ -1,306 +0,0 @@
1SET GLOBAL debug="d,query_exec_time_debug";
2CREATE FUNCTION test_f()
3RETURNS CHAR(30) DETERMINISTIC
4BEGIN
5SET SESSION debug="+d,query_exec_time_1.1";
6RETURN 'Hello, world!';
7END/
8SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
9Warnings:
10Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
11SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
12Variable_name Value
13query_response_time_range_base 2
14SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
15SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
16Variable_name Value
17query_response_time_range_base 2
18FLUSH QUERY_RESPONSE_TIME;
19SELECT d.count,
20(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
21(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
22(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
23(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
24FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
25count query_count query_total not_zero_region_count region_count
26SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
27region_count
2844
29SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
30time
31 0.000001
32 0.000003
33 0.000007
34 0.000015
35 0.000030
36 0.000061
37 0.000122
38 0.000244
39 0.000488
40 0.000976
41 0.001953
42 0.003906
43 0.007812
44 0.015625
45 0.031250
46 0.062500
47 0.125000
48 0.250000
49 0.500000
50 1.000000
51 2.000000
52 4.000000
53 8.000000
54 16.000000
55 32.000000
56 64.000000
57 128.000000
58 256.000000
59 512.000000
60 1024.000000
61 2048.000000
62 4096.000000
63 8192.000000
64 16384.000000
65 32768.000000
66 65536.000000
67 131072.000000
68 262144.000000
69 524288.000000
70 1048576.00000
71 2097152.00000
72 4194304.00000
73 8388608.00000
74TOO LONG
75SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
76SELECT test_f();
77test_f()
78Hello, world!
79SELECT test_f();
80test_f()
81Hello, world!
82SELECT test_f();
83test_f()
84Hello, world!
85SELECT test_f();
86test_f()
87Hello, world!
88SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
89SELECT d.count,
90(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
91(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
92(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
93(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
94FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
95count query_count query_total not_zero_region_count region_count
964 4 4 1 44
97SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
98region_count
9944
100SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
101time
102 0.000001
103 0.000003
104 0.000007
105 0.000015
106 0.000030
107 0.000061
108 0.000122
109 0.000244
110 0.000488
111 0.000976
112 0.001953
113 0.003906
114 0.007812
115 0.015625
116 0.031250
117 0.062500
118 0.125000
119 0.250000
120 0.500000
121 1.000000
122 2.000000
123 4.000000
124 8.000000
125 16.000000
126 32.000000
127 64.000000
128 128.000000
129 256.000000
130 512.000000
131 1024.000000
132 2048.000000
133 4096.000000
134 8192.000000
135 16384.000000
136 32768.000000
137 65536.000000
138 131072.000000
139 262144.000000
140 524288.000000
141 1048576.00000
142 2097152.00000
143 4194304.00000
144 8388608.00000
145TOO LONG
146SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
147Variable_name Value
148query_response_time_range_base 2
149SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
150SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
151Variable_name Value
152query_response_time_range_base 10
153FLUSH QUERY_RESPONSE_TIME;
154SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
155SELECT test_f();
156test_f()
157Hello, world!
158SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
159SELECT d.count,
160(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
161(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
162(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
163(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
164FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
165count query_count query_total not_zero_region_count region_count
1661 1 1 1 14
167SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
168region_count
16914
170SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
171time
172 0.000001
173 0.000010
174 0.000100
175 0.001000
176 0.010000
177 0.100000
178 1.000000
179 10.000000
180 100.000000
181 1000.000000
182 10000.000000
183 100000.000000
184 1000000.00000
185TOO LONG
186SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
187Variable_name Value
188query_response_time_range_base 10
189SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
190SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
191Variable_name Value
192query_response_time_range_base 7
193FLUSH QUERY_RESPONSE_TIME;
194SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
195SELECT test_f();
196test_f()
197Hello, world!
198SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
199SELECT d.count,
200(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
201(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
202(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
203(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
204FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
205count query_count query_total not_zero_region_count region_count
2061 1 1 1 17
207SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
208region_count
20917
210SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
211time
212 0.000001
213 0.000008
214 0.000059
215 0.000416
216 0.002915
217 0.020408
218 0.142857
219 1.000000
220 7.000000
221 49.000000
222 343.000000
223 2401.000000
224 16807.000000
225 117649.000000
226 823543.000000
227 5764801.00000
228TOO LONG
229SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
230Variable_name Value
231query_response_time_range_base 7
232SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
233SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
234Variable_name Value
235query_response_time_range_base 156
236FLUSH QUERY_RESPONSE_TIME;
237SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
238SELECT test_f();
239test_f()
240Hello, world!
241SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
242SELECT d.count,
243(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
244(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
245(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
246(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
247FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
248count query_count query_total not_zero_region_count region_count
2491 1 1 1 7
250SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
251region_count
2527
253SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
254time
255 0.000041
256 0.006410
257 1.000000
258 156.000000
259 24336.000000
260 3796416.00000
261TOO LONG
262SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
263Variable_name Value
264query_response_time_range_base 156
265SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
266SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
267Variable_name Value
268query_response_time_range_base 1000
269FLUSH QUERY_RESPONSE_TIME;
270SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
271SELECT test_f();
272test_f()
273Hello, world!
274SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
275SELECT d.count,
276(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
277(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
278(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
279(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
280FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
281count query_count query_total not_zero_region_count region_count
2821 1 1 1 6
283SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
284region_count
2856
286SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
287time
288 0.000001
289 0.001000
290 1.000000
291 1000.000000
292 1000000.00000
293TOO LONG
294SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
295Variable_name Value
296query_response_time_range_base 1000
297SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
298Warnings:
299Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
300SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
301Variable_name Value
302query_response_time_range_base 1000
303SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
304SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
305DROP FUNCTION test_f;
306SET GLOBAL debug=default;
3070
=== removed file 'mysql-test/response-time-distribution.patch/percona_query_response_time-stored.test'
--- mysql-test/response-time-distribution.patch/percona_query_response_time-stored.test 2011-04-10 07:34:52 +0000
+++ mysql-test/response-time-distribution.patch/percona_query_response_time-stored.test 1970-01-01 00:00:00 +0000
@@ -1,85 +0,0 @@
1--source include/have_response_time_distribution.inc
2--source include/have_debug.inc
3
4SET GLOBAL debug="d,query_exec_time_debug";
5
6delimiter /;
7CREATE FUNCTION test_f()
8RETURNS CHAR(30) DETERMINISTIC
9BEGIN
10 SET SESSION debug="+d,query_exec_time_1.1";
11 RETURN 'Hello, world!';
12END/
13delimiter ;/
14
15SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
16SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
17SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
18SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
19
20source include/percona_query_response_time_flush.inc;
21source include/percona_query_response_time_show.inc;
22
23SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
24SELECT test_f();
25SELECT test_f();
26SELECT test_f();
27SELECT test_f();
28SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
29
30source include/percona_query_response_time_show.inc;
31
32SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
33SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
34SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
35
36source include/percona_query_response_time_flush.inc;
37SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
38SELECT test_f();
39SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
40
41source include/percona_query_response_time_show.inc;
42
43SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
44SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
45SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
46
47source include/percona_query_response_time_flush.inc;
48SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
49SELECT test_f();
50SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
51
52source include/percona_query_response_time_show.inc;
53
54SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
55SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
56SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
57
58source include/percona_query_response_time_flush.inc;
59SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
60SELECT test_f();
61SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
62
63source include/percona_query_response_time_show.inc;
64
65SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
66SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
67SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
68
69source include/percona_query_response_time_flush.inc;
70SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
71SELECT test_f();
72SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
73
74source include/percona_query_response_time_show.inc;
75
76SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
77SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
78SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
79
80SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
81SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
82
83DROP FUNCTION test_f;
84
85SET GLOBAL debug=default;
860
=== removed file 'mysql-test/response-time-distribution.patch/percona_query_response_time.result'
--- mysql-test/response-time-distribution.patch/percona_query_response_time.result 2011-04-10 07:34:52 +0000
+++ mysql-test/response-time-distribution.patch/percona_query_response_time.result 1970-01-01 00:00:00 +0000
@@ -1,377 +0,0 @@
1SET GLOBAL debug="d,query_exec_time_debug";
2SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
3Warnings:
4Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
5SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
6Variable_name Value
7query_response_time_range_base 2
8SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
9SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
10Variable_name Value
11query_response_time_range_base 2
12FLUSH QUERY_RESPONSE_TIME;
13SELECT d.count,
14(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
15(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
16(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
17(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
18FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
19count query_count query_total not_zero_region_count region_count
20SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
21region_count
2244
23SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
24time
25 0.000001
26 0.000003
27 0.000007
28 0.000015
29 0.000030
30 0.000061
31 0.000122
32 0.000244
33 0.000488
34 0.000976
35 0.001953
36 0.003906
37 0.007812
38 0.015625
39 0.031250
40 0.062500
41 0.125000
42 0.250000
43 0.500000
44 1.000000
45 2.000000
46 4.000000
47 8.000000
48 16.000000
49 32.000000
50 64.000000
51 128.000000
52 256.000000
53 512.000000
54 1024.000000
55 2048.000000
56 4096.000000
57 8192.000000
58 16384.000000
59 32768.000000
60 65536.000000
61 131072.000000
62 262144.000000
63 524288.000000
64 1048576.00000
65 2097152.00000
66 4194304.00000
67 8388608.00000
68TOO LONG
69SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
70SET SESSION debug="+d,query_exec_time_0.31";
71SET SESSION debug="+d,query_exec_time_0.32";
72SET SESSION debug="+d,query_exec_time_0.33";
73SET SESSION debug="+d,query_exec_time_0.34";
74SET SESSION debug="+d,query_exec_time_0.35";
75SET SESSION debug="+d,query_exec_time_0.36";
76SET SESSION debug="+d,query_exec_time_0.37";
77SET SESSION debug="+d,query_exec_time_0.38";
78SET SESSION debug="+d,query_exec_time_0.39";
79SET SESSION debug="+d,query_exec_time_0.4";
80SET SESSION debug="+d,query_exec_time_1.1";
81SET SESSION debug="+d,query_exec_time_1.2";
82SET SESSION debug="+d,query_exec_time_1.3";
83SET SESSION debug="+d,query_exec_time_1.5";
84SET SESSION debug="+d,query_exec_time_1.4";
85SET SESSION debug="+d,query_exec_time_0.5";
86SET SESSION debug="+d,query_exec_time_2.1";
87SET SESSION debug="+d,query_exec_time_2.3";
88SET SESSION debug="+d,query_exec_time_2.5";
89SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
90SELECT d.count,
91(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
92(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
93(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
94(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
95FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
96count query_count query_total not_zero_region_count region_count
9710 19 15 4 44
981 19 15 4 44
995 19 15 4 44
1003 19 15 4 44
101SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
102region_count
10344
104SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
105time
106 0.000001
107 0.000003
108 0.000007
109 0.000015
110 0.000030
111 0.000061
112 0.000122
113 0.000244
114 0.000488
115 0.000976
116 0.001953
117 0.003906
118 0.007812
119 0.015625
120 0.031250
121 0.062500
122 0.125000
123 0.250000
124 0.500000
125 1.000000
126 2.000000
127 4.000000
128 8.000000
129 16.000000
130 32.000000
131 64.000000
132 128.000000
133 256.000000
134 512.000000
135 1024.000000
136 2048.000000
137 4096.000000
138 8192.000000
139 16384.000000
140 32768.000000
141 65536.000000
142 131072.000000
143 262144.000000
144 524288.000000
145 1048576.00000
146 2097152.00000
147 4194304.00000
148 8388608.00000
149TOO LONG
150SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
151Variable_name Value
152query_response_time_range_base 2
153SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
154SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
155Variable_name Value
156query_response_time_range_base 10
157FLUSH QUERY_RESPONSE_TIME;
158SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
159SET SESSION debug="+d,query_exec_time_0.31";
160SET SESSION debug="+d,query_exec_time_0.32";
161SET SESSION debug="+d,query_exec_time_0.33";
162SET SESSION debug="+d,query_exec_time_0.34";
163SET SESSION debug="+d,query_exec_time_0.35";
164SET SESSION debug="+d,query_exec_time_0.36";
165SET SESSION debug="+d,query_exec_time_0.37";
166SET SESSION debug="+d,query_exec_time_0.38";
167SET SESSION debug="+d,query_exec_time_0.39";
168SET SESSION debug="+d,query_exec_time_0.4";
169SET SESSION debug="+d,query_exec_time_1.1";
170SET SESSION debug="+d,query_exec_time_1.2";
171SET SESSION debug="+d,query_exec_time_1.3";
172SET SESSION debug="+d,query_exec_time_1.5";
173SET SESSION debug="+d,query_exec_time_1.4";
174SET SESSION debug="+d,query_exec_time_0.5";
175SET SESSION debug="+d,query_exec_time_2.1";
176SET SESSION debug="+d,query_exec_time_2.3";
177SET SESSION debug="+d,query_exec_time_2.5";
178SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
179SELECT d.count,
180(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
181(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
182(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
183(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
184FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
185count query_count query_total not_zero_region_count region_count
18611 19 17 2 14
1878 19 17 2 14
188SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
189region_count
19014
191SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
192time
193 0.000001
194 0.000010
195 0.000100
196 0.001000
197 0.010000
198 0.100000
199 1.000000
200 10.000000
201 100.000000
202 1000.000000
203 10000.000000
204 100000.000000
205 1000000.00000
206TOO LONG
207SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
208Variable_name Value
209query_response_time_range_base 10
210SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
211SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
212Variable_name Value
213query_response_time_range_base 7
214FLUSH QUERY_RESPONSE_TIME;
215SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
216SET SESSION debug="+d,query_exec_time_0.31";
217SET SESSION debug="+d,query_exec_time_0.32";
218SET SESSION debug="+d,query_exec_time_0.33";
219SET SESSION debug="+d,query_exec_time_0.34";
220SET SESSION debug="+d,query_exec_time_0.35";
221SET SESSION debug="+d,query_exec_time_0.36";
222SET SESSION debug="+d,query_exec_time_0.37";
223SET SESSION debug="+d,query_exec_time_0.38";
224SET SESSION debug="+d,query_exec_time_0.39";
225SET SESSION debug="+d,query_exec_time_0.4";
226SET SESSION debug="+d,query_exec_time_1.1";
227SET SESSION debug="+d,query_exec_time_1.2";
228SET SESSION debug="+d,query_exec_time_1.3";
229SET SESSION debug="+d,query_exec_time_1.5";
230SET SESSION debug="+d,query_exec_time_1.4";
231SET SESSION debug="+d,query_exec_time_0.5";
232SET SESSION debug="+d,query_exec_time_2.1";
233SET SESSION debug="+d,query_exec_time_2.3";
234SET SESSION debug="+d,query_exec_time_2.5";
235SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
236SELECT d.count,
237(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
238(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
239(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
240(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
241FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
242count query_count query_total not_zero_region_count region_count
24311 19 17 2 17
2448 19 17 2 17
245SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
246region_count
24717
248SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
249time
250 0.000001
251 0.000008
252 0.000059
253 0.000416
254 0.002915
255 0.020408
256 0.142857
257 1.000000
258 7.000000
259 49.000000
260 343.000000
261 2401.000000
262 16807.000000
263 117649.000000
264 823543.000000
265 5764801.00000
266TOO LONG
267SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
268Variable_name Value
269query_response_time_range_base 7
270SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
271SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
272Variable_name Value
273query_response_time_range_base 156
274FLUSH QUERY_RESPONSE_TIME;
275SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
276SET SESSION debug="+d,query_exec_time_0.31";
277SET SESSION debug="+d,query_exec_time_0.32";
278SET SESSION debug="+d,query_exec_time_0.33";
279SET SESSION debug="+d,query_exec_time_0.34";
280SET SESSION debug="+d,query_exec_time_0.35";
281SET SESSION debug="+d,query_exec_time_0.36";
282SET SESSION debug="+d,query_exec_time_0.37";
283SET SESSION debug="+d,query_exec_time_0.38";
284SET SESSION debug="+d,query_exec_time_0.39";
285SET SESSION debug="+d,query_exec_time_0.4";
286SET SESSION debug="+d,query_exec_time_1.1";
287SET SESSION debug="+d,query_exec_time_1.2";
288SET SESSION debug="+d,query_exec_time_1.3";
289SET SESSION debug="+d,query_exec_time_1.5";
290SET SESSION debug="+d,query_exec_time_1.4";
291SET SESSION debug="+d,query_exec_time_0.5";
292SET SESSION debug="+d,query_exec_time_2.1";
293SET SESSION debug="+d,query_exec_time_2.3";
294SET SESSION debug="+d,query_exec_time_2.5";
295SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
296SELECT d.count,
297(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
298(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
299(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
300(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
301FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
302count query_count query_total not_zero_region_count region_count
30311 19 17 2 7
3048 19 17 2 7
305SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
306region_count
3077
308SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
309time
310 0.000041
311 0.006410
312 1.000000
313 156.000000
314 24336.000000
315 3796416.00000
316TOO LONG
317SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
318Variable_name Value
319query_response_time_range_base 156
320SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
321SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
322Variable_name Value
323query_response_time_range_base 1000
324FLUSH QUERY_RESPONSE_TIME;
325SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
326SET SESSION debug="+d,query_exec_time_0.31";
327SET SESSION debug="+d,query_exec_time_0.32";
328SET SESSION debug="+d,query_exec_time_0.33";
329SET SESSION debug="+d,query_exec_time_0.34";
330SET SESSION debug="+d,query_exec_time_0.35";
331SET SESSION debug="+d,query_exec_time_0.36";
332SET SESSION debug="+d,query_exec_time_0.37";
333SET SESSION debug="+d,query_exec_time_0.38";
334SET SESSION debug="+d,query_exec_time_0.39";
335SET SESSION debug="+d,query_exec_time_0.4";
336SET SESSION debug="+d,query_exec_time_1.1";
337SET SESSION debug="+d,query_exec_time_1.2";
338SET SESSION debug="+d,query_exec_time_1.3";
339SET SESSION debug="+d,query_exec_time_1.5";
340SET SESSION debug="+d,query_exec_time_1.4";
341SET SESSION debug="+d,query_exec_time_0.5";
342SET SESSION debug="+d,query_exec_time_2.1";
343SET SESSION debug="+d,query_exec_time_2.3";
344SET SESSION debug="+d,query_exec_time_2.5";
345SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
346SELECT d.count,
347(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
348(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
349(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
350(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
351FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
352count query_count query_total not_zero_region_count region_count
35311 19 17 2 6
3548 19 17 2 6
355SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
356region_count
3576
358SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
359time
360 0.000001
361 0.001000
362 1.000000
363 1000.000000
364 1000000.00000
365TOO LONG
366SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
367Variable_name Value
368query_response_time_range_base 1000
369SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
370Warnings:
371Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
372SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
373Variable_name Value
374query_response_time_range_base 1000
375SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
376SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
377SET GLOBAL debug=default;
3780
=== removed file 'mysql-test/response-time-distribution.patch/percona_query_response_time.test'
--- mysql-test/response-time-distribution.patch/percona_query_response_time.test 2011-04-10 07:34:52 +0000
+++ mysql-test/response-time-distribution.patch/percona_query_response_time.test 1970-01-01 00:00:00 +0000
@@ -1,71 +0,0 @@
1--source include/have_response_time_distribution.inc
2--source include/have_debug.inc
3
4SET GLOBAL debug="d,query_exec_time_debug";
5
6SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
7SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
8SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
9SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
10
11source include/percona_query_response_time_flush.inc;
12source include/percona_query_response_time_show.inc;
13
14SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
15source include/percona_query_response_time_sleep.inc;
16SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
17
18source include/percona_query_response_time_show.inc;
19
20SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
21SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
22SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
23
24source include/percona_query_response_time_flush.inc;
25SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
26source include/percona_query_response_time_sleep.inc;
27SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
28
29source include/percona_query_response_time_show.inc;
30
31SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
32SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
33SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
34
35source include/percona_query_response_time_flush.inc;
36SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
37source include/percona_query_response_time_sleep.inc;
38SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
39
40source include/percona_query_response_time_show.inc;
41
42SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
43SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
44SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
45
46source include/percona_query_response_time_flush.inc;
47SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
48source include/percona_query_response_time_sleep.inc;
49SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
50
51source include/percona_query_response_time_show.inc;
52
53SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
54SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
55SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
56
57source include/percona_query_response_time_flush.inc;
58SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
59source include/percona_query_response_time_sleep.inc;
60SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
61
62source include/percona_query_response_time_show.inc;
63
64SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
65SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
66SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
67
68SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
69SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
70
71SET GLOBAL debug=default;
720
=== removed file 'mysql-test/response-time-distribution.patch/percona_query_response_time_flush.inc'
--- mysql-test/response-time-distribution.patch/percona_query_response_time_flush.inc 2010-12-09 18:30:58 +0000
+++ mysql-test/response-time-distribution.patch/percona_query_response_time_flush.inc 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1FLUSH QUERY_RESPONSE_TIME;
20
=== removed file 'mysql-test/response-time-distribution.patch/percona_query_response_time_show.inc'
--- mysql-test/response-time-distribution.patch/percona_query_response_time_show.inc 2010-12-09 18:30:58 +0000
+++ mysql-test/response-time-distribution.patch/percona_query_response_time_show.inc 1970-01-01 00:00:00 +0000
@@ -1,8 +0,0 @@
1SELECT d.count,
2(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
3(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
4(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
5(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
6FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
7SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
8SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
90
=== removed file 'mysql-test/response-time-distribution.patch/percona_query_response_time_sleep.inc'
--- mysql-test/response-time-distribution.patch/percona_query_response_time_sleep.inc 2011-04-10 07:34:52 +0000
+++ mysql-test/response-time-distribution.patch/percona_query_response_time_sleep.inc 1970-01-01 00:00:00 +0000
@@ -1,19 +0,0 @@
1SET SESSION debug="+d,query_exec_time_0.31";
2SET SESSION debug="+d,query_exec_time_0.32";
3SET SESSION debug="+d,query_exec_time_0.33";
4SET SESSION debug="+d,query_exec_time_0.34";
5SET SESSION debug="+d,query_exec_time_0.35";
6SET SESSION debug="+d,query_exec_time_0.36";
7SET SESSION debug="+d,query_exec_time_0.37";
8SET SESSION debug="+d,query_exec_time_0.38";
9SET SESSION debug="+d,query_exec_time_0.39";
10SET SESSION debug="+d,query_exec_time_0.4";
11SET SESSION debug="+d,query_exec_time_1.1";
12SET SESSION debug="+d,query_exec_time_1.2";
13SET SESSION debug="+d,query_exec_time_1.3";
14SET SESSION debug="+d,query_exec_time_1.5";
15SET SESSION debug="+d,query_exec_time_1.4";
16SET SESSION debug="+d,query_exec_time_0.5";
17SET SESSION debug="+d,query_exec_time_2.1";
18SET SESSION debug="+d,query_exec_time_2.3";
19SET SESSION debug="+d,query_exec_time_2.5";
200
=== added file 'percona_suite.patch'
--- percona_suite.patch 1970-01-01 00:00:00 +0000
+++ percona_suite.patch 2011-07-11 01:29:49 +0000
@@ -0,0 +1,12 @@
1diff -ruN a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
2--- a/mysql-test/mysql-test-run.pl 2011-05-11 14:54:11.000000000 +0300
3+++ b/mysql-test/mysql-test-run.pl 2011-07-06 14:27:56.931566255 +0300
4@@ -162,7 +162,7 @@
5
6 # If you add a new suite, please check TEST_DIRS in Makefile.am.
7 #
8-my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,innodb,perfschema";
9+my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,innodb,perfschema,percona";
10 my $opt_suites;
11
12 our $opt_verbose= 0; # Verbose output, enable with --verbose
013
=== modified file 'response_time_distribution.patch'
--- response_time_distribution.patch 2011-06-21 02:36:36 +0000
+++ response_time_distribution.patch 2011-07-11 01:29:49 +0000
@@ -6,8 +6,8 @@
6# Any small change to this file in the main branch6# Any small change to this file in the main branch
7# should be done or reviewed by the maintainer!7# should be done or reviewed by the maintainer!
8diff -ruN a/CMakeLists.txt b/CMakeLists.txt8diff -ruN a/CMakeLists.txt b/CMakeLists.txt
9--- a/CMakeLists.txt 2011-03-31 17:36:18.000000000 +04009--- a/CMakeLists.txt 2011-05-11 14:54:12.000000000 +0300
10+++ b/CMakeLists.txt 2011-04-09 19:12:12.000000000 +040010+++ b/CMakeLists.txt 2011-07-11 04:22:26.301345024 +0300
11@@ -165,7 +165,12 @@11@@ -165,7 +165,12 @@
12 OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON)12 OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON)
13 MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED)13 MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED)
@@ -23,8 +23,8 @@
23 IF(ENABLE_DEBUG_SYNC) 23 IF(ENABLE_DEBUG_SYNC)
24 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") 24 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
25diff -ruN a/include/mysql_com.h b/include/mysql_com.h25diff -ruN a/include/mysql_com.h b/include/mysql_com.h
26--- a/include/mysql_com.h 2011-03-31 17:36:18.000000000 +040026--- a/include/mysql_com.h 2011-05-11 14:54:11.000000000 +0300
27+++ b/include/mysql_com.h 2011-04-10 11:28:51.000000000 +040027+++ b/include/mysql_com.h 2011-07-11 04:22:26.302345031 +0300
28@@ -141,10 +141,11 @@28@@ -141,10 +141,11 @@
29 #define REFRESH_FAST 32768 /* Intern flag */29 #define REFRESH_FAST 32768 /* Intern flag */
30 30
@@ -41,9 +41,1842 @@
41 41
42 #define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */42 #define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */
43 #define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */43 #define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */
44diff -ruN /dev/null b/patch_info/response-time-distribution.info44diff -ruN a/mysql-test/include/have_response_time_distribution.inc b/mysql-test/include/have_response_time_distribution.inc
45--- /dev/null 1970-01-01 00:00:00.000000000 +000045--- a/mysql-test/include/have_response_time_distribution.inc 1970-01-01 03:00:00.000000000 +0300
46+++ b/patch_info/response-time-distribution.info 2011-04-09 19:12:12.000000000 +040046+++ b/mysql-test/include/have_response_time_distribution.inc 2011-07-11 04:23:12.126669991 +0300
47@@ -0,0 +1,4 @@
48+-- require r/have_response_time_distribution.require
49+disable_query_log;
50+show variables like 'have_response_time_distribution';
51+enable_query_log;
52diff -ruN a/mysql-test/r/have_response_time_distribution.require b/mysql-test/r/have_response_time_distribution.require
53--- a/mysql-test/r/have_response_time_distribution.require 1970-01-01 03:00:00.000000000 +0300
54+++ b/mysql-test/r/have_response_time_distribution.require 2011-07-11 04:23:03.831611176 +0300
55@@ -0,0 +1,2 @@
56+Variable_name Value
57+have_response_time_distribution YES
58diff -ruN a/mysql-test/suite/percona/include/query_response_time.inc b/mysql-test/suite/percona/include/query_response_time.inc
59--- a/mysql-test/suite/percona/include/query_response_time.inc 1970-01-01 03:00:00.000000000 +0300
60+++ b/mysql-test/suite/percona/include/query_response_time.inc 2011-07-11 04:22:26.303345037 +0300
61@@ -0,0 +1,33 @@
62+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
63+EVAL SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=$base;
64+FLUSH QUERY_RESPONSE_TIME;
65+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
66+
67+SET SESSION debug="+d,query_exec_time_0.31";
68+SET SESSION debug="+d,query_exec_time_0.32";
69+SET SESSION debug="+d,query_exec_time_0.33";
70+SET SESSION debug="+d,query_exec_time_0.34";
71+SET SESSION debug="+d,query_exec_time_0.35";
72+SET SESSION debug="+d,query_exec_time_0.36";
73+SET SESSION debug="+d,query_exec_time_0.37";
74+SET SESSION debug="+d,query_exec_time_0.38";
75+SET SESSION debug="+d,query_exec_time_0.39";
76+SET SESSION debug="+d,query_exec_time_0.4";
77+SET SESSION debug="+d,query_exec_time_1.1";
78+SET SESSION debug="+d,query_exec_time_1.2";
79+SET SESSION debug="+d,query_exec_time_1.3";
80+SET SESSION debug="+d,query_exec_time_1.5";
81+SET SESSION debug="+d,query_exec_time_1.4";
82+SET SESSION debug="+d,query_exec_time_0.5";
83+SET SESSION debug="+d,query_exec_time_2.1";
84+SET SESSION debug="+d,query_exec_time_2.3";
85+SET SESSION debug="+d,query_exec_time_2.5";
86+SET SESSION debug="+d,query_exec_time_3.1";
87+SET SESSION debug="+d,query_exec_time_4.1";
88+SET SESSION debug="+d,query_exec_time_5.1";
89+
90+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
91+
92+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
93+SHOW QUERY_RESPONSE_TIME;
94+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
95diff -ruN a/mysql-test/suite/percona/include/query_response_time-replication.inc b/mysql-test/suite/percona/include/query_response_time-replication.inc
96--- a/mysql-test/suite/percona/include/query_response_time-replication.inc 1970-01-01 03:00:00.000000000 +0300
97+++ b/mysql-test/suite/percona/include/query_response_time-replication.inc 2011-07-11 04:22:26.304345044 +0300
98@@ -0,0 +1,41 @@
99+connection slave;
100+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
101+EVAL SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=$base;
102+FLUSH QUERY_RESPONSE_TIME;
103+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
104+
105+connection master;
106+--let i=0
107+EVAL /* query_exec_time= "0.31" */ INSERT INTO t VALUES($i); inc $i;
108+EVAL /* query_exec_time= "0.32" */ INSERT INTO t VALUES($i); inc $i;
109+EVAL /* query_exec_time= "0.33" */ INSERT INTO t VALUES($i); inc $i;
110+EVAL /* query_exec_time= "0.34" */ INSERT INTO t VALUES($i); inc $i;
111+EVAL /* query_exec_time= "0.35" */ INSERT INTO t VALUES($i); inc $i;
112+EVAL /* query_exec_time= "0.36" */ INSERT INTO t VALUES($i); inc $i;
113+EVAL /* query_exec_time= "0.37" */ INSERT INTO t VALUES($i); inc $i;
114+EVAL /* query_exec_time= "0.38" */ INSERT INTO t VALUES($i); inc $i;
115+EVAL /* query_exec_time= "0.39" */ INSERT INTO t VALUES($i); inc $i;
116+EVAL /* query_exec_time= "0.4" */ INSERT INTO t VALUES($i); inc $i;
117+EVAL /* query_exec_time= "1.1" */ INSERT INTO t VALUES($i); inc $i;
118+EVAL /* query_exec_time= "1.2" */ INSERT INTO t VALUES($i); inc $i;
119+EVAL /* query_exec_time= "1.3" */ INSERT INTO t VALUES($i); inc $i;
120+EVAL /* query_exec_time= "1.5" */ INSERT INTO t VALUES($i); inc $i;
121+EVAL /* query_exec_time= "1.4" */ INSERT INTO t VALUES($i); inc $i;
122+EVAL /* query_exec_time= "0.5" */ INSERT INTO t VALUES($i); inc $i;
123+EVAL /* query_exec_time= "2.1" */ INSERT INTO t VALUES($i); inc $i;
124+EVAL /* query_exec_time= "2.3" */ INSERT INTO t VALUES($i); inc $i;
125+EVAL /* query_exec_time= "2.5" */ INSERT INTO t VALUES($i); inc $i;
126+EVAL /* query_exec_time= "3.1" */ INSERT INTO t VALUES($i); inc $i;
127+EVAL /* query_exec_time= "4.1" */ INSERT INTO t VALUES($i); inc $i;
128+EVAL /* query_exec_time= "5.1" */ INSERT INTO t VALUES($i); inc $i;
129+sync_slave_with_master;
130+
131+connection master;
132+DELETE FROM t;
133+sync_slave_with_master;
134+
135+connection slave;
136+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
137+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
138+SHOW QUERY_RESPONSE_TIME;
139+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
140diff -ruN a/mysql-test/suite/percona/include/query_response_time-stored.inc b/mysql-test/suite/percona/include/query_response_time-stored.inc
141--- a/mysql-test/suite/percona/include/query_response_time-stored.inc 1970-01-01 03:00:00.000000000 +0300
142+++ b/mysql-test/suite/percona/include/query_response_time-stored.inc 2011-07-11 04:22:26.305345052 +0300
143@@ -0,0 +1,33 @@
144+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
145+EVAL SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=$base;
146+FLUSH QUERY_RESPONSE_TIME;
147+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
148+
149+CALL test_f("0.31");
150+CALL test_f("0.32");
151+CALL test_f("0.33");
152+CALL test_f("0.34");
153+CALL test_f("0.35");
154+CALL test_f("0.36");
155+CALL test_f("0.37");
156+CALL test_f("0.38");
157+CALL test_f("0.39");
158+CALL test_f("0.4");
159+CALL test_f("1.1");
160+CALL test_f("1.2");
161+CALL test_f("1.3");
162+CALL test_f("1.5");
163+CALL test_f("1.4");
164+CALL test_f("0.5");
165+CALL test_f("2.1");
166+CALL test_f("2.3");
167+CALL test_f("2.5");
168+CALL test_f("3.1");
169+CALL test_f("4.1");
170+CALL test_f("5.1");
171+
172+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
173+
174+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
175+SHOW QUERY_RESPONSE_TIME;
176+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
177diff -ruN a/mysql-test/suite/percona/r/query_response_time-replication.result b/mysql-test/suite/percona/r/query_response_time-replication.result
178--- a/mysql-test/suite/percona/r/query_response_time-replication.result 1970-01-01 03:00:00.000000000 +0300
179+++ b/mysql-test/suite/percona/r/query_response_time-replication.result 2011-07-11 04:22:26.308345073 +0300
180@@ -0,0 +1,528 @@
181+include/master-slave.inc
182+[connection master]
183+DROP TABLE IF EXISTS t;
184+CREATE TABLE t(id INT);
185+SET GLOBAL debug="+d,query_exec_time_debug";
186+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
187+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
188+Warnings:
189+Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
190+FLUSH QUERY_RESPONSE_TIME;
191+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
192+SET SESSION debug="+d,query_exec_time_0.31";
193+SET SESSION debug="+d,query_exec_time_0.32";
194+SET SESSION debug="+d,query_exec_time_0.33";
195+SET SESSION debug="+d,query_exec_time_0.34";
196+SET SESSION debug="+d,query_exec_time_0.35";
197+SET SESSION debug="+d,query_exec_time_0.36";
198+SET SESSION debug="+d,query_exec_time_0.37";
199+SET SESSION debug="+d,query_exec_time_0.38";
200+SET SESSION debug="+d,query_exec_time_0.39";
201+SET SESSION debug="+d,query_exec_time_0.4";
202+SET SESSION debug="+d,query_exec_time_1.1";
203+SET SESSION debug="+d,query_exec_time_1.2";
204+SET SESSION debug="+d,query_exec_time_1.3";
205+SET SESSION debug="+d,query_exec_time_1.5";
206+SET SESSION debug="+d,query_exec_time_1.4";
207+SET SESSION debug="+d,query_exec_time_0.5";
208+SET SESSION debug="+d,query_exec_time_2.1";
209+SET SESSION debug="+d,query_exec_time_2.3";
210+SET SESSION debug="+d,query_exec_time_2.5";
211+SET SESSION debug="+d,query_exec_time_3.1";
212+SET SESSION debug="+d,query_exec_time_4.1";
213+SET SESSION debug="+d,query_exec_time_5.1";
214+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
215+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
216+Variable_name Value
217+query_response_time_range_base 2
218+SHOW QUERY_RESPONSE_TIME;
219+
220+ 0.000001 0 0.000000
221+ 0.000003 0 0.000000
222+ 0.000007 0 0.000000
223+ 0.000015 0 0.000000
224+ 0.000030 0 0.000000
225+ 0.000061 0 0.000000
226+ 0.000122 0 0.000000
227+ 0.000244 0 0.000000
228+ 0.000488 0 0.000000
229+ 0.000976 0 0.000000
230+ 0.001953 0 0.000000
231+ 0.003906 0 0.000000
232+ 0.007812 0 0.000000
233+ 0.015625 0 0.000000
234+ 0.031250 0 0.000000
235+ 0.062500 0 0.000000
236+ 0.125000 0 0.000000
237+ 0.250000 0 0.000000
238+ 0.500000 10 3.550000
239+ 1.000000 1 0.500000
240+ 2.000000 5 6.500000
241+ 4.000000 4 10.000000
242+ 8.000000 2 9.200000
243+ 16.000000 0 0.000000
244+ 32.000000 0 0.000000
245+ 64.000000 0 0.000000
246+ 128.000000 0 0.000000
247+ 256.000000 0 0.000000
248+ 512.000000 0 0.000000
249+ 1024.000000 0 0.000000
250+ 2048.000000 0 0.000000
251+ 4096.000000 0 0.000000
252+ 8192.000000 0 0.000000
253+ 16384.000000 0 0.000000
254+ 32768.000000 0 0.000000
255+ 65536.000000 0 0.000000
256+ 131072.000000 0 0.000000
257+ 262144.000000 0 0.000000
258+ 524288.000000 0 0.000000
259+ 1048576.00000 0 0.000000
260+ 2097152.00000 0 0.000000
261+ 4194304.00000 0 0.000000
262+ 8388608.00000 0 0.000000
263+TOO LONG 0 TOO LONG
264+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
265+time count total
266+ 0.000001 0 0.000000
267+ 0.000003 0 0.000000
268+ 0.000007 0 0.000000
269+ 0.000015 0 0.000000
270+ 0.000030 0 0.000000
271+ 0.000061 0 0.000000
272+ 0.000122 0 0.000000
273+ 0.000244 0 0.000000
274+ 0.000488 0 0.000000
275+ 0.000976 0 0.000000
276+ 0.001953 0 0.000000
277+ 0.003906 0 0.000000
278+ 0.007812 0 0.000000
279+ 0.015625 0 0.000000
280+ 0.031250 0 0.000000
281+ 0.062500 0 0.000000
282+ 0.125000 0 0.000000
283+ 0.250000 0 0.000000
284+ 0.500000 10 3.550000
285+ 1.000000 1 0.500000
286+ 2.000000 5 6.500000
287+ 4.000000 4 10.000000
288+ 8.000000 2 9.200000
289+ 16.000000 0 0.000000
290+ 32.000000 0 0.000000
291+ 64.000000 0 0.000000
292+ 128.000000 0 0.000000
293+ 256.000000 0 0.000000
294+ 512.000000 0 0.000000
295+ 1024.000000 0 0.000000
296+ 2048.000000 0 0.000000
297+ 4096.000000 0 0.000000
298+ 8192.000000 0 0.000000
299+ 16384.000000 0 0.000000
300+ 32768.000000 0 0.000000
301+ 65536.000000 0 0.000000
302+ 131072.000000 0 0.000000
303+ 262144.000000 0 0.000000
304+ 524288.000000 0 0.000000
305+ 1048576.00000 0 0.000000
306+ 2097152.00000 0 0.000000
307+ 4194304.00000 0 0.000000
308+ 8388608.00000 0 0.000000
309+TOO LONG 0 TOO LONG
310+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
311+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
312+FLUSH QUERY_RESPONSE_TIME;
313+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
314+SET SESSION debug="+d,query_exec_time_0.31";
315+SET SESSION debug="+d,query_exec_time_0.32";
316+SET SESSION debug="+d,query_exec_time_0.33";
317+SET SESSION debug="+d,query_exec_time_0.34";
318+SET SESSION debug="+d,query_exec_time_0.35";
319+SET SESSION debug="+d,query_exec_time_0.36";
320+SET SESSION debug="+d,query_exec_time_0.37";
321+SET SESSION debug="+d,query_exec_time_0.38";
322+SET SESSION debug="+d,query_exec_time_0.39";
323+SET SESSION debug="+d,query_exec_time_0.4";
324+SET SESSION debug="+d,query_exec_time_1.1";
325+SET SESSION debug="+d,query_exec_time_1.2";
326+SET SESSION debug="+d,query_exec_time_1.3";
327+SET SESSION debug="+d,query_exec_time_1.5";
328+SET SESSION debug="+d,query_exec_time_1.4";
329+SET SESSION debug="+d,query_exec_time_0.5";
330+SET SESSION debug="+d,query_exec_time_2.1";
331+SET SESSION debug="+d,query_exec_time_2.3";
332+SET SESSION debug="+d,query_exec_time_2.5";
333+SET SESSION debug="+d,query_exec_time_3.1";
334+SET SESSION debug="+d,query_exec_time_4.1";
335+SET SESSION debug="+d,query_exec_time_5.1";
336+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
337+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
338+Variable_name Value
339+query_response_time_range_base 2
340+SHOW QUERY_RESPONSE_TIME;
341+
342+ 0.000001 0 0.000000
343+ 0.000003 0 0.000000
344+ 0.000007 0 0.000000
345+ 0.000015 0 0.000000
346+ 0.000030 0 0.000000
347+ 0.000061 0 0.000000
348+ 0.000122 0 0.000000
349+ 0.000244 0 0.000000
350+ 0.000488 0 0.000000
351+ 0.000976 0 0.000000
352+ 0.001953 0 0.000000
353+ 0.003906 0 0.000000
354+ 0.007812 0 0.000000
355+ 0.015625 0 0.000000
356+ 0.031250 0 0.000000
357+ 0.062500 0 0.000000
358+ 0.125000 0 0.000000
359+ 0.250000 0 0.000000
360+ 0.500000 10 3.550000
361+ 1.000000 1 0.500000
362+ 2.000000 5 6.500000
363+ 4.000000 4 10.000000
364+ 8.000000 2 9.200000
365+ 16.000000 0 0.000000
366+ 32.000000 0 0.000000
367+ 64.000000 0 0.000000
368+ 128.000000 0 0.000000
369+ 256.000000 0 0.000000
370+ 512.000000 0 0.000000
371+ 1024.000000 0 0.000000
372+ 2048.000000 0 0.000000
373+ 4096.000000 0 0.000000
374+ 8192.000000 0 0.000000
375+ 16384.000000 0 0.000000
376+ 32768.000000 0 0.000000
377+ 65536.000000 0 0.000000
378+ 131072.000000 0 0.000000
379+ 262144.000000 0 0.000000
380+ 524288.000000 0 0.000000
381+ 1048576.00000 0 0.000000
382+ 2097152.00000 0 0.000000
383+ 4194304.00000 0 0.000000
384+ 8388608.00000 0 0.000000
385+TOO LONG 0 TOO LONG
386+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
387+time count total
388+ 0.000001 0 0.000000
389+ 0.000003 0 0.000000
390+ 0.000007 0 0.000000
391+ 0.000015 0 0.000000
392+ 0.000030 0 0.000000
393+ 0.000061 0 0.000000
394+ 0.000122 0 0.000000
395+ 0.000244 0 0.000000
396+ 0.000488 0 0.000000
397+ 0.000976 0 0.000000
398+ 0.001953 0 0.000000
399+ 0.003906 0 0.000000
400+ 0.007812 0 0.000000
401+ 0.015625 0 0.000000
402+ 0.031250 0 0.000000
403+ 0.062500 0 0.000000
404+ 0.125000 0 0.000000
405+ 0.250000 0 0.000000
406+ 0.500000 10 3.550000
407+ 1.000000 1 0.500000
408+ 2.000000 5 6.500000
409+ 4.000000 4 10.000000
410+ 8.000000 2 9.200000
411+ 16.000000 0 0.000000
412+ 32.000000 0 0.000000
413+ 64.000000 0 0.000000
414+ 128.000000 0 0.000000
415+ 256.000000 0 0.000000
416+ 512.000000 0 0.000000
417+ 1024.000000 0 0.000000
418+ 2048.000000 0 0.000000
419+ 4096.000000 0 0.000000
420+ 8192.000000 0 0.000000
421+ 16384.000000 0 0.000000
422+ 32768.000000 0 0.000000
423+ 65536.000000 0 0.000000
424+ 131072.000000 0 0.000000
425+ 262144.000000 0 0.000000
426+ 524288.000000 0 0.000000
427+ 1048576.00000 0 0.000000
428+ 2097152.00000 0 0.000000
429+ 4194304.00000 0 0.000000
430+ 8388608.00000 0 0.000000
431+TOO LONG 0 TOO LONG
432+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
433+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
434+FLUSH QUERY_RESPONSE_TIME;
435+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
436+SET SESSION debug="+d,query_exec_time_0.31";
437+SET SESSION debug="+d,query_exec_time_0.32";
438+SET SESSION debug="+d,query_exec_time_0.33";
439+SET SESSION debug="+d,query_exec_time_0.34";
440+SET SESSION debug="+d,query_exec_time_0.35";
441+SET SESSION debug="+d,query_exec_time_0.36";
442+SET SESSION debug="+d,query_exec_time_0.37";
443+SET SESSION debug="+d,query_exec_time_0.38";
444+SET SESSION debug="+d,query_exec_time_0.39";
445+SET SESSION debug="+d,query_exec_time_0.4";
446+SET SESSION debug="+d,query_exec_time_1.1";
447+SET SESSION debug="+d,query_exec_time_1.2";
448+SET SESSION debug="+d,query_exec_time_1.3";
449+SET SESSION debug="+d,query_exec_time_1.5";
450+SET SESSION debug="+d,query_exec_time_1.4";
451+SET SESSION debug="+d,query_exec_time_0.5";
452+SET SESSION debug="+d,query_exec_time_2.1";
453+SET SESSION debug="+d,query_exec_time_2.3";
454+SET SESSION debug="+d,query_exec_time_2.5";
455+SET SESSION debug="+d,query_exec_time_3.1";
456+SET SESSION debug="+d,query_exec_time_4.1";
457+SET SESSION debug="+d,query_exec_time_5.1";
458+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
459+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
460+Variable_name Value
461+query_response_time_range_base 10
462+SHOW QUERY_RESPONSE_TIME;
463+
464+ 0.000001 0 0.000000
465+ 0.000010 0 0.000000
466+ 0.000100 0 0.000000
467+ 0.001000 0 0.000000
468+ 0.010000 0 0.000000
469+ 0.100000 0 0.000000
470+ 1.000000 11 4.050000
471+ 10.000000 11 25.700000
472+ 100.000000 0 0.000000
473+ 1000.000000 0 0.000000
474+ 10000.000000 0 0.000000
475+ 100000.000000 0 0.000000
476+ 1000000.00000 0 0.000000
477+TOO LONG 0 TOO LONG
478+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
479+time count total
480+ 0.000001 0 0.000000
481+ 0.000010 0 0.000000
482+ 0.000100 0 0.000000
483+ 0.001000 0 0.000000
484+ 0.010000 0 0.000000
485+ 0.100000 0 0.000000
486+ 1.000000 11 4.050000
487+ 10.000000 11 25.700000
488+ 100.000000 0 0.000000
489+ 1000.000000 0 0.000000
490+ 10000.000000 0 0.000000
491+ 100000.000000 0 0.000000
492+ 1000000.00000 0 0.000000
493+TOO LONG 0 TOO LONG
494+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
495+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
496+FLUSH QUERY_RESPONSE_TIME;
497+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
498+SET SESSION debug="+d,query_exec_time_0.31";
499+SET SESSION debug="+d,query_exec_time_0.32";
500+SET SESSION debug="+d,query_exec_time_0.33";
501+SET SESSION debug="+d,query_exec_time_0.34";
502+SET SESSION debug="+d,query_exec_time_0.35";
503+SET SESSION debug="+d,query_exec_time_0.36";
504+SET SESSION debug="+d,query_exec_time_0.37";
505+SET SESSION debug="+d,query_exec_time_0.38";
506+SET SESSION debug="+d,query_exec_time_0.39";
507+SET SESSION debug="+d,query_exec_time_0.4";
508+SET SESSION debug="+d,query_exec_time_1.1";
509+SET SESSION debug="+d,query_exec_time_1.2";
510+SET SESSION debug="+d,query_exec_time_1.3";
511+SET SESSION debug="+d,query_exec_time_1.5";
512+SET SESSION debug="+d,query_exec_time_1.4";
513+SET SESSION debug="+d,query_exec_time_0.5";
514+SET SESSION debug="+d,query_exec_time_2.1";
515+SET SESSION debug="+d,query_exec_time_2.3";
516+SET SESSION debug="+d,query_exec_time_2.5";
517+SET SESSION debug="+d,query_exec_time_3.1";
518+SET SESSION debug="+d,query_exec_time_4.1";
519+SET SESSION debug="+d,query_exec_time_5.1";
520+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
521+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
522+Variable_name Value
523+query_response_time_range_base 7
524+SHOW QUERY_RESPONSE_TIME;
525+
526+ 0.000001 0 0.000000
527+ 0.000008 0 0.000000
528+ 0.000059 0 0.000000
529+ 0.000416 0 0.000000
530+ 0.002915 0 0.000000
531+ 0.020408 0 0.000000
532+ 0.142857 0 0.000000
533+ 1.000000 11 4.050000
534+ 7.000000 11 25.700000
535+ 49.000000 0 0.000000
536+ 343.000000 0 0.000000
537+ 2401.000000 0 0.000000
538+ 16807.000000 0 0.000000
539+ 117649.000000 0 0.000000
540+ 823543.000000 0 0.000000
541+ 5764801.00000 0 0.000000
542+TOO LONG 0 TOO LONG
543+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
544+time count total
545+ 0.000001 0 0.000000
546+ 0.000008 0 0.000000
547+ 0.000059 0 0.000000
548+ 0.000416 0 0.000000
549+ 0.002915 0 0.000000
550+ 0.020408 0 0.000000
551+ 0.142857 0 0.000000
552+ 1.000000 11 4.050000
553+ 7.000000 11 25.700000
554+ 49.000000 0 0.000000
555+ 343.000000 0 0.000000
556+ 2401.000000 0 0.000000
557+ 16807.000000 0 0.000000
558+ 117649.000000 0 0.000000
559+ 823543.000000 0 0.000000
560+ 5764801.00000 0 0.000000
561+TOO LONG 0 TOO LONG
562+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
563+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
564+FLUSH QUERY_RESPONSE_TIME;
565+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
566+SET SESSION debug="+d,query_exec_time_0.31";
567+SET SESSION debug="+d,query_exec_time_0.32";
568+SET SESSION debug="+d,query_exec_time_0.33";
569+SET SESSION debug="+d,query_exec_time_0.34";
570+SET SESSION debug="+d,query_exec_time_0.35";
571+SET SESSION debug="+d,query_exec_time_0.36";
572+SET SESSION debug="+d,query_exec_time_0.37";
573+SET SESSION debug="+d,query_exec_time_0.38";
574+SET SESSION debug="+d,query_exec_time_0.39";
575+SET SESSION debug="+d,query_exec_time_0.4";
576+SET SESSION debug="+d,query_exec_time_1.1";
577+SET SESSION debug="+d,query_exec_time_1.2";
578+SET SESSION debug="+d,query_exec_time_1.3";
579+SET SESSION debug="+d,query_exec_time_1.5";
580+SET SESSION debug="+d,query_exec_time_1.4";
581+SET SESSION debug="+d,query_exec_time_0.5";
582+SET SESSION debug="+d,query_exec_time_2.1";
583+SET SESSION debug="+d,query_exec_time_2.3";
584+SET SESSION debug="+d,query_exec_time_2.5";
585+SET SESSION debug="+d,query_exec_time_3.1";
586+SET SESSION debug="+d,query_exec_time_4.1";
587+SET SESSION debug="+d,query_exec_time_5.1";
588+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
589+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
590+Variable_name Value
591+query_response_time_range_base 156
592+SHOW QUERY_RESPONSE_TIME;
593+
594+ 0.000041 0 0.000000
595+ 0.006410 0 0.000000
596+ 1.000000 11 4.050000
597+ 156.000000 11 25.700000
598+ 24336.000000 0 0.000000
599+ 3796416.00000 0 0.000000
600+TOO LONG 0 TOO LONG
601+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
602+time count total
603+ 0.000041 0 0.000000
604+ 0.006410 0 0.000000
605+ 1.000000 11 4.050000
606+ 156.000000 11 25.700000
607+ 24336.000000 0 0.000000
608+ 3796416.00000 0 0.000000
609+TOO LONG 0 TOO LONG
610+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
611+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
612+FLUSH QUERY_RESPONSE_TIME;
613+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
614+SET SESSION debug="+d,query_exec_time_0.31";
615+SET SESSION debug="+d,query_exec_time_0.32";
616+SET SESSION debug="+d,query_exec_time_0.33";
617+SET SESSION debug="+d,query_exec_time_0.34";
618+SET SESSION debug="+d,query_exec_time_0.35";
619+SET SESSION debug="+d,query_exec_time_0.36";
620+SET SESSION debug="+d,query_exec_time_0.37";
621+SET SESSION debug="+d,query_exec_time_0.38";
622+SET SESSION debug="+d,query_exec_time_0.39";
623+SET SESSION debug="+d,query_exec_time_0.4";
624+SET SESSION debug="+d,query_exec_time_1.1";
625+SET SESSION debug="+d,query_exec_time_1.2";
626+SET SESSION debug="+d,query_exec_time_1.3";
627+SET SESSION debug="+d,query_exec_time_1.5";
628+SET SESSION debug="+d,query_exec_time_1.4";
629+SET SESSION debug="+d,query_exec_time_0.5";
630+SET SESSION debug="+d,query_exec_time_2.1";
631+SET SESSION debug="+d,query_exec_time_2.3";
632+SET SESSION debug="+d,query_exec_time_2.5";
633+SET SESSION debug="+d,query_exec_time_3.1";
634+SET SESSION debug="+d,query_exec_time_4.1";
635+SET SESSION debug="+d,query_exec_time_5.1";
636+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
637+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
638+Variable_name Value
639+query_response_time_range_base 1000
640+SHOW QUERY_RESPONSE_TIME;
641+
642+ 0.000001 0 0.000000
643+ 0.001000 0 0.000000
644+ 1.000000 11 4.050000
645+ 1000.000000 11 25.700000
646+ 1000000.00000 0 0.000000
647+TOO LONG 0 TOO LONG
648+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
649+time count total
650+ 0.000001 0 0.000000
651+ 0.001000 0 0.000000
652+ 1.000000 11 4.050000
653+ 1000.000000 11 25.700000
654+ 1000000.00000 0 0.000000
655+TOO LONG 0 TOO LONG
656+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
657+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
658+Warnings:
659+Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
660+FLUSH QUERY_RESPONSE_TIME;
661+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
662+SET SESSION debug="+d,query_exec_time_0.31";
663+SET SESSION debug="+d,query_exec_time_0.32";
664+SET SESSION debug="+d,query_exec_time_0.33";
665+SET SESSION debug="+d,query_exec_time_0.34";
666+SET SESSION debug="+d,query_exec_time_0.35";
667+SET SESSION debug="+d,query_exec_time_0.36";
668+SET SESSION debug="+d,query_exec_time_0.37";
669+SET SESSION debug="+d,query_exec_time_0.38";
670+SET SESSION debug="+d,query_exec_time_0.39";
671+SET SESSION debug="+d,query_exec_time_0.4";
672+SET SESSION debug="+d,query_exec_time_1.1";
673+SET SESSION debug="+d,query_exec_time_1.2";
674+SET SESSION debug="+d,query_exec_time_1.3";
675+SET SESSION debug="+d,query_exec_time_1.5";
676+SET SESSION debug="+d,query_exec_time_1.4";
677+SET SESSION debug="+d,query_exec_time_0.5";
678+SET SESSION debug="+d,query_exec_time_2.1";
679+SET SESSION debug="+d,query_exec_time_2.3";
680+SET SESSION debug="+d,query_exec_time_2.5";
681+SET SESSION debug="+d,query_exec_time_3.1";
682+SET SESSION debug="+d,query_exec_time_4.1";
683+SET SESSION debug="+d,query_exec_time_5.1";
684+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
685+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
686+Variable_name Value
687+query_response_time_range_base 1000
688+SHOW QUERY_RESPONSE_TIME;
689+
690+ 0.000001 0 0.000000
691+ 0.001000 0 0.000000
692+ 1.000000 11 4.050000
693+ 1000.000000 11 25.700000
694+ 1000000.00000 0 0.000000
695+TOO LONG 0 TOO LONG
696+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
697+time count total
698+ 0.000001 0 0.000000
699+ 0.001000 0 0.000000
700+ 1.000000 11 4.050000
701+ 1000.000000 11 25.700000
702+ 1000000.00000 0 0.000000
703+TOO LONG 0 TOO LONG
704+SET GLOBAL debug="";
705+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
706+SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
707+DROP TABLE t;
708+include/rpl_end.inc
709diff -ruN a/mysql-test/suite/percona/r/query_response_time.result b/mysql-test/suite/percona/r/query_response_time.result
710--- a/mysql-test/suite/percona/r/query_response_time.result 1970-01-01 03:00:00.000000000 +0300
711+++ b/mysql-test/suite/percona/r/query_response_time.result 2011-07-11 04:22:26.310345087 +0300
712@@ -0,0 +1,522 @@
713+SET GLOBAL debug="+d,query_exec_time_debug";
714+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
715+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
716+Warnings:
717+Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
718+FLUSH QUERY_RESPONSE_TIME;
719+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
720+SET SESSION debug="+d,query_exec_time_0.31";
721+SET SESSION debug="+d,query_exec_time_0.32";
722+SET SESSION debug="+d,query_exec_time_0.33";
723+SET SESSION debug="+d,query_exec_time_0.34";
724+SET SESSION debug="+d,query_exec_time_0.35";
725+SET SESSION debug="+d,query_exec_time_0.36";
726+SET SESSION debug="+d,query_exec_time_0.37";
727+SET SESSION debug="+d,query_exec_time_0.38";
728+SET SESSION debug="+d,query_exec_time_0.39";
729+SET SESSION debug="+d,query_exec_time_0.4";
730+SET SESSION debug="+d,query_exec_time_1.1";
731+SET SESSION debug="+d,query_exec_time_1.2";
732+SET SESSION debug="+d,query_exec_time_1.3";
733+SET SESSION debug="+d,query_exec_time_1.5";
734+SET SESSION debug="+d,query_exec_time_1.4";
735+SET SESSION debug="+d,query_exec_time_0.5";
736+SET SESSION debug="+d,query_exec_time_2.1";
737+SET SESSION debug="+d,query_exec_time_2.3";
738+SET SESSION debug="+d,query_exec_time_2.5";
739+SET SESSION debug="+d,query_exec_time_3.1";
740+SET SESSION debug="+d,query_exec_time_4.1";
741+SET SESSION debug="+d,query_exec_time_5.1";
742+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
743+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
744+Variable_name Value
745+query_response_time_range_base 2
746+SHOW QUERY_RESPONSE_TIME;
747+
748+ 0.000001 0 0.000000
749+ 0.000003 0 0.000000
750+ 0.000007 0 0.000000
751+ 0.000015 0 0.000000
752+ 0.000030 0 0.000000
753+ 0.000061 0 0.000000
754+ 0.000122 0 0.000000
755+ 0.000244 0 0.000000
756+ 0.000488 0 0.000000
757+ 0.000976 0 0.000000
758+ 0.001953 0 0.000000
759+ 0.003906 0 0.000000
760+ 0.007812 0 0.000000
761+ 0.015625 0 0.000000
762+ 0.031250 0 0.000000
763+ 0.062500 0 0.000000
764+ 0.125000 0 0.000000
765+ 0.250000 0 0.000000
766+ 0.500000 10 3.550000
767+ 1.000000 1 0.500000
768+ 2.000000 5 6.500000
769+ 4.000000 4 10.000000
770+ 8.000000 2 9.200000
771+ 16.000000 0 0.000000
772+ 32.000000 0 0.000000
773+ 64.000000 0 0.000000
774+ 128.000000 0 0.000000
775+ 256.000000 0 0.000000
776+ 512.000000 0 0.000000
777+ 1024.000000 0 0.000000
778+ 2048.000000 0 0.000000
779+ 4096.000000 0 0.000000
780+ 8192.000000 0 0.000000
781+ 16384.000000 0 0.000000
782+ 32768.000000 0 0.000000
783+ 65536.000000 0 0.000000
784+ 131072.000000 0 0.000000
785+ 262144.000000 0 0.000000
786+ 524288.000000 0 0.000000
787+ 1048576.00000 0 0.000000
788+ 2097152.00000 0 0.000000
789+ 4194304.00000 0 0.000000
790+ 8388608.00000 0 0.000000
791+TOO LONG 0 TOO LONG
792+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
793+time count total
794+ 0.000001 0 0.000000
795+ 0.000003 0 0.000000
796+ 0.000007 0 0.000000
797+ 0.000015 0 0.000000
798+ 0.000030 0 0.000000
799+ 0.000061 0 0.000000
800+ 0.000122 0 0.000000
801+ 0.000244 0 0.000000
802+ 0.000488 0 0.000000
803+ 0.000976 0 0.000000
804+ 0.001953 0 0.000000
805+ 0.003906 0 0.000000
806+ 0.007812 0 0.000000
807+ 0.015625 0 0.000000
808+ 0.031250 0 0.000000
809+ 0.062500 0 0.000000
810+ 0.125000 0 0.000000
811+ 0.250000 0 0.000000
812+ 0.500000 10 3.550000
813+ 1.000000 1 0.500000
814+ 2.000000 5 6.500000
815+ 4.000000 4 10.000000
816+ 8.000000 2 9.200000
817+ 16.000000 0 0.000000
818+ 32.000000 0 0.000000
819+ 64.000000 0 0.000000
820+ 128.000000 0 0.000000
821+ 256.000000 0 0.000000
822+ 512.000000 0 0.000000
823+ 1024.000000 0 0.000000
824+ 2048.000000 0 0.000000
825+ 4096.000000 0 0.000000
826+ 8192.000000 0 0.000000
827+ 16384.000000 0 0.000000
828+ 32768.000000 0 0.000000
829+ 65536.000000 0 0.000000
830+ 131072.000000 0 0.000000
831+ 262144.000000 0 0.000000
832+ 524288.000000 0 0.000000
833+ 1048576.00000 0 0.000000
834+ 2097152.00000 0 0.000000
835+ 4194304.00000 0 0.000000
836+ 8388608.00000 0 0.000000
837+TOO LONG 0 TOO LONG
838+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
839+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
840+FLUSH QUERY_RESPONSE_TIME;
841+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
842+SET SESSION debug="+d,query_exec_time_0.31";
843+SET SESSION debug="+d,query_exec_time_0.32";
844+SET SESSION debug="+d,query_exec_time_0.33";
845+SET SESSION debug="+d,query_exec_time_0.34";
846+SET SESSION debug="+d,query_exec_time_0.35";
847+SET SESSION debug="+d,query_exec_time_0.36";
848+SET SESSION debug="+d,query_exec_time_0.37";
849+SET SESSION debug="+d,query_exec_time_0.38";
850+SET SESSION debug="+d,query_exec_time_0.39";
851+SET SESSION debug="+d,query_exec_time_0.4";
852+SET SESSION debug="+d,query_exec_time_1.1";
853+SET SESSION debug="+d,query_exec_time_1.2";
854+SET SESSION debug="+d,query_exec_time_1.3";
855+SET SESSION debug="+d,query_exec_time_1.5";
856+SET SESSION debug="+d,query_exec_time_1.4";
857+SET SESSION debug="+d,query_exec_time_0.5";
858+SET SESSION debug="+d,query_exec_time_2.1";
859+SET SESSION debug="+d,query_exec_time_2.3";
860+SET SESSION debug="+d,query_exec_time_2.5";
861+SET SESSION debug="+d,query_exec_time_3.1";
862+SET SESSION debug="+d,query_exec_time_4.1";
863+SET SESSION debug="+d,query_exec_time_5.1";
864+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
865+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
866+Variable_name Value
867+query_response_time_range_base 2
868+SHOW QUERY_RESPONSE_TIME;
869+
870+ 0.000001 0 0.000000
871+ 0.000003 0 0.000000
872+ 0.000007 0 0.000000
873+ 0.000015 0 0.000000
874+ 0.000030 0 0.000000
875+ 0.000061 0 0.000000
876+ 0.000122 0 0.000000
877+ 0.000244 0 0.000000
878+ 0.000488 0 0.000000
879+ 0.000976 0 0.000000
880+ 0.001953 0 0.000000
881+ 0.003906 0 0.000000
882+ 0.007812 0 0.000000
883+ 0.015625 0 0.000000
884+ 0.031250 0 0.000000
885+ 0.062500 0 0.000000
886+ 0.125000 0 0.000000
887+ 0.250000 0 0.000000
888+ 0.500000 10 3.550000
889+ 1.000000 1 0.500000
890+ 2.000000 5 6.500000
891+ 4.000000 4 10.000000
892+ 8.000000 2 9.200000
893+ 16.000000 0 0.000000
894+ 32.000000 0 0.000000
895+ 64.000000 0 0.000000
896+ 128.000000 0 0.000000
897+ 256.000000 0 0.000000
898+ 512.000000 0 0.000000
899+ 1024.000000 0 0.000000
900+ 2048.000000 0 0.000000
901+ 4096.000000 0 0.000000
902+ 8192.000000 0 0.000000
903+ 16384.000000 0 0.000000
904+ 32768.000000 0 0.000000
905+ 65536.000000 0 0.000000
906+ 131072.000000 0 0.000000
907+ 262144.000000 0 0.000000
908+ 524288.000000 0 0.000000
909+ 1048576.00000 0 0.000000
910+ 2097152.00000 0 0.000000
911+ 4194304.00000 0 0.000000
912+ 8388608.00000 0 0.000000
913+TOO LONG 0 TOO LONG
914+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
915+time count total
916+ 0.000001 0 0.000000
917+ 0.000003 0 0.000000
918+ 0.000007 0 0.000000
919+ 0.000015 0 0.000000
920+ 0.000030 0 0.000000
921+ 0.000061 0 0.000000
922+ 0.000122 0 0.000000
923+ 0.000244 0 0.000000
924+ 0.000488 0 0.000000
925+ 0.000976 0 0.000000
926+ 0.001953 0 0.000000
927+ 0.003906 0 0.000000
928+ 0.007812 0 0.000000
929+ 0.015625 0 0.000000
930+ 0.031250 0 0.000000
931+ 0.062500 0 0.000000
932+ 0.125000 0 0.000000
933+ 0.250000 0 0.000000
934+ 0.500000 10 3.550000
935+ 1.000000 1 0.500000
936+ 2.000000 5 6.500000
937+ 4.000000 4 10.000000
938+ 8.000000 2 9.200000
939+ 16.000000 0 0.000000
940+ 32.000000 0 0.000000
941+ 64.000000 0 0.000000
942+ 128.000000 0 0.000000
943+ 256.000000 0 0.000000
944+ 512.000000 0 0.000000
945+ 1024.000000 0 0.000000
946+ 2048.000000 0 0.000000
947+ 4096.000000 0 0.000000
948+ 8192.000000 0 0.000000
949+ 16384.000000 0 0.000000
950+ 32768.000000 0 0.000000
951+ 65536.000000 0 0.000000
952+ 131072.000000 0 0.000000
953+ 262144.000000 0 0.000000
954+ 524288.000000 0 0.000000
955+ 1048576.00000 0 0.000000
956+ 2097152.00000 0 0.000000
957+ 4194304.00000 0 0.000000
958+ 8388608.00000 0 0.000000
959+TOO LONG 0 TOO LONG
960+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
961+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
962+FLUSH QUERY_RESPONSE_TIME;
963+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
964+SET SESSION debug="+d,query_exec_time_0.31";
965+SET SESSION debug="+d,query_exec_time_0.32";
966+SET SESSION debug="+d,query_exec_time_0.33";
967+SET SESSION debug="+d,query_exec_time_0.34";
968+SET SESSION debug="+d,query_exec_time_0.35";
969+SET SESSION debug="+d,query_exec_time_0.36";
970+SET SESSION debug="+d,query_exec_time_0.37";
971+SET SESSION debug="+d,query_exec_time_0.38";
972+SET SESSION debug="+d,query_exec_time_0.39";
973+SET SESSION debug="+d,query_exec_time_0.4";
974+SET SESSION debug="+d,query_exec_time_1.1";
975+SET SESSION debug="+d,query_exec_time_1.2";
976+SET SESSION debug="+d,query_exec_time_1.3";
977+SET SESSION debug="+d,query_exec_time_1.5";
978+SET SESSION debug="+d,query_exec_time_1.4";
979+SET SESSION debug="+d,query_exec_time_0.5";
980+SET SESSION debug="+d,query_exec_time_2.1";
981+SET SESSION debug="+d,query_exec_time_2.3";
982+SET SESSION debug="+d,query_exec_time_2.5";
983+SET SESSION debug="+d,query_exec_time_3.1";
984+SET SESSION debug="+d,query_exec_time_4.1";
985+SET SESSION debug="+d,query_exec_time_5.1";
986+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
987+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
988+Variable_name Value
989+query_response_time_range_base 10
990+SHOW QUERY_RESPONSE_TIME;
991+
992+ 0.000001 0 0.000000
993+ 0.000010 0 0.000000
994+ 0.000100 0 0.000000
995+ 0.001000 0 0.000000
996+ 0.010000 0 0.000000
997+ 0.100000 0 0.000000
998+ 1.000000 11 4.050000
999+ 10.000000 11 25.700000
1000+ 100.000000 0 0.000000
1001+ 1000.000000 0 0.000000
1002+ 10000.000000 0 0.000000
1003+ 100000.000000 0 0.000000
1004+ 1000000.00000 0 0.000000
1005+TOO LONG 0 TOO LONG
1006+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1007+time count total
1008+ 0.000001 0 0.000000
1009+ 0.000010 0 0.000000
1010+ 0.000100 0 0.000000
1011+ 0.001000 0 0.000000
1012+ 0.010000 0 0.000000
1013+ 0.100000 0 0.000000
1014+ 1.000000 11 4.050000
1015+ 10.000000 11 25.700000
1016+ 100.000000 0 0.000000
1017+ 1000.000000 0 0.000000
1018+ 10000.000000 0 0.000000
1019+ 100000.000000 0 0.000000
1020+ 1000000.00000 0 0.000000
1021+TOO LONG 0 TOO LONG
1022+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1023+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
1024+FLUSH QUERY_RESPONSE_TIME;
1025+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1026+SET SESSION debug="+d,query_exec_time_0.31";
1027+SET SESSION debug="+d,query_exec_time_0.32";
1028+SET SESSION debug="+d,query_exec_time_0.33";
1029+SET SESSION debug="+d,query_exec_time_0.34";
1030+SET SESSION debug="+d,query_exec_time_0.35";
1031+SET SESSION debug="+d,query_exec_time_0.36";
1032+SET SESSION debug="+d,query_exec_time_0.37";
1033+SET SESSION debug="+d,query_exec_time_0.38";
1034+SET SESSION debug="+d,query_exec_time_0.39";
1035+SET SESSION debug="+d,query_exec_time_0.4";
1036+SET SESSION debug="+d,query_exec_time_1.1";
1037+SET SESSION debug="+d,query_exec_time_1.2";
1038+SET SESSION debug="+d,query_exec_time_1.3";
1039+SET SESSION debug="+d,query_exec_time_1.5";
1040+SET SESSION debug="+d,query_exec_time_1.4";
1041+SET SESSION debug="+d,query_exec_time_0.5";
1042+SET SESSION debug="+d,query_exec_time_2.1";
1043+SET SESSION debug="+d,query_exec_time_2.3";
1044+SET SESSION debug="+d,query_exec_time_2.5";
1045+SET SESSION debug="+d,query_exec_time_3.1";
1046+SET SESSION debug="+d,query_exec_time_4.1";
1047+SET SESSION debug="+d,query_exec_time_5.1";
1048+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1049+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1050+Variable_name Value
1051+query_response_time_range_base 7
1052+SHOW QUERY_RESPONSE_TIME;
1053+
1054+ 0.000001 0 0.000000
1055+ 0.000008 0 0.000000
1056+ 0.000059 0 0.000000
1057+ 0.000416 0 0.000000
1058+ 0.002915 0 0.000000
1059+ 0.020408 0 0.000000
1060+ 0.142857 0 0.000000
1061+ 1.000000 11 4.050000
1062+ 7.000000 11 25.700000
1063+ 49.000000 0 0.000000
1064+ 343.000000 0 0.000000
1065+ 2401.000000 0 0.000000
1066+ 16807.000000 0 0.000000
1067+ 117649.000000 0 0.000000
1068+ 823543.000000 0 0.000000
1069+ 5764801.00000 0 0.000000
1070+TOO LONG 0 TOO LONG
1071+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1072+time count total
1073+ 0.000001 0 0.000000
1074+ 0.000008 0 0.000000
1075+ 0.000059 0 0.000000
1076+ 0.000416 0 0.000000
1077+ 0.002915 0 0.000000
1078+ 0.020408 0 0.000000
1079+ 0.142857 0 0.000000
1080+ 1.000000 11 4.050000
1081+ 7.000000 11 25.700000
1082+ 49.000000 0 0.000000
1083+ 343.000000 0 0.000000
1084+ 2401.000000 0 0.000000
1085+ 16807.000000 0 0.000000
1086+ 117649.000000 0 0.000000
1087+ 823543.000000 0 0.000000
1088+ 5764801.00000 0 0.000000
1089+TOO LONG 0 TOO LONG
1090+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1091+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
1092+FLUSH QUERY_RESPONSE_TIME;
1093+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1094+SET SESSION debug="+d,query_exec_time_0.31";
1095+SET SESSION debug="+d,query_exec_time_0.32";
1096+SET SESSION debug="+d,query_exec_time_0.33";
1097+SET SESSION debug="+d,query_exec_time_0.34";
1098+SET SESSION debug="+d,query_exec_time_0.35";
1099+SET SESSION debug="+d,query_exec_time_0.36";
1100+SET SESSION debug="+d,query_exec_time_0.37";
1101+SET SESSION debug="+d,query_exec_time_0.38";
1102+SET SESSION debug="+d,query_exec_time_0.39";
1103+SET SESSION debug="+d,query_exec_time_0.4";
1104+SET SESSION debug="+d,query_exec_time_1.1";
1105+SET SESSION debug="+d,query_exec_time_1.2";
1106+SET SESSION debug="+d,query_exec_time_1.3";
1107+SET SESSION debug="+d,query_exec_time_1.5";
1108+SET SESSION debug="+d,query_exec_time_1.4";
1109+SET SESSION debug="+d,query_exec_time_0.5";
1110+SET SESSION debug="+d,query_exec_time_2.1";
1111+SET SESSION debug="+d,query_exec_time_2.3";
1112+SET SESSION debug="+d,query_exec_time_2.5";
1113+SET SESSION debug="+d,query_exec_time_3.1";
1114+SET SESSION debug="+d,query_exec_time_4.1";
1115+SET SESSION debug="+d,query_exec_time_5.1";
1116+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1117+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1118+Variable_name Value
1119+query_response_time_range_base 156
1120+SHOW QUERY_RESPONSE_TIME;
1121+
1122+ 0.000041 0 0.000000
1123+ 0.006410 0 0.000000
1124+ 1.000000 11 4.050000
1125+ 156.000000 11 25.700000
1126+ 24336.000000 0 0.000000
1127+ 3796416.00000 0 0.000000
1128+TOO LONG 0 TOO LONG
1129+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1130+time count total
1131+ 0.000041 0 0.000000
1132+ 0.006410 0 0.000000
1133+ 1.000000 11 4.050000
1134+ 156.000000 11 25.700000
1135+ 24336.000000 0 0.000000
1136+ 3796416.00000 0 0.000000
1137+TOO LONG 0 TOO LONG
1138+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1139+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
1140+FLUSH QUERY_RESPONSE_TIME;
1141+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1142+SET SESSION debug="+d,query_exec_time_0.31";
1143+SET SESSION debug="+d,query_exec_time_0.32";
1144+SET SESSION debug="+d,query_exec_time_0.33";
1145+SET SESSION debug="+d,query_exec_time_0.34";
1146+SET SESSION debug="+d,query_exec_time_0.35";
1147+SET SESSION debug="+d,query_exec_time_0.36";
1148+SET SESSION debug="+d,query_exec_time_0.37";
1149+SET SESSION debug="+d,query_exec_time_0.38";
1150+SET SESSION debug="+d,query_exec_time_0.39";
1151+SET SESSION debug="+d,query_exec_time_0.4";
1152+SET SESSION debug="+d,query_exec_time_1.1";
1153+SET SESSION debug="+d,query_exec_time_1.2";
1154+SET SESSION debug="+d,query_exec_time_1.3";
1155+SET SESSION debug="+d,query_exec_time_1.5";
1156+SET SESSION debug="+d,query_exec_time_1.4";
1157+SET SESSION debug="+d,query_exec_time_0.5";
1158+SET SESSION debug="+d,query_exec_time_2.1";
1159+SET SESSION debug="+d,query_exec_time_2.3";
1160+SET SESSION debug="+d,query_exec_time_2.5";
1161+SET SESSION debug="+d,query_exec_time_3.1";
1162+SET SESSION debug="+d,query_exec_time_4.1";
1163+SET SESSION debug="+d,query_exec_time_5.1";
1164+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1165+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1166+Variable_name Value
1167+query_response_time_range_base 1000
1168+SHOW QUERY_RESPONSE_TIME;
1169+
1170+ 0.000001 0 0.000000
1171+ 0.001000 0 0.000000
1172+ 1.000000 11 4.050000
1173+ 1000.000000 11 25.700000
1174+ 1000000.00000 0 0.000000
1175+TOO LONG 0 TOO LONG
1176+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1177+time count total
1178+ 0.000001 0 0.000000
1179+ 0.001000 0 0.000000
1180+ 1.000000 11 4.050000
1181+ 1000.000000 11 25.700000
1182+ 1000000.00000 0 0.000000
1183+TOO LONG 0 TOO LONG
1184+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1185+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
1186+Warnings:
1187+Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
1188+FLUSH QUERY_RESPONSE_TIME;
1189+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1190+SET SESSION debug="+d,query_exec_time_0.31";
1191+SET SESSION debug="+d,query_exec_time_0.32";
1192+SET SESSION debug="+d,query_exec_time_0.33";
1193+SET SESSION debug="+d,query_exec_time_0.34";
1194+SET SESSION debug="+d,query_exec_time_0.35";
1195+SET SESSION debug="+d,query_exec_time_0.36";
1196+SET SESSION debug="+d,query_exec_time_0.37";
1197+SET SESSION debug="+d,query_exec_time_0.38";
1198+SET SESSION debug="+d,query_exec_time_0.39";
1199+SET SESSION debug="+d,query_exec_time_0.4";
1200+SET SESSION debug="+d,query_exec_time_1.1";
1201+SET SESSION debug="+d,query_exec_time_1.2";
1202+SET SESSION debug="+d,query_exec_time_1.3";
1203+SET SESSION debug="+d,query_exec_time_1.5";
1204+SET SESSION debug="+d,query_exec_time_1.4";
1205+SET SESSION debug="+d,query_exec_time_0.5";
1206+SET SESSION debug="+d,query_exec_time_2.1";
1207+SET SESSION debug="+d,query_exec_time_2.3";
1208+SET SESSION debug="+d,query_exec_time_2.5";
1209+SET SESSION debug="+d,query_exec_time_3.1";
1210+SET SESSION debug="+d,query_exec_time_4.1";
1211+SET SESSION debug="+d,query_exec_time_5.1";
1212+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1213+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1214+Variable_name Value
1215+query_response_time_range_base 1000
1216+SHOW QUERY_RESPONSE_TIME;
1217+
1218+ 0.000001 0 0.000000
1219+ 0.001000 0 0.000000
1220+ 1.000000 11 4.050000
1221+ 1000.000000 11 25.700000
1222+ 1000000.00000 0 0.000000
1223+TOO LONG 0 TOO LONG
1224+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1225+time count total
1226+ 0.000001 0 0.000000
1227+ 0.001000 0 0.000000
1228+ 1.000000 11 4.050000
1229+ 1000.000000 11 25.700000
1230+ 1000000.00000 0 0.000000
1231+TOO LONG 0 TOO LONG
1232+SET GLOBAL debug="";
1233+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
1234+SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
1235diff -ruN a/mysql-test/suite/percona/r/query_response_time-stored.result b/mysql-test/suite/percona/r/query_response_time-stored.result
1236--- a/mysql-test/suite/percona/r/query_response_time-stored.result 1970-01-01 03:00:00.000000000 +0300
1237+++ b/mysql-test/suite/percona/r/query_response_time-stored.result 2011-07-11 04:22:26.312345102 +0300
1238@@ -0,0 +1,529 @@
1239+CREATE PROCEDURE test_f(time VARCHAR(5),i INT)
1240+BEGIN
1241+SET SESSION debug=CONCAT("+d,query_exec_time_", time);
1242+/* query_exec_time= time */ INSERT INTO t VALUES(i);
1243+DELETE FROM t;
1244+END^
1245+SET GLOBAL debug="+d,query_exec_time_debug";
1246+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1247+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
1248+Warnings:
1249+Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
1250+FLUSH QUERY_RESPONSE_TIME;
1251+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1252+SET SESSION debug="+d,query_exec_time_0.31";
1253+SET SESSION debug="+d,query_exec_time_0.32";
1254+SET SESSION debug="+d,query_exec_time_0.33";
1255+SET SESSION debug="+d,query_exec_time_0.34";
1256+SET SESSION debug="+d,query_exec_time_0.35";
1257+SET SESSION debug="+d,query_exec_time_0.36";
1258+SET SESSION debug="+d,query_exec_time_0.37";
1259+SET SESSION debug="+d,query_exec_time_0.38";
1260+SET SESSION debug="+d,query_exec_time_0.39";
1261+SET SESSION debug="+d,query_exec_time_0.4";
1262+SET SESSION debug="+d,query_exec_time_1.1";
1263+SET SESSION debug="+d,query_exec_time_1.2";
1264+SET SESSION debug="+d,query_exec_time_1.3";
1265+SET SESSION debug="+d,query_exec_time_1.5";
1266+SET SESSION debug="+d,query_exec_time_1.4";
1267+SET SESSION debug="+d,query_exec_time_0.5";
1268+SET SESSION debug="+d,query_exec_time_2.1";
1269+SET SESSION debug="+d,query_exec_time_2.3";
1270+SET SESSION debug="+d,query_exec_time_2.5";
1271+SET SESSION debug="+d,query_exec_time_3.1";
1272+SET SESSION debug="+d,query_exec_time_4.1";
1273+SET SESSION debug="+d,query_exec_time_5.1";
1274+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1275+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1276+Variable_name Value
1277+query_response_time_range_base 2
1278+SHOW QUERY_RESPONSE_TIME;
1279+
1280+ 0.000001 0 0.000000
1281+ 0.000003 0 0.000000
1282+ 0.000007 0 0.000000
1283+ 0.000015 0 0.000000
1284+ 0.000030 0 0.000000
1285+ 0.000061 0 0.000000
1286+ 0.000122 0 0.000000
1287+ 0.000244 0 0.000000
1288+ 0.000488 0 0.000000
1289+ 0.000976 0 0.000000
1290+ 0.001953 0 0.000000
1291+ 0.003906 0 0.000000
1292+ 0.007812 0 0.000000
1293+ 0.015625 0 0.000000
1294+ 0.031250 0 0.000000
1295+ 0.062500 0 0.000000
1296+ 0.125000 0 0.000000
1297+ 0.250000 0 0.000000
1298+ 0.500000 10 3.550000
1299+ 1.000000 1 0.500000
1300+ 2.000000 5 6.500000
1301+ 4.000000 4 10.000000
1302+ 8.000000 2 9.200000
1303+ 16.000000 0 0.000000
1304+ 32.000000 0 0.000000
1305+ 64.000000 0 0.000000
1306+ 128.000000 0 0.000000
1307+ 256.000000 0 0.000000
1308+ 512.000000 0 0.000000
1309+ 1024.000000 0 0.000000
1310+ 2048.000000 0 0.000000
1311+ 4096.000000 0 0.000000
1312+ 8192.000000 0 0.000000
1313+ 16384.000000 0 0.000000
1314+ 32768.000000 0 0.000000
1315+ 65536.000000 0 0.000000
1316+ 131072.000000 0 0.000000
1317+ 262144.000000 0 0.000000
1318+ 524288.000000 0 0.000000
1319+ 1048576.00000 0 0.000000
1320+ 2097152.00000 0 0.000000
1321+ 4194304.00000 0 0.000000
1322+ 8388608.00000 0 0.000000
1323+TOO LONG 0 TOO LONG
1324+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1325+time count total
1326+ 0.000001 0 0.000000
1327+ 0.000003 0 0.000000
1328+ 0.000007 0 0.000000
1329+ 0.000015 0 0.000000
1330+ 0.000030 0 0.000000
1331+ 0.000061 0 0.000000
1332+ 0.000122 0 0.000000
1333+ 0.000244 0 0.000000
1334+ 0.000488 0 0.000000
1335+ 0.000976 0 0.000000
1336+ 0.001953 0 0.000000
1337+ 0.003906 0 0.000000
1338+ 0.007812 0 0.000000
1339+ 0.015625 0 0.000000
1340+ 0.031250 0 0.000000
1341+ 0.062500 0 0.000000
1342+ 0.125000 0 0.000000
1343+ 0.250000 0 0.000000
1344+ 0.500000 10 3.550000
1345+ 1.000000 1 0.500000
1346+ 2.000000 5 6.500000
1347+ 4.000000 4 10.000000
1348+ 8.000000 2 9.200000
1349+ 16.000000 0 0.000000
1350+ 32.000000 0 0.000000
1351+ 64.000000 0 0.000000
1352+ 128.000000 0 0.000000
1353+ 256.000000 0 0.000000
1354+ 512.000000 0 0.000000
1355+ 1024.000000 0 0.000000
1356+ 2048.000000 0 0.000000
1357+ 4096.000000 0 0.000000
1358+ 8192.000000 0 0.000000
1359+ 16384.000000 0 0.000000
1360+ 32768.000000 0 0.000000
1361+ 65536.000000 0 0.000000
1362+ 131072.000000 0 0.000000
1363+ 262144.000000 0 0.000000
1364+ 524288.000000 0 0.000000
1365+ 1048576.00000 0 0.000000
1366+ 2097152.00000 0 0.000000
1367+ 4194304.00000 0 0.000000
1368+ 8388608.00000 0 0.000000
1369+TOO LONG 0 TOO LONG
1370+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1371+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
1372+FLUSH QUERY_RESPONSE_TIME;
1373+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1374+SET SESSION debug="+d,query_exec_time_0.31";
1375+SET SESSION debug="+d,query_exec_time_0.32";
1376+SET SESSION debug="+d,query_exec_time_0.33";
1377+SET SESSION debug="+d,query_exec_time_0.34";
1378+SET SESSION debug="+d,query_exec_time_0.35";
1379+SET SESSION debug="+d,query_exec_time_0.36";
1380+SET SESSION debug="+d,query_exec_time_0.37";
1381+SET SESSION debug="+d,query_exec_time_0.38";
1382+SET SESSION debug="+d,query_exec_time_0.39";
1383+SET SESSION debug="+d,query_exec_time_0.4";
1384+SET SESSION debug="+d,query_exec_time_1.1";
1385+SET SESSION debug="+d,query_exec_time_1.2";
1386+SET SESSION debug="+d,query_exec_time_1.3";
1387+SET SESSION debug="+d,query_exec_time_1.5";
1388+SET SESSION debug="+d,query_exec_time_1.4";
1389+SET SESSION debug="+d,query_exec_time_0.5";
1390+SET SESSION debug="+d,query_exec_time_2.1";
1391+SET SESSION debug="+d,query_exec_time_2.3";
1392+SET SESSION debug="+d,query_exec_time_2.5";
1393+SET SESSION debug="+d,query_exec_time_3.1";
1394+SET SESSION debug="+d,query_exec_time_4.1";
1395+SET SESSION debug="+d,query_exec_time_5.1";
1396+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1397+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1398+Variable_name Value
1399+query_response_time_range_base 2
1400+SHOW QUERY_RESPONSE_TIME;
1401+
1402+ 0.000001 0 0.000000
1403+ 0.000003 0 0.000000
1404+ 0.000007 0 0.000000
1405+ 0.000015 0 0.000000
1406+ 0.000030 0 0.000000
1407+ 0.000061 0 0.000000
1408+ 0.000122 0 0.000000
1409+ 0.000244 0 0.000000
1410+ 0.000488 0 0.000000
1411+ 0.000976 0 0.000000
1412+ 0.001953 0 0.000000
1413+ 0.003906 0 0.000000
1414+ 0.007812 0 0.000000
1415+ 0.015625 0 0.000000
1416+ 0.031250 0 0.000000
1417+ 0.062500 0 0.000000
1418+ 0.125000 0 0.000000
1419+ 0.250000 0 0.000000
1420+ 0.500000 10 3.550000
1421+ 1.000000 1 0.500000
1422+ 2.000000 5 6.500000
1423+ 4.000000 4 10.000000
1424+ 8.000000 2 9.200000
1425+ 16.000000 0 0.000000
1426+ 32.000000 0 0.000000
1427+ 64.000000 0 0.000000
1428+ 128.000000 0 0.000000
1429+ 256.000000 0 0.000000
1430+ 512.000000 0 0.000000
1431+ 1024.000000 0 0.000000
1432+ 2048.000000 0 0.000000
1433+ 4096.000000 0 0.000000
1434+ 8192.000000 0 0.000000
1435+ 16384.000000 0 0.000000
1436+ 32768.000000 0 0.000000
1437+ 65536.000000 0 0.000000
1438+ 131072.000000 0 0.000000
1439+ 262144.000000 0 0.000000
1440+ 524288.000000 0 0.000000
1441+ 1048576.00000 0 0.000000
1442+ 2097152.00000 0 0.000000
1443+ 4194304.00000 0 0.000000
1444+ 8388608.00000 0 0.000000
1445+TOO LONG 0 TOO LONG
1446+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1447+time count total
1448+ 0.000001 0 0.000000
1449+ 0.000003 0 0.000000
1450+ 0.000007 0 0.000000
1451+ 0.000015 0 0.000000
1452+ 0.000030 0 0.000000
1453+ 0.000061 0 0.000000
1454+ 0.000122 0 0.000000
1455+ 0.000244 0 0.000000
1456+ 0.000488 0 0.000000
1457+ 0.000976 0 0.000000
1458+ 0.001953 0 0.000000
1459+ 0.003906 0 0.000000
1460+ 0.007812 0 0.000000
1461+ 0.015625 0 0.000000
1462+ 0.031250 0 0.000000
1463+ 0.062500 0 0.000000
1464+ 0.125000 0 0.000000
1465+ 0.250000 0 0.000000
1466+ 0.500000 10 3.550000
1467+ 1.000000 1 0.500000
1468+ 2.000000 5 6.500000
1469+ 4.000000 4 10.000000
1470+ 8.000000 2 9.200000
1471+ 16.000000 0 0.000000
1472+ 32.000000 0 0.000000
1473+ 64.000000 0 0.000000
1474+ 128.000000 0 0.000000
1475+ 256.000000 0 0.000000
1476+ 512.000000 0 0.000000
1477+ 1024.000000 0 0.000000
1478+ 2048.000000 0 0.000000
1479+ 4096.000000 0 0.000000
1480+ 8192.000000 0 0.000000
1481+ 16384.000000 0 0.000000
1482+ 32768.000000 0 0.000000
1483+ 65536.000000 0 0.000000
1484+ 131072.000000 0 0.000000
1485+ 262144.000000 0 0.000000
1486+ 524288.000000 0 0.000000
1487+ 1048576.00000 0 0.000000
1488+ 2097152.00000 0 0.000000
1489+ 4194304.00000 0 0.000000
1490+ 8388608.00000 0 0.000000
1491+TOO LONG 0 TOO LONG
1492+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1493+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
1494+FLUSH QUERY_RESPONSE_TIME;
1495+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1496+SET SESSION debug="+d,query_exec_time_0.31";
1497+SET SESSION debug="+d,query_exec_time_0.32";
1498+SET SESSION debug="+d,query_exec_time_0.33";
1499+SET SESSION debug="+d,query_exec_time_0.34";
1500+SET SESSION debug="+d,query_exec_time_0.35";
1501+SET SESSION debug="+d,query_exec_time_0.36";
1502+SET SESSION debug="+d,query_exec_time_0.37";
1503+SET SESSION debug="+d,query_exec_time_0.38";
1504+SET SESSION debug="+d,query_exec_time_0.39";
1505+SET SESSION debug="+d,query_exec_time_0.4";
1506+SET SESSION debug="+d,query_exec_time_1.1";
1507+SET SESSION debug="+d,query_exec_time_1.2";
1508+SET SESSION debug="+d,query_exec_time_1.3";
1509+SET SESSION debug="+d,query_exec_time_1.5";
1510+SET SESSION debug="+d,query_exec_time_1.4";
1511+SET SESSION debug="+d,query_exec_time_0.5";
1512+SET SESSION debug="+d,query_exec_time_2.1";
1513+SET SESSION debug="+d,query_exec_time_2.3";
1514+SET SESSION debug="+d,query_exec_time_2.5";
1515+SET SESSION debug="+d,query_exec_time_3.1";
1516+SET SESSION debug="+d,query_exec_time_4.1";
1517+SET SESSION debug="+d,query_exec_time_5.1";
1518+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1519+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1520+Variable_name Value
1521+query_response_time_range_base 10
1522+SHOW QUERY_RESPONSE_TIME;
1523+
1524+ 0.000001 0 0.000000
1525+ 0.000010 0 0.000000
1526+ 0.000100 0 0.000000
1527+ 0.001000 0 0.000000
1528+ 0.010000 0 0.000000
1529+ 0.100000 0 0.000000
1530+ 1.000000 11 4.050000
1531+ 10.000000 11 25.700000
1532+ 100.000000 0 0.000000
1533+ 1000.000000 0 0.000000
1534+ 10000.000000 0 0.000000
1535+ 100000.000000 0 0.000000
1536+ 1000000.00000 0 0.000000
1537+TOO LONG 0 TOO LONG
1538+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1539+time count total
1540+ 0.000001 0 0.000000
1541+ 0.000010 0 0.000000
1542+ 0.000100 0 0.000000
1543+ 0.001000 0 0.000000
1544+ 0.010000 0 0.000000
1545+ 0.100000 0 0.000000
1546+ 1.000000 11 4.050000
1547+ 10.000000 11 25.700000
1548+ 100.000000 0 0.000000
1549+ 1000.000000 0 0.000000
1550+ 10000.000000 0 0.000000
1551+ 100000.000000 0 0.000000
1552+ 1000000.00000 0 0.000000
1553+TOO LONG 0 TOO LONG
1554+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1555+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
1556+FLUSH QUERY_RESPONSE_TIME;
1557+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1558+SET SESSION debug="+d,query_exec_time_0.31";
1559+SET SESSION debug="+d,query_exec_time_0.32";
1560+SET SESSION debug="+d,query_exec_time_0.33";
1561+SET SESSION debug="+d,query_exec_time_0.34";
1562+SET SESSION debug="+d,query_exec_time_0.35";
1563+SET SESSION debug="+d,query_exec_time_0.36";
1564+SET SESSION debug="+d,query_exec_time_0.37";
1565+SET SESSION debug="+d,query_exec_time_0.38";
1566+SET SESSION debug="+d,query_exec_time_0.39";
1567+SET SESSION debug="+d,query_exec_time_0.4";
1568+SET SESSION debug="+d,query_exec_time_1.1";
1569+SET SESSION debug="+d,query_exec_time_1.2";
1570+SET SESSION debug="+d,query_exec_time_1.3";
1571+SET SESSION debug="+d,query_exec_time_1.5";
1572+SET SESSION debug="+d,query_exec_time_1.4";
1573+SET SESSION debug="+d,query_exec_time_0.5";
1574+SET SESSION debug="+d,query_exec_time_2.1";
1575+SET SESSION debug="+d,query_exec_time_2.3";
1576+SET SESSION debug="+d,query_exec_time_2.5";
1577+SET SESSION debug="+d,query_exec_time_3.1";
1578+SET SESSION debug="+d,query_exec_time_4.1";
1579+SET SESSION debug="+d,query_exec_time_5.1";
1580+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1581+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1582+Variable_name Value
1583+query_response_time_range_base 7
1584+SHOW QUERY_RESPONSE_TIME;
1585+
1586+ 0.000001 0 0.000000
1587+ 0.000008 0 0.000000
1588+ 0.000059 0 0.000000
1589+ 0.000416 0 0.000000
1590+ 0.002915 0 0.000000
1591+ 0.020408 0 0.000000
1592+ 0.142857 0 0.000000
1593+ 1.000000 11 4.050000
1594+ 7.000000 11 25.700000
1595+ 49.000000 0 0.000000
1596+ 343.000000 0 0.000000
1597+ 2401.000000 0 0.000000
1598+ 16807.000000 0 0.000000
1599+ 117649.000000 0 0.000000
1600+ 823543.000000 0 0.000000
1601+ 5764801.00000 0 0.000000
1602+TOO LONG 0 TOO LONG
1603+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1604+time count total
1605+ 0.000001 0 0.000000
1606+ 0.000008 0 0.000000
1607+ 0.000059 0 0.000000
1608+ 0.000416 0 0.000000
1609+ 0.002915 0 0.000000
1610+ 0.020408 0 0.000000
1611+ 0.142857 0 0.000000
1612+ 1.000000 11 4.050000
1613+ 7.000000 11 25.700000
1614+ 49.000000 0 0.000000
1615+ 343.000000 0 0.000000
1616+ 2401.000000 0 0.000000
1617+ 16807.000000 0 0.000000
1618+ 117649.000000 0 0.000000
1619+ 823543.000000 0 0.000000
1620+ 5764801.00000 0 0.000000
1621+TOO LONG 0 TOO LONG
1622+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1623+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
1624+FLUSH QUERY_RESPONSE_TIME;
1625+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1626+SET SESSION debug="+d,query_exec_time_0.31";
1627+SET SESSION debug="+d,query_exec_time_0.32";
1628+SET SESSION debug="+d,query_exec_time_0.33";
1629+SET SESSION debug="+d,query_exec_time_0.34";
1630+SET SESSION debug="+d,query_exec_time_0.35";
1631+SET SESSION debug="+d,query_exec_time_0.36";
1632+SET SESSION debug="+d,query_exec_time_0.37";
1633+SET SESSION debug="+d,query_exec_time_0.38";
1634+SET SESSION debug="+d,query_exec_time_0.39";
1635+SET SESSION debug="+d,query_exec_time_0.4";
1636+SET SESSION debug="+d,query_exec_time_1.1";
1637+SET SESSION debug="+d,query_exec_time_1.2";
1638+SET SESSION debug="+d,query_exec_time_1.3";
1639+SET SESSION debug="+d,query_exec_time_1.5";
1640+SET SESSION debug="+d,query_exec_time_1.4";
1641+SET SESSION debug="+d,query_exec_time_0.5";
1642+SET SESSION debug="+d,query_exec_time_2.1";
1643+SET SESSION debug="+d,query_exec_time_2.3";
1644+SET SESSION debug="+d,query_exec_time_2.5";
1645+SET SESSION debug="+d,query_exec_time_3.1";
1646+SET SESSION debug="+d,query_exec_time_4.1";
1647+SET SESSION debug="+d,query_exec_time_5.1";
1648+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1649+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1650+Variable_name Value
1651+query_response_time_range_base 156
1652+SHOW QUERY_RESPONSE_TIME;
1653+
1654+ 0.000041 0 0.000000
1655+ 0.006410 0 0.000000
1656+ 1.000000 11 4.050000
1657+ 156.000000 11 25.700000
1658+ 24336.000000 0 0.000000
1659+ 3796416.00000 0 0.000000
1660+TOO LONG 0 TOO LONG
1661+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1662+time count total
1663+ 0.000041 0 0.000000
1664+ 0.006410 0 0.000000
1665+ 1.000000 11 4.050000
1666+ 156.000000 11 25.700000
1667+ 24336.000000 0 0.000000
1668+ 3796416.00000 0 0.000000
1669+TOO LONG 0 TOO LONG
1670+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1671+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
1672+FLUSH QUERY_RESPONSE_TIME;
1673+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1674+SET SESSION debug="+d,query_exec_time_0.31";
1675+SET SESSION debug="+d,query_exec_time_0.32";
1676+SET SESSION debug="+d,query_exec_time_0.33";
1677+SET SESSION debug="+d,query_exec_time_0.34";
1678+SET SESSION debug="+d,query_exec_time_0.35";
1679+SET SESSION debug="+d,query_exec_time_0.36";
1680+SET SESSION debug="+d,query_exec_time_0.37";
1681+SET SESSION debug="+d,query_exec_time_0.38";
1682+SET SESSION debug="+d,query_exec_time_0.39";
1683+SET SESSION debug="+d,query_exec_time_0.4";
1684+SET SESSION debug="+d,query_exec_time_1.1";
1685+SET SESSION debug="+d,query_exec_time_1.2";
1686+SET SESSION debug="+d,query_exec_time_1.3";
1687+SET SESSION debug="+d,query_exec_time_1.5";
1688+SET SESSION debug="+d,query_exec_time_1.4";
1689+SET SESSION debug="+d,query_exec_time_0.5";
1690+SET SESSION debug="+d,query_exec_time_2.1";
1691+SET SESSION debug="+d,query_exec_time_2.3";
1692+SET SESSION debug="+d,query_exec_time_2.5";
1693+SET SESSION debug="+d,query_exec_time_3.1";
1694+SET SESSION debug="+d,query_exec_time_4.1";
1695+SET SESSION debug="+d,query_exec_time_5.1";
1696+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1697+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1698+Variable_name Value
1699+query_response_time_range_base 1000
1700+SHOW QUERY_RESPONSE_TIME;
1701+
1702+ 0.000001 0 0.000000
1703+ 0.001000 0 0.000000
1704+ 1.000000 11 4.050000
1705+ 1000.000000 11 25.700000
1706+ 1000000.00000 0 0.000000
1707+TOO LONG 0 TOO LONG
1708+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1709+time count total
1710+ 0.000001 0 0.000000
1711+ 0.001000 0 0.000000
1712+ 1.000000 11 4.050000
1713+ 1000.000000 11 25.700000
1714+ 1000000.00000 0 0.000000
1715+TOO LONG 0 TOO LONG
1716+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1717+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
1718+Warnings:
1719+Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
1720+FLUSH QUERY_RESPONSE_TIME;
1721+SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1722+SET SESSION debug="+d,query_exec_time_0.31";
1723+SET SESSION debug="+d,query_exec_time_0.32";
1724+SET SESSION debug="+d,query_exec_time_0.33";
1725+SET SESSION debug="+d,query_exec_time_0.34";
1726+SET SESSION debug="+d,query_exec_time_0.35";
1727+SET SESSION debug="+d,query_exec_time_0.36";
1728+SET SESSION debug="+d,query_exec_time_0.37";
1729+SET SESSION debug="+d,query_exec_time_0.38";
1730+SET SESSION debug="+d,query_exec_time_0.39";
1731+SET SESSION debug="+d,query_exec_time_0.4";
1732+SET SESSION debug="+d,query_exec_time_1.1";
1733+SET SESSION debug="+d,query_exec_time_1.2";
1734+SET SESSION debug="+d,query_exec_time_1.3";
1735+SET SESSION debug="+d,query_exec_time_1.5";
1736+SET SESSION debug="+d,query_exec_time_1.4";
1737+SET SESSION debug="+d,query_exec_time_0.5";
1738+SET SESSION debug="+d,query_exec_time_2.1";
1739+SET SESSION debug="+d,query_exec_time_2.3";
1740+SET SESSION debug="+d,query_exec_time_2.5";
1741+SET SESSION debug="+d,query_exec_time_3.1";
1742+SET SESSION debug="+d,query_exec_time_4.1";
1743+SET SESSION debug="+d,query_exec_time_5.1";
1744+SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1745+SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1746+Variable_name Value
1747+query_response_time_range_base 1000
1748+SHOW QUERY_RESPONSE_TIME;
1749+
1750+ 0.000001 0 0.000000
1751+ 0.001000 0 0.000000
1752+ 1.000000 11 4.050000
1753+ 1000.000000 11 25.700000
1754+ 1000000.00000 0 0.000000
1755+TOO LONG 0 TOO LONG
1756+SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1757+time count total
1758+ 0.000001 0 0.000000
1759+ 0.001000 0 0.000000
1760+ 1.000000 11 4.050000
1761+ 1000.000000 11 25.700000
1762+ 1000000.00000 0 0.000000
1763+TOO LONG 0 TOO LONG
1764+SET GLOBAL debug="";
1765+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
1766+SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
1767+DROP PROCEDURE test_f;
1768diff -ruN a/mysql-test/suite/percona/t/query_response_time-replication.test b/mysql-test/suite/percona/t/query_response_time-replication.test
1769--- a/mysql-test/suite/percona/t/query_response_time-replication.test 1970-01-01 03:00:00.000000000 +0300
1770+++ b/mysql-test/suite/percona/t/query_response_time-replication.test 2011-07-11 04:22:26.319345151 +0300
1771@@ -0,0 +1,40 @@
1772+--source include/have_response_time_distribution.inc
1773+--source include/have_debug.inc
1774+--source include/have_binlog_format_statement.inc
1775+--source include/master-slave.inc
1776+
1777+connection master;
1778+--disable_warnings
1779+DROP TABLE IF EXISTS t;
1780+--enable_warnings
1781+CREATE TABLE t(id INT);
1782+sync_slave_with_master;
1783+
1784+connection slave;
1785+SET GLOBAL debug="+d,query_exec_time_debug";
1786+
1787+--let base=1
1788+--source suite/percona/include/query_response_time.inc
1789+--let base=2
1790+--source suite/percona/include/query_response_time.inc
1791+--let base=10
1792+--source suite/percona/include/query_response_time.inc
1793+--let base=7
1794+--source suite/percona/include/query_response_time.inc
1795+--let base=156
1796+--source suite/percona/include/query_response_time.inc
1797+--let base=1000
1798+--source suite/percona/include/query_response_time.inc
1799+--let base=1001
1800+--source suite/percona/include/query_response_time.inc
1801+
1802+connection slave;
1803+SET GLOBAL debug="";
1804+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
1805+SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
1806+
1807+connection master;
1808+DROP TABLE t;
1809+sync_slave_with_master;
1810+
1811+--source include/rpl_end.inc
1812diff -ruN a/mysql-test/suite/percona/t/query_response_time-stored.test b/mysql-test/suite/percona/t/query_response_time-stored.test
1813--- a/mysql-test/suite/percona/t/query_response_time-stored.test 1970-01-01 03:00:00.000000000 +0300
1814+++ b/mysql-test/suite/percona/t/query_response_time-stored.test 2011-07-11 04:22:26.319345151 +0300
1815@@ -0,0 +1,34 @@
1816+--source include/have_response_time_distribution.inc
1817+--source include/have_debug.inc
1818+
1819+delimiter ^;
1820+CREATE PROCEDURE test_f(time VARCHAR(5),i INT)
1821+BEGIN
1822+ SET SESSION debug=CONCAT("+d,query_exec_time_", time);
1823+ /* query_exec_time= time */ INSERT INTO t VALUES(i);
1824+ DELETE FROM t;
1825+END^
1826+delimiter ;^
1827+
1828+SET GLOBAL debug="+d,query_exec_time_debug";
1829+
1830+--let base=1
1831+--source suite/percona/include/query_response_time.inc
1832+--let base=2
1833+--source suite/percona/include/query_response_time.inc
1834+--let base=10
1835+--source suite/percona/include/query_response_time.inc
1836+--let base=7
1837+--source suite/percona/include/query_response_time.inc
1838+--let base=156
1839+--source suite/percona/include/query_response_time.inc
1840+--let base=1000
1841+--source suite/percona/include/query_response_time.inc
1842+--let base=1001
1843+--source suite/percona/include/query_response_time.inc
1844+
1845+SET GLOBAL debug="";
1846+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
1847+SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
1848+
1849+DROP PROCEDURE test_f;
1850diff -ruN a/mysql-test/suite/percona/t/query_response_time.test b/mysql-test/suite/percona/t/query_response_time.test
1851--- a/mysql-test/suite/percona/t/query_response_time.test 1970-01-01 03:00:00.000000000 +0300
1852+++ b/mysql-test/suite/percona/t/query_response_time.test 2011-07-11 04:22:26.319345151 +0300
1853@@ -0,0 +1,23 @@
1854+--source include/have_response_time_distribution.inc
1855+--source include/have_debug.inc
1856+
1857+SET GLOBAL debug="+d,query_exec_time_debug";
1858+
1859+--let base=1
1860+--source suite/percona/include/query_response_time.inc
1861+--let base=2
1862+--source suite/percona/include/query_response_time.inc
1863+--let base=10
1864+--source suite/percona/include/query_response_time.inc
1865+--let base=7
1866+--source suite/percona/include/query_response_time.inc
1867+--let base=156
1868+--source suite/percona/include/query_response_time.inc
1869+--let base=1000
1870+--source suite/percona/include/query_response_time.inc
1871+--let base=1001
1872+--source suite/percona/include/query_response_time.inc
1873+
1874+SET GLOBAL debug="";
1875+SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
1876+SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
1877diff -ruN a/patch_info/response-time-distribution.info b/patch_info/response-time-distribution.info
1878--- a/patch_info/response-time-distribution.info 1970-01-01 03:00:00.000000000 +0300
1879+++ b/patch_info/response-time-distribution.info 2011-07-11 04:22:26.320345158 +0300
47@@ -0,0 +1,9 @@1880@@ -0,0 +1,9 @@
48+File=response-time-distribution.patch1881+File=response-time-distribution.patch
49+Name=Response time distribution1882+Name=Response time distribution
@@ -55,8 +1888,8 @@
55+2010-07-02 first version avaliable1888+2010-07-02 first version avaliable
56+2010-09-15 add column 'total'1889+2010-09-15 add column 'total'
57diff -ruN a/sql/CMakeLists.txt b/sql/CMakeLists.txt1890diff -ruN a/sql/CMakeLists.txt b/sql/CMakeLists.txt
58--- a/sql/CMakeLists.txt 2011-03-31 17:36:18.000000000 +04001891--- a/sql/CMakeLists.txt 2011-05-11 14:54:12.000000000 +0300
59+++ b/sql/CMakeLists.txt 2011-04-09 19:12:12.000000000 +04001892+++ b/sql/CMakeLists.txt 2011-07-11 04:22:26.321345166 +0300
60@@ -51,7 +51,7 @@1893@@ -51,7 +51,7 @@
61 message.h mf_iocache.cc my_decimal.cc ../sql-common/my_time.c1894 message.h mf_iocache.cc my_decimal.cc ../sql-common/my_time.c
62 mysqld.cc net_serv.cc keycaches.cc1895 mysqld.cc net_serv.cc keycaches.cc
@@ -76,8 +1909,8 @@
76 debug_sync.cc debug_sync.h1909 debug_sync.cc debug_sync.h
77 sql_repl.cc sql_select.cc sql_show.cc sql_state.c sql_string.cc 1910 sql_repl.cc sql_select.cc sql_show.cc sql_state.c sql_string.cc
78diff -ruN a/sql/handler.h b/sql/handler.h1911diff -ruN a/sql/handler.h b/sql/handler.h
79--- a/sql/handler.h 2011-04-09 19:11:54.000000000 +04001912--- a/sql/handler.h 2011-07-11 04:22:07.914214616 +0300
80+++ b/sql/handler.h 2011-04-10 11:28:51.000000000 +04001913+++ b/sql/handler.h 2011-07-11 04:22:26.322345173 +0300
81@@ -580,6 +580,7 @@1914@@ -580,6 +580,7 @@
82 SCH_PROFILES,1915 SCH_PROFILES,
83 SCH_REFERENTIAL_CONSTRAINTS,1916 SCH_REFERENTIAL_CONSTRAINTS,
@@ -87,8 +1920,8 @@
87 SCH_SCHEMA_PRIVILEGES,1920 SCH_SCHEMA_PRIVILEGES,
88 SCH_SESSION_STATUS,1921 SCH_SESSION_STATUS,
89diff -ruN a/sql/lex.h b/sql/lex.h1922diff -ruN a/sql/lex.h b/sql/lex.h
90--- a/sql/lex.h 2011-03-31 17:36:18.000000000 +04001923--- a/sql/lex.h 2011-05-11 14:54:12.000000000 +0300
91+++ b/sql/lex.h 2011-04-10 11:28:52.000000000 +04001924+++ b/sql/lex.h 2011-07-11 04:22:26.323345179 +0300
92@@ -426,6 +426,7 @@1925@@ -426,6 +426,7 @@
93 { "PURGE", SYM(PURGE)},1926 { "PURGE", SYM(PURGE)},
94 { "QUARTER", SYM(QUARTER_SYM)},1927 { "QUARTER", SYM(QUARTER_SYM)},
@@ -98,8 +1931,8 @@
98 { "RANGE", SYM(RANGE_SYM)},1931 { "RANGE", SYM(RANGE_SYM)},
99 { "READ", SYM(READ_SYM)},1932 { "READ", SYM(READ_SYM)},
100diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc1933diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
101--- a/sql/mysqld.cc 2011-04-09 19:12:11.000000000 +04001934--- a/sql/mysqld.cc 2011-07-11 04:22:09.059222736 +0300
102+++ b/sql/mysqld.cc 2011-04-10 11:28:52.000000000 +04001935+++ b/sql/mysqld.cc 2011-07-11 04:22:26.325345194 +0300
103@@ -69,6 +69,8 @@1936@@ -69,6 +69,8 @@
104 #include "debug_sync.h"1937 #include "debug_sync.h"
105 #include "sql_callback.h"1938 #include "sql_callback.h"
@@ -162,8 +1995,8 @@
162 have_geometry=SHOW_OPTION_YES;1995 have_geometry=SHOW_OPTION_YES;
163 #else1996 #else
164diff -ruN a/sql/mysqld.h b/sql/mysqld.h1997diff -ruN a/sql/mysqld.h b/sql/mysqld.h
165--- a/sql/mysqld.h 2011-04-09 19:12:11.000000000 +04001998--- a/sql/mysqld.h 2011-07-11 04:22:09.045222637 +0300
166+++ b/sql/mysqld.h 2011-04-10 11:28:52.000000000 +04001999+++ b/sql/mysqld.h 2011-07-11 04:22:26.327345208 +0300
167@@ -98,6 +98,10 @@2000@@ -98,6 +98,10 @@
168 extern bool opt_disable_networking, opt_skip_show_db;2001 extern bool opt_disable_networking, opt_skip_show_db;
169 extern bool opt_skip_name_resolve;2002 extern bool opt_skip_name_resolve;
@@ -175,9 +2008,9 @@
175 extern my_bool opt_character_set_client_handshake;2008 extern my_bool opt_character_set_client_handshake;
176 extern bool volatile abort_loop;2009 extern bool volatile abort_loop;
177 extern bool in_bootstrap;2010 extern bool in_bootstrap;
178diff -ruN /dev/null b/sql/query_response_time.cc2011diff -ruN a/sql/query_response_time.cc b/sql/query_response_time.cc
179--- /dev/null 1970-01-01 00:00:00.000000000 +00002012--- a/sql/query_response_time.cc 1970-01-01 03:00:00.000000000 +0300
180+++ b/sql/query_response_time.cc 2011-04-10 00:27:11.000000000 +04002013+++ b/sql/query_response_time.cc 2011-07-11 04:22:26.328345215 +0300
181@@ -0,0 +1,310 @@2014@@ -0,0 +1,310 @@
182+#include "mysql_version.h"2015+#include "mysql_version.h"
183+#include "my_global.h"2016+#include "my_global.h"
@@ -489,9 +2322,9 @@
489+ return query_response_time::g_collector.fill(thd,tables,cond);2322+ return query_response_time::g_collector.fill(thd,tables,cond);
490+}2323+}
491+#endif // HAVE_RESPONSE_TIME_DISTRIBUTION2324+#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
492diff -ruN /dev/null b/sql/query_response_time.h2325diff -ruN a/sql/query_response_time.h b/sql/query_response_time.h
493--- /dev/null 1970-01-01 00:00:00.000000000 +00002326--- a/sql/query_response_time.h 1970-01-01 03:00:00.000000000 +0300
494+++ b/sql/query_response_time.h 2011-04-09 19:12:12.000000000 +04002327+++ b/sql/query_response_time.h 2011-07-11 04:22:26.328345215 +0300
495@@ -0,0 +1,71 @@2328@@ -0,0 +1,71 @@
496+#ifndef QUERY_RESPONSE_TIME_H2329+#ifndef QUERY_RESPONSE_TIME_H
497+#define QUERY_RESPONSE_TIME_H2330+#define QUERY_RESPONSE_TIME_H
@@ -565,8 +2398,8 @@
565+2398+
566+#endif // QUERY_RESPONSE_TIME_H2399+#endif // QUERY_RESPONSE_TIME_H
567diff -ruN a/sql/set_var.h b/sql/set_var.h2400diff -ruN a/sql/set_var.h b/sql/set_var.h
568--- a/sql/set_var.h 2011-03-31 17:36:18.000000000 +04002401--- a/sql/set_var.h 2011-05-11 14:54:11.000000000 +0300
569+++ b/sql/set_var.h 2011-04-09 19:12:12.000000000 +04002402+++ b/sql/set_var.h 2011-07-11 04:22:26.328345215 +0300
570@@ -293,6 +293,7 @@2403@@ -293,6 +293,7 @@
571 2404
572 extern SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen;2405 extern SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen;
@@ -576,8 +2409,8 @@
576 extern SHOW_COMP_OPTION have_crypt;2409 extern SHOW_COMP_OPTION have_crypt;
577 extern SHOW_COMP_OPTION have_compress;2410 extern SHOW_COMP_OPTION have_compress;
578diff -ruN a/sql/sql_parse.cc b/sql/sql_parse.cc2411diff -ruN a/sql/sql_parse.cc b/sql/sql_parse.cc
579--- a/sql/sql_parse.cc 2011-04-09 19:12:10.000000000 +04002412--- a/sql/sql_parse.cc 2011-07-11 04:22:09.007222367 +0300
580+++ b/sql/sql_parse.cc 2011-04-10 11:28:51.000000000 +04002413+++ b/sql/sql_parse.cc 2011-07-11 04:22:26.331345236 +0300
581@@ -88,6 +88,7 @@2414@@ -88,6 +88,7 @@
582 #include "sp_cache.h"2415 #include "sp_cache.h"
583 #include "events.h"2416 #include "events.h"
@@ -586,93 +2419,39 @@
586 #include "transaction.h"2419 #include "transaction.h"
587 #include "sql_audit.h"2420 #include "sql_audit.h"
588 #include "sql_prepare.h"2421 #include "sql_prepare.h"
589@@ -1482,22 +1483,74 @@2422@@ -1502,12 +1503,31 @@
590 Do not log administrative statements unless the appropriate option is2423 DBUG_RETURN(query_exec_time);
591 set.2424 }
592 */2425
593+ #ifdef HAVE_RESPONSE_TIME_DISTRIBUTION2426+void query_response_time_collect_with_check(ulonglong query_exec_time)
594+ if (opt_query_response_time_stats || thd->enable_slow_log)2427+{
595+#else // HAVE_RESPONSE_TIME_DISTRIBUTION2428+ DBUG_ENTER("query_response_time_collect_with_check");
596 if (thd->enable_slow_log)2429+ bool collect= opt_query_response_time_stats;
597+#endif // HAVE_RESPONSE_TIME_DISTRIBUTION2430+ DBUG_EXECUTE_IF("query_exec_time_debug",
598 {2431+ {
599- ulonglong end_utime_of_query= thd->current_utime();2432+ if (0 == query_exec_time)
600- thd_proc_info(thd, "logging slow query");2433+ {
601+ ulonglong end_utime_of_query = thd->current_utime();2434+ collect= false;
602+ ulonglong query_execution_time = end_utime_of_query - thd->utime_after_lock;2435+ }
603+#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION2436+ });
604+2437+ if(collect)
605+#define DBUG_TEST_QRT(t,v) \2438+ {
606+ DBUG_EXECUTE_IF(t, \2439+ query_response_time_collect(query_exec_time);
607+ { \2440+ }
608+ query_execution_time= v; \2441+ DBUG_VOID_RETURN;
609+ DBUG_SET("-d,"t); \2442+}
610+ })2443+
611+2444 void log_slow_statement(THD *thd)
612+ DBUG_EXECUTE_IF("query_exec_time_debug", query_execution_time= 0; );2445 {
613+2446 DBUG_ENTER("log_slow_statement");
614+ DBUG_TEST_QRT("query_exec_time_0.31", 310000UL);2447
615+ DBUG_TEST_QRT("query_exec_time_0.32", 320000UL);2448 ulonglong end_utime_of_query= thd->current_utime();
616+ DBUG_TEST_QRT("query_exec_time_0.33", 330000UL);2449 ulonglong query_exec_time= ::query_exec_time(thd, end_utime_of_query);
617+ DBUG_TEST_QRT("query_exec_time_0.34", 340000UL);2450+ query_response_time_collect_with_check(query_exec_time);
618+ DBUG_TEST_QRT("query_exec_time_0.35", 350000UL);2451
619+ DBUG_TEST_QRT("query_exec_time_0.36", 360000UL);2452 /*
620+ DBUG_TEST_QRT("query_exec_time_0.37", 370000UL);2453 The following should never be true with our current code base,
621+ DBUG_TEST_QRT("query_exec_time_0.38", 380000UL);2454@@ -1689,6 +1709,7 @@
622+ DBUG_TEST_QRT("query_exec_time_0.39", 390000UL);
623+ DBUG_TEST_QRT("query_exec_time_0.4", 400000UL);
624+ DBUG_TEST_QRT("query_exec_time_0.5", 500000UL);
625+ DBUG_TEST_QRT("query_exec_time_1.1", 1100000UL);
626+ DBUG_TEST_QRT("query_exec_time_1.2", 1200000UL);
627+ DBUG_TEST_QRT("query_exec_time_1.3", 1300000UL);
628+ DBUG_TEST_QRT("query_exec_time_1.4", 1400000UL);
629+ DBUG_TEST_QRT("query_exec_time_1.5", 1500000UL);
630+ DBUG_TEST_QRT("query_exec_time_2.1", 2100000UL);
631+ DBUG_TEST_QRT("query_exec_time_2.3", 2300000UL);
632+ DBUG_TEST_QRT("query_exec_time_2.5", 2500000UL);
633+
634+ DBUG_EXECUTE_IF("query_exec_time_debug",
635+ if (query_execution_time == 0)
636+ opt_query_response_time_stats= 0;
637+ else
638+ opt_query_response_time_stats= 1;);
639
640- if (((thd->server_status & SERVER_QUERY_WAS_SLOW) ||
641- ((thd->server_status &
642- (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
643- opt_log_queries_not_using_indexes &&
644- !(sql_command_flags[thd->lex->sql_command] & CF_STATUS_COMMAND))) &&
645- thd->examined_row_count >= thd->variables.min_examined_row_limit)
646+#undef DBUG_TEST_QRT
647+
648+ if(opt_query_response_time_stats)
649+ {
650+ query_response_time_collect(query_execution_time);
651+ }
652+#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
653+ if (thd->enable_slow_log)
654 {
655 thd_proc_info(thd, "logging slow query");
656- thd->status_var.long_query_count++;
657- slow_log_print(thd, thd->query(), thd->query_length(),
658- end_utime_of_query);
659+
660+ if (((thd->server_status & SERVER_QUERY_WAS_SLOW) ||
661+ ((thd->server_status &
662+ (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
663+ opt_log_queries_not_using_indexes &&
664+ !(sql_command_flags[thd->lex->sql_command] & CF_STATUS_COMMAND))) &&
665+ thd->examined_row_count >= thd->variables.min_examined_row_limit)
666+ {
667+ thd_proc_info(thd, "logging slow query");
668+ thd->status_var.long_query_count++;
669+ slow_log_print(thd, thd->query(), thd->query_length(),
670+ end_utime_of_query);
671+ }
672 }
673 }
674 DBUG_VOID_RETURN;
675@@ -1616,6 +1669,7 @@
676 case SCH_CHARSETS:2455 case SCH_CHARSETS:
677 case SCH_ENGINES:2456 case SCH_ENGINES:
678 case SCH_COLLATIONS:2457 case SCH_COLLATIONS:
@@ -681,8 +2460,8 @@
681 case SCH_USER_PRIVILEGES:2460 case SCH_USER_PRIVILEGES:
682 case SCH_SCHEMA_PRIVILEGES:2461 case SCH_SCHEMA_PRIVILEGES:
683diff -ruN a/sql/sql_reload.cc b/sql/sql_reload.cc2462diff -ruN a/sql/sql_reload.cc b/sql/sql_reload.cc
684--- a/sql/sql_reload.cc 2011-03-31 17:36:18.000000000 +04002463--- a/sql/sql_reload.cc 2011-05-11 14:54:12.000000000 +0300
685+++ b/sql/sql_reload.cc 2011-04-10 11:28:51.000000000 +04002464+++ b/sql/sql_reload.cc 2011-07-11 04:22:26.334345257 +0300
686@@ -25,7 +25,7 @@2465@@ -25,7 +25,7 @@
687 #include "hostname.h" // hostname_cache_refresh2466 #include "hostname.h" // hostname_cache_refresh
688 #include "sql_repl.h" // reset_master, reset_slave2467 #include "sql_repl.h" // reset_master, reset_slave
@@ -706,8 +2485,8 @@
706 *write_to_binlog= tmp_write_to_binlog;2485 *write_to_binlog= tmp_write_to_binlog;
707 /*2486 /*
708diff -ruN a/sql/sql_show.cc b/sql/sql_show.cc2487diff -ruN a/sql/sql_show.cc b/sql/sql_show.cc
709--- a/sql/sql_show.cc 2011-04-09 19:12:10.000000000 +04002488--- a/sql/sql_show.cc 2011-07-11 04:22:09.024222488 +0300
710+++ b/sql/sql_show.cc 2011-04-10 11:28:51.000000000 +04002489+++ b/sql/sql_show.cc 2011-07-11 04:22:26.337345279 +0300
711@@ -50,6 +50,7 @@2490@@ -50,6 +50,7 @@
712 #include "event_data_objects.h"2491 #include "event_data_objects.h"
713 #endif2492 #endif
@@ -746,8 +2525,8 @@
746 fill_schema_schemata, make_schemata_old_format, 0, 1, -1, 0, 0},2525 fill_schema_schemata, make_schemata_old_format, 0, 1, -1, 0, 0},
747 {"SCHEMA_PRIVILEGES", schema_privileges_fields_info, create_schema_table,2526 {"SCHEMA_PRIVILEGES", schema_privileges_fields_info, create_schema_table,
748diff -ruN a/sql/sql_yacc.yy b/sql/sql_yacc.yy2527diff -ruN a/sql/sql_yacc.yy b/sql/sql_yacc.yy
749--- a/sql/sql_yacc.yy 2011-04-09 19:11:54.000000000 +04002528--- a/sql/sql_yacc.yy 2011-07-11 04:22:07.953214892 +0300
750+++ b/sql/sql_yacc.yy 2011-04-10 11:28:52.000000000 +04002529+++ b/sql/sql_yacc.yy 2011-07-11 04:22:26.343345322 +0300
751@@ -1193,6 +1193,7 @@2530@@ -1193,6 +1193,7 @@
752 %token PURGE2531 %token PURGE
753 %token QUARTER_SYM2532 %token QUARTER_SYM
@@ -794,8 +2573,8 @@
794 | READ_ONLY_SYM {}2573 | READ_ONLY_SYM {}
795 | REBUILD_SYM {}2574 | REBUILD_SYM {}
796diff -ruN a/sql/sys_vars.cc b/sql/sys_vars.cc2575diff -ruN a/sql/sys_vars.cc b/sql/sys_vars.cc
797--- a/sql/sys_vars.cc 2011-04-09 19:12:11.000000000 +04002576--- a/sql/sys_vars.cc 2011-07-11 04:22:09.056222715 +0300
798+++ b/sql/sys_vars.cc 2011-04-10 11:28:51.000000000 +04002577+++ b/sql/sys_vars.cc 2011-07-11 04:22:26.350345371 +0300
799@@ -49,6 +49,7 @@2578@@ -49,6 +49,7 @@
800 #include "../storage/perfschema/pfs_server.h"2579 #include "../storage/perfschema/pfs_server.h"
801 #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */2580 #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
8022581
=== modified file 'series'
--- series 2011-06-21 13:24:49 +0000
+++ series 2011-07-11 01:29:49 +0000
@@ -1,3 +1,4 @@
1percona_suite.patch
1microsec_process.patch2microsec_process.patch
2optimizer_fix.patch3optimizer_fix.patch
3mysql_dump_ignore_ct.patch4mysql_dump_ignore_ct.patch
45
=== modified file 'show_slave_status_nolock.patch'
--- show_slave_status_nolock.patch 2011-06-16 01:19:11 +0000
+++ show_slave_status_nolock.patch 2011-07-11 01:29:49 +0000
@@ -60,7 +60,7 @@
60 sql_command_flags[SQLCOM_SHOW_CREATE_PROC]= CF_STATUS_COMMAND;60 sql_command_flags[SQLCOM_SHOW_CREATE_PROC]= CF_STATUS_COMMAND;
61 sql_command_flags[SQLCOM_SHOW_CREATE_FUNC]= CF_STATUS_COMMAND;61 sql_command_flags[SQLCOM_SHOW_CREATE_FUNC]= CF_STATUS_COMMAND;
62 sql_command_flags[SQLCOM_SHOW_CREATE_TRIGGER]= CF_STATUS_COMMAND;62 sql_command_flags[SQLCOM_SHOW_CREATE_TRIGGER]= CF_STATUS_COMMAND;
63@@ -2293,12 +2294,16 @@63@@ -2333,12 +2334,16 @@
64 mysql_mutex_unlock(&LOCK_active_mi);64 mysql_mutex_unlock(&LOCK_active_mi);
65 break;65 break;
66 }66 }
@@ -78,7 +78,7 @@
78 if (active_mi != NULL)78 if (active_mi != NULL)
79 {79 {
80 res = show_master_info(thd, active_mi);80 res = show_master_info(thd, active_mi);
81@@ -2309,7 +2314,10 @@81@@ -2349,7 +2354,10 @@
82 WARN_NO_MASTER_INFO, ER(WARN_NO_MASTER_INFO));82 WARN_NO_MASTER_INFO, ER(WARN_NO_MASTER_INFO));
83 my_ok(thd);83 my_ok(thd);
84 }84 }
8585
=== modified file 'slow_extended.patch'
--- slow_extended.patch 2011-06-23 09:08:51 +0000
+++ slow_extended.patch 2011-07-11 01:29:49 +0000
@@ -714,7 +714,9 @@
714diff -ruN a/sql/sql_connect.cc b/sql/sql_connect.cc714diff -ruN a/sql/sql_connect.cc b/sql/sql_connect.cc
715--- a/sql/sql_connect.cc 2011-04-09 18:48:05.000000000 +0400715--- a/sql/sql_connect.cc 2011-04-09 18:48:05.000000000 +0400
716+++ b/sql/sql_connect.cc 2011-04-09 18:48:50.000000000 +0400716+++ b/sql/sql_connect.cc 2011-04-09 18:48:50.000000000 +0400
717@@ -764,4 +764,13 @@717@@ -762,6 +762,15 @@
718 MYSQL_CONNECTION_START(thd->thread_id, &thd->security_ctx->priv_user[0],
719 (char *) thd->security_ctx->host_or_ip);
718 720
719+ /* 721+ /*
720+ If rate limiting of slow log writes is enabled, decide whether to log this 722+ If rate limiting of slow log writes is enabled, decide whether to log this
@@ -731,15 +733,93 @@
731diff -ruN a/sql/sql_parse.cc b/sql/sql_parse.cc733diff -ruN a/sql/sql_parse.cc b/sql/sql_parse.cc
732--- a/sql/sql_parse.cc 2011-04-09 18:48:20.000000000 +0400734--- a/sql/sql_parse.cc 2011-04-09 18:48:20.000000000 +0400
733+++ b/sql/sql_parse.cc 2011-04-09 18:48:50.000000000 +0400735+++ b/sql/sql_parse.cc 2011-04-09 18:48:50.000000000 +0400
734@@ -1430,7 +1430,6 @@736@@ -1430,11 +1430,85 @@
735 DBUG_RETURN(error);737 DBUG_RETURN(error);
736 }738 }
737 739
738-740+ulonglong query_exec_time(THD *thd, ulonglong end_utime_of_query)
741+{
742+ DBUG_ENTER("query_exec_time");
743+ ulonglong utime_after_lock= thd->utime_after_lock;
744+ ulonglong query_exec_time= 0;
745+ if (utime_after_lock < end_utime_of_query)
746+ {
747+ query_exec_time= end_utime_of_query - utime_after_lock;
748+ }
749+
750+#define DBUG_QRT_STR "query_exec_time"
751+#define DBUG_QRT_TEST(t,v) do \
752+ { \
753+ const char* prefix= "/* " DBUG_QRT_STR "= \"" t "\" */"; \
754+ uint32 prefix_length= strlen(prefix); \
755+ uint32 length= \
756+ (prefix_length < query_length \
757+ ? prefix_length : query_length); \
758+ if (0 == strncmp(prefix, query, length)) \
759+ { \
760+ query_exec_time= v; \
761+ } \
762+ DBUG_EXECUTE_IF(DBUG_QRT_STR "_" t, \
763+ { \
764+ query_exec_time= v; \
765+ DBUG_SET("-d," DBUG_QRT_STR "_" t); \
766+ }); \
767+ } \
768+ while(false)
769+
770+ DBUG_EXECUTE_IF(DBUG_QRT_STR "_debug",
771+ {
772+ const char* query= thd->query();
773+ uint32 query_length= thd->query_length();
774+ query_exec_time= 0;
775+ DBUG_QRT_TEST("0.31", 310000UL);
776+ DBUG_QRT_TEST("0.32", 320000UL);
777+ DBUG_QRT_TEST("0.33", 330000UL);
778+ DBUG_QRT_TEST("0.34", 340000UL);
779+ DBUG_QRT_TEST("0.35", 350000UL);
780+ DBUG_QRT_TEST("0.36", 360000UL);
781+ DBUG_QRT_TEST("0.37", 370000UL);
782+ DBUG_QRT_TEST("0.38", 380000UL);
783+ DBUG_QRT_TEST("0.39", 390000UL);
784+ DBUG_QRT_TEST("0.4", 400000UL);
785+ DBUG_QRT_TEST("0.5", 500000UL);
786+ DBUG_QRT_TEST("1.1", 1100000UL);
787+ DBUG_QRT_TEST("1.2", 1200000UL);
788+ DBUG_QRT_TEST("1.3", 1300000UL);
789+ DBUG_QRT_TEST("1.4", 1400000UL);
790+ DBUG_QRT_TEST("1.5", 1500000UL);
791+ DBUG_QRT_TEST("2.1", 2100000UL);
792+ DBUG_QRT_TEST("2.3", 2300000UL);
793+ DBUG_QRT_TEST("2.5", 2500000UL);
794+ DBUG_QRT_TEST("3.1", 3100000UL);
795+ DBUG_QRT_TEST("4.1", 4100000UL);
796+ DBUG_QRT_TEST("5.1", 5100000UL);
797+ });
798+#undef DBUG_QRT_TEST
799+#undef DBUG_QRT_STR
800+ uint server_query_was_slow= SERVER_QUERY_WAS_SLOW;
801+ if (query_exec_time > thd->variables.long_query_time)
802+ {
803+ thd->server_status|= server_query_was_slow;
804+ }
805+ else
806+ {
807+ thd->server_status&= ~server_query_was_slow;
808+ }
809+ DBUG_RETURN(query_exec_time);
810+}
811
739 void log_slow_statement(THD *thd)812 void log_slow_statement(THD *thd)
740 {813 {
741 DBUG_ENTER("log_slow_statement");814 DBUG_ENTER("log_slow_statement");
742@@ -1443,6 +1442,42 @@815
816+ ulonglong end_utime_of_query= thd->current_utime();
817+ ulonglong query_exec_time= ::query_exec_time(thd, end_utime_of_query);
818+
819 /*
820 The following should never be true with our current code base,
821 but better to keep this here so we don't accidently try to log a
822@@ -1443,13 +1513,47 @@
743 if (unlikely(thd->in_sub_stmt))823 if (unlikely(thd->in_sub_stmt))
744 DBUG_VOID_RETURN; // Don't set time for sub stmt824 DBUG_VOID_RETURN; // Don't set time for sub stmt
745 825
@@ -757,7 +837,6 @@
757+ to make an exception and write to slow log anyway.837+ to make an exception and write to slow log anyway.
758+ */838+ */
759+839+
760+ ulonglong end_utime_of_query= thd->current_utime();
761+#define USE_GLOBAL_UPDATE(variable_name,enum_value_name) \840+#define USE_GLOBAL_UPDATE(variable_name,enum_value_name) \
762+ if (opt_slow_query_log_use_global_control & (ULL(1) << enum_value_name)) \841+ if (opt_slow_query_log_use_global_control & (ULL(1) << enum_value_name)) \
763+ { \842+ { \
@@ -775,14 +854,21 @@
775+ /* Do not log this thread's queries due to rate limiting. */854+ /* Do not log this thread's queries due to rate limiting. */
776+ if (thd->write_to_slow_log != TRUE855+ if (thd->write_to_slow_log != TRUE
777+ && (thd->variables.long_query_time >= 1000000856+ && (thd->variables.long_query_time >= 1000000
778+ || (ulong) (end_utime_of_query - thd->utime_after_lock) < 1000000))857+ || (ulong) query_exec_time < 1000000))
779+ DBUG_VOID_RETURN;858+ DBUG_VOID_RETURN;
780+859+
781+860+
782 /*861 /*
783 Do not log administrative statements unless the appropriate option is862 Do not log administrative statements unless the appropriate option is
784 set.863 set.
785@@ -1818,6 +1853,9 @@864 */
865 if (thd->enable_slow_log)
866 {
867- ulonglong end_utime_of_query= thd->current_utime();
868 thd_proc_info(thd, "logging slow query");
869
870 if (((thd->server_status & SERVER_QUERY_WAS_SLOW) ||
871@@ -1818,6 +1922,9 @@
786 context.resolve_in_table_list_only(select_lex->872 context.resolve_in_table_list_only(select_lex->
787 table_list.first);873 table_list.first);
788 874
@@ -792,7 +878,7 @@
792 /*878 /*
793 Reset warning count for each query that uses tables879 Reset warning count for each query that uses tables
794 A better approach would be to reset this for any commands880 A better approach would be to reset this for any commands
795@@ -5252,6 +5290,21 @@881@@ -5252,6 +5359,21 @@
796 thd->rand_used= 0;882 thd->rand_used= 0;
797 thd->sent_row_count= thd->examined_row_count= 0;883 thd->sent_row_count= thd->examined_row_count= 0;
798 884
799885
=== modified file 'userstat.patch'
--- userstat.patch 2011-06-16 01:19:11 +0000
+++ userstat.patch 2011-07-11 01:29:49 +0000
@@ -1816,7 +1816,7 @@
1816 /*1816 /*
1817 Commands which always take a long time are logged into1817 Commands which always take a long time are logged into
1818 the slow log only if opt_log_slow_admin_statements is set.1818 the slow log only if opt_log_slow_admin_statements is set.
1819@@ -1663,6 +1676,13 @@1819@@ -1703,6 +1716,13 @@
1820 thd->profiling.discard_current_query();1820 thd->profiling.discard_current_query();
1821 #endif1821 #endif
1822 break;1822 break;
@@ -1830,7 +1830,7 @@
1830 case SCH_OPEN_TABLES:1830 case SCH_OPEN_TABLES:
1831 case SCH_VARIABLES:1831 case SCH_VARIABLES:
1832 case SCH_STATUS:1832 case SCH_STATUS:
1833@@ -1820,6 +1840,7 @@1833@@ -1860,6 +1880,7 @@
1834 thd->security_ctx->priv_host)) &&1834 thd->security_ctx->priv_host)) &&
1835 check_global_access(thd, SUPER_ACL))1835 check_global_access(thd, SUPER_ACL))
1836 {1836 {
@@ -1838,7 +1838,7 @@
1838 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");1838 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
1839 DBUG_RETURN(TRUE);1839 DBUG_RETURN(TRUE);
1840 }1840 }
1841@@ -4757,6 +4778,7 @@1841@@ -4797,6 +4818,7 @@
1842 case ACL_INTERNAL_ACCESS_DENIED:1842 case ACL_INTERNAL_ACCESS_DENIED:
1843 if (! no_errors)1843 if (! no_errors)
1844 {1844 {
@@ -1846,7 +1846,7 @@
1846 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),1846 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
1847 sctx->priv_user, sctx->priv_host, db);1847 sctx->priv_user, sctx->priv_host, db);
1848 }1848 }
1849@@ -4807,6 +4829,7 @@1849@@ -4847,6 +4869,7 @@
1850 DBUG_PRINT("error",("No possible access"));1850 DBUG_PRINT("error",("No possible access"));
1851 if (!no_errors)1851 if (!no_errors)
1852 {1852 {
@@ -1854,7 +1854,7 @@
1854 if (thd->password == 2)1854 if (thd->password == 2)
1855 my_error(ER_ACCESS_DENIED_NO_PASSWORD_ERROR, MYF(0),1855 my_error(ER_ACCESS_DENIED_NO_PASSWORD_ERROR, MYF(0),
1856 sctx->priv_user,1856 sctx->priv_user,
1857@@ -4923,6 +4946,7 @@1857@@ -4963,6 +4986,7 @@
1858 1858
1859 if (!thd->col_access && check_grant_db(thd, dst_db_name))1859 if (!thd->col_access && check_grant_db(thd, dst_db_name))
1860 {1860 {
@@ -1862,7 +1862,7 @@
1862 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),1862 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
1863 thd->security_ctx->priv_user,1863 thd->security_ctx->priv_user,
1864 thd->security_ctx->priv_host,1864 thd->security_ctx->priv_host,
1865@@ -5193,6 +5217,7 @@1865@@ -5233,6 +5257,7 @@
1866 if ((thd->security_ctx->master_access & want_access))1866 if ((thd->security_ctx->master_access & want_access))
1867 return 0;1867 return 0;
1868 get_privilege_desc(command, sizeof(command), want_access);1868 get_privilege_desc(command, sizeof(command), want_access);
@@ -1870,7 +1870,7 @@
1870 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command);1870 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command);
1871 return 1;1871 return 1;
1872 #else1872 #else
1873@@ -5574,6 +5599,32 @@1873@@ -5614,6 +5639,32 @@
1874 lex_start(thd);1874 lex_start(thd);
1875 mysql_reset_thd_for_next_command(thd);1875 mysql_reset_thd_for_next_command(thd);
1876 1876
@@ -1903,7 +1903,7 @@
1903 if (query_cache_send_result_to_client(thd, rawbuf, length) <= 0)1903 if (query_cache_send_result_to_client(thd, rawbuf, length) <= 0)
1904 {1904 {
1905 LEX *lex= thd->lex;1905 LEX *lex= thd->lex;
1906@@ -5642,6 +5693,52 @@1906@@ -5682,6 +5733,52 @@
1907 DBUG_ASSERT(thd->change_list.is_empty());1907 DBUG_ASSERT(thd->change_list.is_empty());
1908 }1908 }
1909 1909

Subscribers

People subscribed via source and target branches