]> git.pld-linux.org Git - packages/mysql.git/blob - response_time_distribution.patch
- rel 3; update percona patches
[packages/mysql.git] / response_time_distribution.patch
1 # name       : response-time-distribution.patch
2 # introduced : 12
3 # maintainer : Oleg
4 #
5 #!!! notice !!!
6 # Any small change to this file in the main branch
7 # should be done or reviewed by the maintainer!
8 --- a/CMakeLists.txt
9 +++ b/CMakeLists.txt
10 @@ -165,7 +165,12 @@
11  OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON)
12  MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED)
13  
14
15 +OPTION(WITHOUT_RESPONSE_TIME_DISTRIBUTION "If we want to have response_time_distribution" OFF)
16 +IF(WITHOUT_RESPONSE_TIME_DISTRIBUTION)
17 +ELSE()
18 +ADD_DEFINITIONS(-DHAVE_RESPONSE_TIME_DISTRIBUTION)
19 +ENDIF()
20 +                                                                                                                                                              
21  OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON) 
22  IF(ENABLE_DEBUG_SYNC) 
23    SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") 
24 --- a/include/mysql_com.h
25 +++ b/include/mysql_com.h
26 @@ -141,10 +141,11 @@
27  #define REFRESH_FAST           32768   /* Intern flag */
28  
29  /* RESET (remove all queries) from query cache */
30 -#define REFRESH_QUERY_CACHE    65536
31 -#define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */
32 -#define REFRESH_DES_KEY_FILE   0x40000L
33 -#define REFRESH_USER_RESOURCES 0x80000L
34 +#define REFRESH_QUERY_CACHE         65536
35 +#define REFRESH_QUERY_CACHE_FREE    0x20000L /* pack query cache */
36 +#define REFRESH_DES_KEY_FILE        0x40000L
37 +#define REFRESH_USER_RESOURCES      0x80000L
38 +#define REFRESH_QUERY_RESPONSE_TIME 0x100000L /* response time distibution */
39  
40  #define CLIENT_LONG_PASSWORD   1       /* new more secure passwords */
41  #define CLIENT_FOUND_ROWS      2       /* Found instead of affected rows */
42 --- /dev/null
43 +++ b/mysql-test/include/have_response_time_distribution.inc
44 @@ -0,0 +1,4 @@
45 +-- require r/have_response_time_distribution.require
46 +disable_query_log;
47 +show variables like 'have_response_time_distribution';
48 +enable_query_log;
49 --- /dev/null
50 +++ b/mysql-test/include/query_response_time.inc
51 @@ -0,0 +1,39 @@
52 +SET SESSION query_exec_time=0.1;
53 +
54 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
55 +EVAL SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=$base;
56 +FLUSH QUERY_RESPONSE_TIME;
57 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
58 +
59 +SET SESSION query_exec_time=0.31; SELECT 1;
60 +SET SESSION query_exec_time=0.32; SELECT 1;
61 +SET SESSION query_exec_time=0.33; SELECT 1;
62 +SET SESSION query_exec_time=0.34; SELECT 1;
63 +SET SESSION query_exec_time=0.35; SELECT 1;
64 +SET SESSION query_exec_time=0.36; SELECT 1;
65 +SET SESSION query_exec_time=0.37; SELECT 1;
66 +SET SESSION query_exec_time=0.38; SELECT 1;
67 +SET SESSION query_exec_time=0.39; SELECT 1;
68 +SET SESSION query_exec_time=0.4; SELECT 1;
69 +SET SESSION query_exec_time=1.1; SELECT 1;
70 +SET SESSION query_exec_time=1.2; SELECT 1;
71 +SET SESSION query_exec_time=1.3; SELECT 1;
72 +SET SESSION query_exec_time=1.5; SELECT 1;
73 +SET SESSION query_exec_time=1.4; SELECT 1;
74 +SET SESSION query_exec_time=0.5; SELECT 1;
75 +SET SESSION query_exec_time=2.1; SELECT 1;
76 +SET SESSION query_exec_time=2.3; SELECT 1;
77 +SET SESSION query_exec_time=2.5; SELECT 1;
78 +SET SESSION query_exec_time=3.1; SELECT 1;
79 +SET SESSION query_exec_time=4.1; SELECT 1;
80 +SET SESSION query_exec_time=5.1; SELECT 1;
81 +
82 +SET SESSION query_exec_time=0.1;
83 +
84 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
85 +
86 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
87 +SHOW QUERY_RESPONSE_TIME;
88 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
89 +
90 +SET SESSION query_exec_time=default;
91 --- /dev/null
92 +++ b/mysql-test/include/query_response_time-replication.inc
93 @@ -0,0 +1,57 @@
94 +connection master;
95 +
96 +CREATE TABLE t(id INT);
97 +
98 +connection slave;
99 +SET GLOBAL query_exec_time = 0.1;
100 +--source include/restart_slave_sql.inc
101 +
102 +connection slave;
103 +
104 +SET SESSION query_exec_time=0.1;
105 +
106 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
107 +--eval SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=$base
108 +FLUSH QUERY_RESPONSE_TIME;
109 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
110 +
111 +connection master;
112 +
113 +SET SESSION query_exec_time = 0.31; INSERT INTO t VALUES(1);
114 +SET SESSION query_exec_time = 0.32; INSERT INTO t VALUES(1);
115 +SET SESSION query_exec_time = 0.33; INSERT INTO t VALUES(1);
116 +SET SESSION query_exec_time = 0.34; INSERT INTO t VALUES(1);
117 +SET SESSION query_exec_time = 0.35; INSERT INTO t VALUES(1);
118 +SET SESSION query_exec_time = 0.36; INSERT INTO t VALUES(1);
119 +SET SESSION query_exec_time = 0.37; INSERT INTO t VALUES(1);
120 +SET SESSION query_exec_time = 0.38; INSERT INTO t VALUES(1);
121 +SET SESSION query_exec_time = 0.39; INSERT INTO t VALUES(1);
122 +SET SESSION query_exec_time = 0.4; INSERT INTO t VALUES(1);
123 +SET SESSION query_exec_time = 1.1; INSERT INTO t VALUES(1);
124 +SET SESSION query_exec_time = 1.2; INSERT INTO t VALUES(1);
125 +SET SESSION query_exec_time = 1.3; INSERT INTO t VALUES(1);
126 +SET SESSION query_exec_time = 1.5; INSERT INTO t VALUES(1);
127 +SET SESSION query_exec_time = 1.4; INSERT INTO t VALUES(1);
128 +SET SESSION query_exec_time = 0.5; INSERT INTO t VALUES(1);
129 +SET SESSION query_exec_time = 2.1; INSERT INTO t VALUES(1);
130 +SET SESSION query_exec_time = 2.3; INSERT INTO t VALUES(1);
131 +SET SESSION query_exec_time = 2.5; INSERT INTO t VALUES(1);
132 +SET SESSION query_exec_time = 3.1; INSERT INTO t VALUES(1);
133 +SET SESSION query_exec_time = 4.1; INSERT INTO t VALUES(1);
134 +SET SESSION query_exec_time = 5.1; INSERT INTO t VALUES(1);
135 +
136 +sync_slave_with_master;
137 +
138 +connection slave;
139 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
140 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
141 +SHOW QUERY_RESPONSE_TIME;
142 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
143 +
144 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
145 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
146 +
147 +connection master;
148 +DROP TABLE t;
149 +
150 +sync_slave_with_master;
151 --- /dev/null
152 +++ b/mysql-test/include/query_response_time-stored.inc
153 @@ -0,0 +1,37 @@
154 +SET SESSION query_exec_time=0.1;
155 +
156 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
157 +EVAL SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=$base;
158 +FLUSH QUERY_RESPONSE_TIME;
159 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
160 +
161 +CALL test_f(0.31);
162 +CALL test_f(0.32);
163 +CALL test_f(0.33);
164 +CALL test_f(0.34);
165 +CALL test_f(0.35);
166 +CALL test_f(0.36);
167 +CALL test_f(0.37);
168 +CALL test_f(0.38);
169 +CALL test_f(0.39);
170 +CALL test_f(0.4);
171 +CALL test_f(1.1);
172 +CALL test_f(1.2);
173 +CALL test_f(1.3);
174 +CALL test_f(1.5);
175 +CALL test_f(1.4);
176 +CALL test_f(0.5);
177 +CALL test_f(2.1);
178 +CALL test_f(2.3);
179 +CALL test_f(2.5);
180 +CALL test_f(3.1);
181 +CALL test_f(4.1);
182 +CALL test_f(5.1);
183 +
184 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
185 +
186 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
187 +SHOW QUERY_RESPONSE_TIME;
188 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
189 +
190 +SET SESSION query_exec_time=default;
191 --- /dev/null
192 +++ b/mysql-test/r/percona_query_response_time-replication.result
193 @@ -0,0 +1,727 @@
194 +SET GLOBAL query_exec_time=0.1;
195 +include/master-slave.inc
196 +[connection master]
197 +CREATE TABLE t(id INT);
198 +SET GLOBAL query_exec_time = 0.1;
199 +include/restart_slave.inc
200 +SET SESSION query_exec_time=0.1;
201 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
202 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
203 +Warnings:
204 +Warning        1292    Truncated incorrect query_response_time_range_base value: '1'
205 +FLUSH QUERY_RESPONSE_TIME;
206 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
207 +SET SESSION query_exec_time = 0.31;
208 +INSERT INTO t VALUES(1);
209 +SET SESSION query_exec_time = 0.32;
210 +INSERT INTO t VALUES(1);
211 +SET SESSION query_exec_time = 0.33;
212 +INSERT INTO t VALUES(1);
213 +SET SESSION query_exec_time = 0.34;
214 +INSERT INTO t VALUES(1);
215 +SET SESSION query_exec_time = 0.35;
216 +INSERT INTO t VALUES(1);
217 +SET SESSION query_exec_time = 0.36;
218 +INSERT INTO t VALUES(1);
219 +SET SESSION query_exec_time = 0.37;
220 +INSERT INTO t VALUES(1);
221 +SET SESSION query_exec_time = 0.38;
222 +INSERT INTO t VALUES(1);
223 +SET SESSION query_exec_time = 0.39;
224 +INSERT INTO t VALUES(1);
225 +SET SESSION query_exec_time = 0.4;
226 +INSERT INTO t VALUES(1);
227 +SET SESSION query_exec_time = 1.1;
228 +INSERT INTO t VALUES(1);
229 +SET SESSION query_exec_time = 1.2;
230 +INSERT INTO t VALUES(1);
231 +SET SESSION query_exec_time = 1.3;
232 +INSERT INTO t VALUES(1);
233 +SET SESSION query_exec_time = 1.5;
234 +INSERT INTO t VALUES(1);
235 +SET SESSION query_exec_time = 1.4;
236 +INSERT INTO t VALUES(1);
237 +SET SESSION query_exec_time = 0.5;
238 +INSERT INTO t VALUES(1);
239 +SET SESSION query_exec_time = 2.1;
240 +INSERT INTO t VALUES(1);
241 +SET SESSION query_exec_time = 2.3;
242 +INSERT INTO t VALUES(1);
243 +SET SESSION query_exec_time = 2.5;
244 +INSERT INTO t VALUES(1);
245 +SET SESSION query_exec_time = 3.1;
246 +INSERT INTO t VALUES(1);
247 +SET SESSION query_exec_time = 4.1;
248 +INSERT INTO t VALUES(1);
249 +SET SESSION query_exec_time = 5.1;
250 +INSERT INTO t VALUES(1);
251 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
252 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
253 +Variable_name  Value
254 +query_response_time_range_base 2
255 +SHOW QUERY_RESPONSE_TIME;
256 +               
257 +      0.000001 2             0.000000
258 +      0.000003 0             0.000000
259 +      0.000007 0             0.000000
260 +      0.000015 0             0.000000
261 +      0.000030 0             0.000000
262 +      0.000061 0             0.000000
263 +      0.000122 0             0.000000
264 +      0.000244 0             0.000000
265 +      0.000488 0             0.000000
266 +      0.000976 0             0.000000
267 +      0.001953 0             0.000000
268 +      0.003906 0             0.000000
269 +      0.007812 0             0.000000
270 +      0.015625 0             0.000000
271 +      0.031250 0             0.000000
272 +      0.062500 0             0.000000
273 +      0.125000 3             0.300000
274 +      0.250000 0             0.000000
275 +      0.500000 30           10.650000
276 +      1.000000 3             1.500000
277 +      2.000000 15           19.500000
278 +      4.000000 12           30.000000
279 +      8.000000 6            27.599997
280 +     16.000000 0             0.000000
281 +     32.000000 0             0.000000
282 +     64.000000 0             0.000000
283 +    128.000000 0             0.000000
284 +    256.000000 0             0.000000
285 +    512.000000 0             0.000000
286 +   1024.000000 0             0.000000
287 +   2048.000000 0             0.000000
288 +   4096.000000 0             0.000000
289 +   8192.000000 0             0.000000
290 +  16384.000000 0             0.000000
291 +  32768.000000 0             0.000000
292 +  65536.000000 0             0.000000
293 + 131072.000000 0             0.000000
294 + 262144.000000 0             0.000000
295 + 524288.000000 0             0.000000
296 + 1048576.00000 0             0.000000
297 + 2097152.00000 0             0.000000
298 + 4194304.00000 0             0.000000
299 + 8388608.00000 0             0.000000
300 +TOO LONG       0       TOO LONG
301 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
302 +time   count   total
303 +      0.000001 2             0.000000
304 +      0.000003 0             0.000000
305 +      0.000007 0             0.000000
306 +      0.000015 0             0.000000
307 +      0.000030 0             0.000000
308 +      0.000061 0             0.000000
309 +      0.000122 0             0.000000
310 +      0.000244 0             0.000000
311 +      0.000488 0             0.000000
312 +      0.000976 0             0.000000
313 +      0.001953 0             0.000000
314 +      0.003906 0             0.000000
315 +      0.007812 0             0.000000
316 +      0.015625 0             0.000000
317 +      0.031250 0             0.000000
318 +      0.062500 0             0.000000
319 +      0.125000 4             0.400000
320 +      0.250000 0             0.000000
321 +      0.500000 30           10.650000
322 +      1.000000 3             1.500000
323 +      2.000000 15           19.500000
324 +      4.000000 12           30.000000
325 +      8.000000 6            27.599997
326 +     16.000000 0             0.000000
327 +     32.000000 0             0.000000
328 +     64.000000 0             0.000000
329 +    128.000000 0             0.000000
330 +    256.000000 0             0.000000
331 +    512.000000 0             0.000000
332 +   1024.000000 0             0.000000
333 +   2048.000000 0             0.000000
334 +   4096.000000 0             0.000000
335 +   8192.000000 0             0.000000
336 +  16384.000000 0             0.000000
337 +  32768.000000 0             0.000000
338 +  65536.000000 0             0.000000
339 + 131072.000000 0             0.000000
340 + 262144.000000 0             0.000000
341 + 524288.000000 0             0.000000
342 + 1048576.00000 0             0.000000
343 + 2097152.00000 0             0.000000
344 + 4194304.00000 0             0.000000
345 + 8388608.00000 0             0.000000
346 +TOO LONG       0       TOO LONG
347 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
348 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
349 +DROP TABLE t;
350 +CREATE TABLE t(id INT);
351 +SET GLOBAL query_exec_time = 0.1;
352 +include/restart_slave.inc
353 +SET SESSION query_exec_time=0.1;
354 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
355 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
356 +FLUSH QUERY_RESPONSE_TIME;
357 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
358 +SET SESSION query_exec_time = 0.31;
359 +INSERT INTO t VALUES(1);
360 +SET SESSION query_exec_time = 0.32;
361 +INSERT INTO t VALUES(1);
362 +SET SESSION query_exec_time = 0.33;
363 +INSERT INTO t VALUES(1);
364 +SET SESSION query_exec_time = 0.34;
365 +INSERT INTO t VALUES(1);
366 +SET SESSION query_exec_time = 0.35;
367 +INSERT INTO t VALUES(1);
368 +SET SESSION query_exec_time = 0.36;
369 +INSERT INTO t VALUES(1);
370 +SET SESSION query_exec_time = 0.37;
371 +INSERT INTO t VALUES(1);
372 +SET SESSION query_exec_time = 0.38;
373 +INSERT INTO t VALUES(1);
374 +SET SESSION query_exec_time = 0.39;
375 +INSERT INTO t VALUES(1);
376 +SET SESSION query_exec_time = 0.4;
377 +INSERT INTO t VALUES(1);
378 +SET SESSION query_exec_time = 1.1;
379 +INSERT INTO t VALUES(1);
380 +SET SESSION query_exec_time = 1.2;
381 +INSERT INTO t VALUES(1);
382 +SET SESSION query_exec_time = 1.3;
383 +INSERT INTO t VALUES(1);
384 +SET SESSION query_exec_time = 1.5;
385 +INSERT INTO t VALUES(1);
386 +SET SESSION query_exec_time = 1.4;
387 +INSERT INTO t VALUES(1);
388 +SET SESSION query_exec_time = 0.5;
389 +INSERT INTO t VALUES(1);
390 +SET SESSION query_exec_time = 2.1;
391 +INSERT INTO t VALUES(1);
392 +SET SESSION query_exec_time = 2.3;
393 +INSERT INTO t VALUES(1);
394 +SET SESSION query_exec_time = 2.5;
395 +INSERT INTO t VALUES(1);
396 +SET SESSION query_exec_time = 3.1;
397 +INSERT INTO t VALUES(1);
398 +SET SESSION query_exec_time = 4.1;
399 +INSERT INTO t VALUES(1);
400 +SET SESSION query_exec_time = 5.1;
401 +INSERT INTO t VALUES(1);
402 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
403 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
404 +Variable_name  Value
405 +query_response_time_range_base 2
406 +SHOW QUERY_RESPONSE_TIME;
407 +               
408 +      0.000001 2             0.000000
409 +      0.000003 0             0.000000
410 +      0.000007 0             0.000000
411 +      0.000015 0             0.000000
412 +      0.000030 0             0.000000
413 +      0.000061 0             0.000000
414 +      0.000122 0             0.000000
415 +      0.000244 0             0.000000
416 +      0.000488 0             0.000000
417 +      0.000976 0             0.000000
418 +      0.001953 0             0.000000
419 +      0.003906 0             0.000000
420 +      0.007812 0             0.000000
421 +      0.015625 0             0.000000
422 +      0.031250 0             0.000000
423 +      0.062500 0             0.000000
424 +      0.125000 3             0.300000
425 +      0.250000 0             0.000000
426 +      0.500000 30           10.650000
427 +      1.000000 3             1.500000
428 +      2.000000 15           19.500000
429 +      4.000000 12           30.000000
430 +      8.000000 6            27.599997
431 +     16.000000 0             0.000000
432 +     32.000000 0             0.000000
433 +     64.000000 0             0.000000
434 +    128.000000 0             0.000000
435 +    256.000000 0             0.000000
436 +    512.000000 0             0.000000
437 +   1024.000000 0             0.000000
438 +   2048.000000 0             0.000000
439 +   4096.000000 0             0.000000
440 +   8192.000000 0             0.000000
441 +  16384.000000 0             0.000000
442 +  32768.000000 0             0.000000
443 +  65536.000000 0             0.000000
444 + 131072.000000 0             0.000000
445 + 262144.000000 0             0.000000
446 + 524288.000000 0             0.000000
447 + 1048576.00000 0             0.000000
448 + 2097152.00000 0             0.000000
449 + 4194304.00000 0             0.000000
450 + 8388608.00000 0             0.000000
451 +TOO LONG       0       TOO LONG
452 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
453 +time   count   total
454 +      0.000001 2             0.000000
455 +      0.000003 0             0.000000
456 +      0.000007 0             0.000000
457 +      0.000015 0             0.000000
458 +      0.000030 0             0.000000
459 +      0.000061 0             0.000000
460 +      0.000122 0             0.000000
461 +      0.000244 0             0.000000
462 +      0.000488 0             0.000000
463 +      0.000976 0             0.000000
464 +      0.001953 0             0.000000
465 +      0.003906 0             0.000000
466 +      0.007812 0             0.000000
467 +      0.015625 0             0.000000
468 +      0.031250 0             0.000000
469 +      0.062500 0             0.000000
470 +      0.125000 4             0.400000
471 +      0.250000 0             0.000000
472 +      0.500000 30           10.650000
473 +      1.000000 3             1.500000
474 +      2.000000 15           19.500000
475 +      4.000000 12           30.000000
476 +      8.000000 6            27.599997
477 +     16.000000 0             0.000000
478 +     32.000000 0             0.000000
479 +     64.000000 0             0.000000
480 +    128.000000 0             0.000000
481 +    256.000000 0             0.000000
482 +    512.000000 0             0.000000
483 +   1024.000000 0             0.000000
484 +   2048.000000 0             0.000000
485 +   4096.000000 0             0.000000
486 +   8192.000000 0             0.000000
487 +  16384.000000 0             0.000000
488 +  32768.000000 0             0.000000
489 +  65536.000000 0             0.000000
490 + 131072.000000 0             0.000000
491 + 262144.000000 0             0.000000
492 + 524288.000000 0             0.000000
493 + 1048576.00000 0             0.000000
494 + 2097152.00000 0             0.000000
495 + 4194304.00000 0             0.000000
496 + 8388608.00000 0             0.000000
497 +TOO LONG       0       TOO LONG
498 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
499 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
500 +DROP TABLE t;
501 +CREATE TABLE t(id INT);
502 +SET GLOBAL query_exec_time = 0.1;
503 +include/restart_slave.inc
504 +SET SESSION query_exec_time=0.1;
505 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
506 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
507 +FLUSH QUERY_RESPONSE_TIME;
508 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
509 +SET SESSION query_exec_time = 0.31;
510 +INSERT INTO t VALUES(1);
511 +SET SESSION query_exec_time = 0.32;
512 +INSERT INTO t VALUES(1);
513 +SET SESSION query_exec_time = 0.33;
514 +INSERT INTO t VALUES(1);
515 +SET SESSION query_exec_time = 0.34;
516 +INSERT INTO t VALUES(1);
517 +SET SESSION query_exec_time = 0.35;
518 +INSERT INTO t VALUES(1);
519 +SET SESSION query_exec_time = 0.36;
520 +INSERT INTO t VALUES(1);
521 +SET SESSION query_exec_time = 0.37;
522 +INSERT INTO t VALUES(1);
523 +SET SESSION query_exec_time = 0.38;
524 +INSERT INTO t VALUES(1);
525 +SET SESSION query_exec_time = 0.39;
526 +INSERT INTO t VALUES(1);
527 +SET SESSION query_exec_time = 0.4;
528 +INSERT INTO t VALUES(1);
529 +SET SESSION query_exec_time = 1.1;
530 +INSERT INTO t VALUES(1);
531 +SET SESSION query_exec_time = 1.2;
532 +INSERT INTO t VALUES(1);
533 +SET SESSION query_exec_time = 1.3;
534 +INSERT INTO t VALUES(1);
535 +SET SESSION query_exec_time = 1.5;
536 +INSERT INTO t VALUES(1);
537 +SET SESSION query_exec_time = 1.4;
538 +INSERT INTO t VALUES(1);
539 +SET SESSION query_exec_time = 0.5;
540 +INSERT INTO t VALUES(1);
541 +SET SESSION query_exec_time = 2.1;
542 +INSERT INTO t VALUES(1);
543 +SET SESSION query_exec_time = 2.3;
544 +INSERT INTO t VALUES(1);
545 +SET SESSION query_exec_time = 2.5;
546 +INSERT INTO t VALUES(1);
547 +SET SESSION query_exec_time = 3.1;
548 +INSERT INTO t VALUES(1);
549 +SET SESSION query_exec_time = 4.1;
550 +INSERT INTO t VALUES(1);
551 +SET SESSION query_exec_time = 5.1;
552 +INSERT INTO t VALUES(1);
553 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
554 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
555 +Variable_name  Value
556 +query_response_time_range_base 10
557 +SHOW QUERY_RESPONSE_TIME;
558 +               
559 +      0.000001 2             0.000000
560 +      0.000010 0             0.000000
561 +      0.000100 0             0.000000
562 +      0.001000 0             0.000000
563 +      0.010000 0             0.000000
564 +      0.100000 0             0.000000
565 +      1.000000 36           12.450000
566 +     10.000000 33           77.099997
567 +    100.000000 0             0.000000
568 +   1000.000000 0             0.000000
569 +  10000.000000 0             0.000000
570 + 100000.000000 0             0.000000
571 + 1000000.00000 0             0.000000
572 +TOO LONG       0       TOO LONG
573 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
574 +time   count   total
575 +      0.000001 2             0.000000
576 +      0.000010 0             0.000000
577 +      0.000100 0             0.000000
578 +      0.001000 0             0.000000
579 +      0.010000 0             0.000000
580 +      0.100000 0             0.000000
581 +      1.000000 37           12.550000
582 +     10.000000 33           77.099997
583 +    100.000000 0             0.000000
584 +   1000.000000 0             0.000000
585 +  10000.000000 0             0.000000
586 + 100000.000000 0             0.000000
587 + 1000000.00000 0             0.000000
588 +TOO LONG       0       TOO LONG
589 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
590 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
591 +DROP TABLE t;
592 +CREATE TABLE t(id INT);
593 +SET GLOBAL query_exec_time = 0.1;
594 +include/restart_slave.inc
595 +SET SESSION query_exec_time=0.1;
596 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
597 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
598 +FLUSH QUERY_RESPONSE_TIME;
599 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
600 +SET SESSION query_exec_time = 0.31;
601 +INSERT INTO t VALUES(1);
602 +SET SESSION query_exec_time = 0.32;
603 +INSERT INTO t VALUES(1);
604 +SET SESSION query_exec_time = 0.33;
605 +INSERT INTO t VALUES(1);
606 +SET SESSION query_exec_time = 0.34;
607 +INSERT INTO t VALUES(1);
608 +SET SESSION query_exec_time = 0.35;
609 +INSERT INTO t VALUES(1);
610 +SET SESSION query_exec_time = 0.36;
611 +INSERT INTO t VALUES(1);
612 +SET SESSION query_exec_time = 0.37;
613 +INSERT INTO t VALUES(1);
614 +SET SESSION query_exec_time = 0.38;
615 +INSERT INTO t VALUES(1);
616 +SET SESSION query_exec_time = 0.39;
617 +INSERT INTO t VALUES(1);
618 +SET SESSION query_exec_time = 0.4;
619 +INSERT INTO t VALUES(1);
620 +SET SESSION query_exec_time = 1.1;
621 +INSERT INTO t VALUES(1);
622 +SET SESSION query_exec_time = 1.2;
623 +INSERT INTO t VALUES(1);
624 +SET SESSION query_exec_time = 1.3;
625 +INSERT INTO t VALUES(1);
626 +SET SESSION query_exec_time = 1.5;
627 +INSERT INTO t VALUES(1);
628 +SET SESSION query_exec_time = 1.4;
629 +INSERT INTO t VALUES(1);
630 +SET SESSION query_exec_time = 0.5;
631 +INSERT INTO t VALUES(1);
632 +SET SESSION query_exec_time = 2.1;
633 +INSERT INTO t VALUES(1);
634 +SET SESSION query_exec_time = 2.3;
635 +INSERT INTO t VALUES(1);
636 +SET SESSION query_exec_time = 2.5;
637 +INSERT INTO t VALUES(1);
638 +SET SESSION query_exec_time = 3.1;
639 +INSERT INTO t VALUES(1);
640 +SET SESSION query_exec_time = 4.1;
641 +INSERT INTO t VALUES(1);
642 +SET SESSION query_exec_time = 5.1;
643 +INSERT INTO t VALUES(1);
644 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
645 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
646 +Variable_name  Value
647 +query_response_time_range_base 7
648 +SHOW QUERY_RESPONSE_TIME;
649 +               
650 +      0.000001 2             0.000000
651 +      0.000008 0             0.000000
652 +      0.000059 0             0.000000
653 +      0.000416 0             0.000000
654 +      0.002915 0             0.000000
655 +      0.020408 0             0.000000
656 +      0.142857 3             0.300000
657 +      1.000000 33           12.150000
658 +      7.000000 33           77.099997
659 +     49.000000 0             0.000000
660 +    343.000000 0             0.000000
661 +   2401.000000 0             0.000000
662 +  16807.000000 0             0.000000
663 + 117649.000000 0             0.000000
664 + 823543.000000 0             0.000000
665 + 5764801.00000 0             0.000000
666 +TOO LONG       0       TOO LONG
667 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
668 +time   count   total
669 +      0.000001 2             0.000000
670 +      0.000008 0             0.000000
671 +      0.000059 0             0.000000
672 +      0.000416 0             0.000000
673 +      0.002915 0             0.000000
674 +      0.020408 0             0.000000
675 +      0.142857 4             0.400000
676 +      1.000000 33           12.150000
677 +      7.000000 33           77.099997
678 +     49.000000 0             0.000000
679 +    343.000000 0             0.000000
680 +   2401.000000 0             0.000000
681 +  16807.000000 0             0.000000
682 + 117649.000000 0             0.000000
683 + 823543.000000 0             0.000000
684 + 5764801.00000 0             0.000000
685 +TOO LONG       0       TOO LONG
686 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
687 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
688 +DROP TABLE t;
689 +CREATE TABLE t(id INT);
690 +SET GLOBAL query_exec_time = 0.1;
691 +include/restart_slave.inc
692 +SET SESSION query_exec_time=0.1;
693 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
694 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
695 +FLUSH QUERY_RESPONSE_TIME;
696 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
697 +SET SESSION query_exec_time = 0.31;
698 +INSERT INTO t VALUES(1);
699 +SET SESSION query_exec_time = 0.32;
700 +INSERT INTO t VALUES(1);
701 +SET SESSION query_exec_time = 0.33;
702 +INSERT INTO t VALUES(1);
703 +SET SESSION query_exec_time = 0.34;
704 +INSERT INTO t VALUES(1);
705 +SET SESSION query_exec_time = 0.35;
706 +INSERT INTO t VALUES(1);
707 +SET SESSION query_exec_time = 0.36;
708 +INSERT INTO t VALUES(1);
709 +SET SESSION query_exec_time = 0.37;
710 +INSERT INTO t VALUES(1);
711 +SET SESSION query_exec_time = 0.38;
712 +INSERT INTO t VALUES(1);
713 +SET SESSION query_exec_time = 0.39;
714 +INSERT INTO t VALUES(1);
715 +SET SESSION query_exec_time = 0.4;
716 +INSERT INTO t VALUES(1);
717 +SET SESSION query_exec_time = 1.1;
718 +INSERT INTO t VALUES(1);
719 +SET SESSION query_exec_time = 1.2;
720 +INSERT INTO t VALUES(1);
721 +SET SESSION query_exec_time = 1.3;
722 +INSERT INTO t VALUES(1);
723 +SET SESSION query_exec_time = 1.5;
724 +INSERT INTO t VALUES(1);
725 +SET SESSION query_exec_time = 1.4;
726 +INSERT INTO t VALUES(1);
727 +SET SESSION query_exec_time = 0.5;
728 +INSERT INTO t VALUES(1);
729 +SET SESSION query_exec_time = 2.1;
730 +INSERT INTO t VALUES(1);
731 +SET SESSION query_exec_time = 2.3;
732 +INSERT INTO t VALUES(1);
733 +SET SESSION query_exec_time = 2.5;
734 +INSERT INTO t VALUES(1);
735 +SET SESSION query_exec_time = 3.1;
736 +INSERT INTO t VALUES(1);
737 +SET SESSION query_exec_time = 4.1;
738 +INSERT INTO t VALUES(1);
739 +SET SESSION query_exec_time = 5.1;
740 +INSERT INTO t VALUES(1);
741 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
742 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
743 +Variable_name  Value
744 +query_response_time_range_base 156
745 +SHOW QUERY_RESPONSE_TIME;
746 +               
747 +      0.000041 2             0.000000
748 +      0.006410 0             0.000000
749 +      1.000000 36           12.450000
750 +    156.000000 33           77.099997
751 +  24336.000000 0             0.000000
752 + 3796416.00000 0             0.000000
753 +TOO LONG       0       TOO LONG
754 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
755 +time   count   total
756 +      0.000041 2             0.000000
757 +      0.006410 0             0.000000
758 +      1.000000 37           12.550000
759 +    156.000000 33           77.099997
760 +  24336.000000 0             0.000000
761 + 3796416.00000 0             0.000000
762 +TOO LONG       0       TOO LONG
763 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
764 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
765 +DROP TABLE t;
766 +CREATE TABLE t(id INT);
767 +SET GLOBAL query_exec_time = 0.1;
768 +include/restart_slave.inc
769 +SET SESSION query_exec_time=0.1;
770 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
771 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
772 +FLUSH QUERY_RESPONSE_TIME;
773 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
774 +SET SESSION query_exec_time = 0.31;
775 +INSERT INTO t VALUES(1);
776 +SET SESSION query_exec_time = 0.32;
777 +INSERT INTO t VALUES(1);
778 +SET SESSION query_exec_time = 0.33;
779 +INSERT INTO t VALUES(1);
780 +SET SESSION query_exec_time = 0.34;
781 +INSERT INTO t VALUES(1);
782 +SET SESSION query_exec_time = 0.35;
783 +INSERT INTO t VALUES(1);
784 +SET SESSION query_exec_time = 0.36;
785 +INSERT INTO t VALUES(1);
786 +SET SESSION query_exec_time = 0.37;
787 +INSERT INTO t VALUES(1);
788 +SET SESSION query_exec_time = 0.38;
789 +INSERT INTO t VALUES(1);
790 +SET SESSION query_exec_time = 0.39;
791 +INSERT INTO t VALUES(1);
792 +SET SESSION query_exec_time = 0.4;
793 +INSERT INTO t VALUES(1);
794 +SET SESSION query_exec_time = 1.1;
795 +INSERT INTO t VALUES(1);
796 +SET SESSION query_exec_time = 1.2;
797 +INSERT INTO t VALUES(1);
798 +SET SESSION query_exec_time = 1.3;
799 +INSERT INTO t VALUES(1);
800 +SET SESSION query_exec_time = 1.5;
801 +INSERT INTO t VALUES(1);
802 +SET SESSION query_exec_time = 1.4;
803 +INSERT INTO t VALUES(1);
804 +SET SESSION query_exec_time = 0.5;
805 +INSERT INTO t VALUES(1);
806 +SET SESSION query_exec_time = 2.1;
807 +INSERT INTO t VALUES(1);
808 +SET SESSION query_exec_time = 2.3;
809 +INSERT INTO t VALUES(1);
810 +SET SESSION query_exec_time = 2.5;
811 +INSERT INTO t VALUES(1);
812 +SET SESSION query_exec_time = 3.1;
813 +INSERT INTO t VALUES(1);
814 +SET SESSION query_exec_time = 4.1;
815 +INSERT INTO t VALUES(1);
816 +SET SESSION query_exec_time = 5.1;
817 +INSERT INTO t VALUES(1);
818 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
819 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
820 +Variable_name  Value
821 +query_response_time_range_base 1000
822 +SHOW QUERY_RESPONSE_TIME;
823 +               
824 +      0.000001 2             0.000000
825 +      0.001000 0             0.000000
826 +      1.000000 36           12.450000
827 +   1000.000000 33           77.099997
828 + 1000000.00000 0             0.000000
829 +TOO LONG       0       TOO LONG
830 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
831 +time   count   total
832 +      0.000001 2             0.000000
833 +      0.001000 0             0.000000
834 +      1.000000 37           12.550000
835 +   1000.000000 33           77.099997
836 + 1000000.00000 0             0.000000
837 +TOO LONG       0       TOO LONG
838 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
839 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
840 +DROP TABLE t;
841 +CREATE TABLE t(id INT);
842 +SET GLOBAL query_exec_time = 0.1;
843 +include/restart_slave.inc
844 +SET SESSION query_exec_time=0.1;
845 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
846 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
847 +Warnings:
848 +Warning        1292    Truncated incorrect query_response_time_range_base value: '1001'
849 +FLUSH QUERY_RESPONSE_TIME;
850 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
851 +SET SESSION query_exec_time = 0.31;
852 +INSERT INTO t VALUES(1);
853 +SET SESSION query_exec_time = 0.32;
854 +INSERT INTO t VALUES(1);
855 +SET SESSION query_exec_time = 0.33;
856 +INSERT INTO t VALUES(1);
857 +SET SESSION query_exec_time = 0.34;
858 +INSERT INTO t VALUES(1);
859 +SET SESSION query_exec_time = 0.35;
860 +INSERT INTO t VALUES(1);
861 +SET SESSION query_exec_time = 0.36;
862 +INSERT INTO t VALUES(1);
863 +SET SESSION query_exec_time = 0.37;
864 +INSERT INTO t VALUES(1);
865 +SET SESSION query_exec_time = 0.38;
866 +INSERT INTO t VALUES(1);
867 +SET SESSION query_exec_time = 0.39;
868 +INSERT INTO t VALUES(1);
869 +SET SESSION query_exec_time = 0.4;
870 +INSERT INTO t VALUES(1);
871 +SET SESSION query_exec_time = 1.1;
872 +INSERT INTO t VALUES(1);
873 +SET SESSION query_exec_time = 1.2;
874 +INSERT INTO t VALUES(1);
875 +SET SESSION query_exec_time = 1.3;
876 +INSERT INTO t VALUES(1);
877 +SET SESSION query_exec_time = 1.5;
878 +INSERT INTO t VALUES(1);
879 +SET SESSION query_exec_time = 1.4;
880 +INSERT INTO t VALUES(1);
881 +SET SESSION query_exec_time = 0.5;
882 +INSERT INTO t VALUES(1);
883 +SET SESSION query_exec_time = 2.1;
884 +INSERT INTO t VALUES(1);
885 +SET SESSION query_exec_time = 2.3;
886 +INSERT INTO t VALUES(1);
887 +SET SESSION query_exec_time = 2.5;
888 +INSERT INTO t VALUES(1);
889 +SET SESSION query_exec_time = 3.1;
890 +INSERT INTO t VALUES(1);
891 +SET SESSION query_exec_time = 4.1;
892 +INSERT INTO t VALUES(1);
893 +SET SESSION query_exec_time = 5.1;
894 +INSERT INTO t VALUES(1);
895 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
896 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
897 +Variable_name  Value
898 +query_response_time_range_base 1000
899 +SHOW QUERY_RESPONSE_TIME;
900 +               
901 +      0.000001 2             0.000000
902 +      0.001000 0             0.000000
903 +      1.000000 36           12.450000
904 +   1000.000000 33           77.099997
905 + 1000000.00000 0             0.000000
906 +TOO LONG       0       TOO LONG
907 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
908 +time   count   total
909 +      0.000001 2             0.000000
910 +      0.001000 0             0.000000
911 +      1.000000 37           12.550000
912 +   1000.000000 33           77.099997
913 + 1000000.00000 0             0.000000
914 +TOO LONG       0       TOO LONG
915 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
916 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
917 +DROP TABLE t;
918 +include/rpl_end.inc
919 +SET GLOBAL query_exec_time=default;
920 +SET GLOBAL query_exec_time=default;
921 --- /dev/null
922 +++ b/mysql-test/r/percona_query_response_time.result
923 @@ -0,0 +1,1003 @@
924 +SET SESSION query_exec_time=0.1;
925 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
926 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
927 +Warnings:
928 +Warning        1292    Truncated incorrect query_response_time_range_base value: '1'
929 +FLUSH QUERY_RESPONSE_TIME;
930 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
931 +SET SESSION query_exec_time=0.31;
932 +SELECT 1;
933 +1
934 +1
935 +SET SESSION query_exec_time=0.32;
936 +SELECT 1;
937 +1
938 +1
939 +SET SESSION query_exec_time=0.33;
940 +SELECT 1;
941 +1
942 +1
943 +SET SESSION query_exec_time=0.34;
944 +SELECT 1;
945 +1
946 +1
947 +SET SESSION query_exec_time=0.35;
948 +SELECT 1;
949 +1
950 +1
951 +SET SESSION query_exec_time=0.36;
952 +SELECT 1;
953 +1
954 +1
955 +SET SESSION query_exec_time=0.37;
956 +SELECT 1;
957 +1
958 +1
959 +SET SESSION query_exec_time=0.38;
960 +SELECT 1;
961 +1
962 +1
963 +SET SESSION query_exec_time=0.39;
964 +SELECT 1;
965 +1
966 +1
967 +SET SESSION query_exec_time=0.4;
968 +SELECT 1;
969 +1
970 +1
971 +SET SESSION query_exec_time=1.1;
972 +SELECT 1;
973 +1
974 +1
975 +SET SESSION query_exec_time=1.2;
976 +SELECT 1;
977 +1
978 +1
979 +SET SESSION query_exec_time=1.3;
980 +SELECT 1;
981 +1
982 +1
983 +SET SESSION query_exec_time=1.5;
984 +SELECT 1;
985 +1
986 +1
987 +SET SESSION query_exec_time=1.4;
988 +SELECT 1;
989 +1
990 +1
991 +SET SESSION query_exec_time=0.5;
992 +SELECT 1;
993 +1
994 +1
995 +SET SESSION query_exec_time=2.1;
996 +SELECT 1;
997 +1
998 +1
999 +SET SESSION query_exec_time=2.3;
1000 +SELECT 1;
1001 +1
1002 +1
1003 +SET SESSION query_exec_time=2.5;
1004 +SELECT 1;
1005 +1
1006 +1
1007 +SET SESSION query_exec_time=3.1;
1008 +SELECT 1;
1009 +1
1010 +1
1011 +SET SESSION query_exec_time=4.1;
1012 +SELECT 1;
1013 +1
1014 +1
1015 +SET SESSION query_exec_time=5.1;
1016 +SELECT 1;
1017 +1
1018 +1
1019 +SET SESSION query_exec_time=0.1;
1020 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1021 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1022 +Variable_name  Value
1023 +query_response_time_range_base 2
1024 +SHOW QUERY_RESPONSE_TIME;
1025 +               
1026 +      0.000001 25            0.000000
1027 +      0.000003 0             0.000000
1028 +      0.000007 0             0.000000
1029 +      0.000015 0             0.000000
1030 +      0.000030 0             0.000000
1031 +      0.000061 0             0.000000
1032 +      0.000122 0             0.000000
1033 +      0.000244 0             0.000000
1034 +      0.000488 0             0.000000
1035 +      0.000976 0             0.000000
1036 +      0.001953 0             0.000000
1037 +      0.003906 0             0.000000
1038 +      0.007812 0             0.000000
1039 +      0.015625 0             0.000000
1040 +      0.031250 0             0.000000
1041 +      0.062500 0             0.000000
1042 +      0.125000 2             0.200000
1043 +      0.250000 0             0.000000
1044 +      0.500000 10            3.550000
1045 +      1.000000 1             0.500000
1046 +      2.000000 5             6.500000
1047 +      4.000000 4            10.000000
1048 +      8.000000 2             9.199999
1049 +     16.000000 0             0.000000
1050 +     32.000000 0             0.000000
1051 +     64.000000 0             0.000000
1052 +    128.000000 0             0.000000
1053 +    256.000000 0             0.000000
1054 +    512.000000 0             0.000000
1055 +   1024.000000 0             0.000000
1056 +   2048.000000 0             0.000000
1057 +   4096.000000 0             0.000000
1058 +   8192.000000 0             0.000000
1059 +  16384.000000 0             0.000000
1060 +  32768.000000 0             0.000000
1061 +  65536.000000 0             0.000000
1062 + 131072.000000 0             0.000000
1063 + 262144.000000 0             0.000000
1064 + 524288.000000 0             0.000000
1065 + 1048576.00000 0             0.000000
1066 + 2097152.00000 0             0.000000
1067 + 4194304.00000 0             0.000000
1068 + 8388608.00000 0             0.000000
1069 +TOO LONG       0       TOO LONG
1070 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1071 +time   count   total
1072 +      0.000001 25            0.000000
1073 +      0.000003 0             0.000000
1074 +      0.000007 0             0.000000
1075 +      0.000015 0             0.000000
1076 +      0.000030 0             0.000000
1077 +      0.000061 0             0.000000
1078 +      0.000122 0             0.000000
1079 +      0.000244 0             0.000000
1080 +      0.000488 0             0.000000
1081 +      0.000976 0             0.000000
1082 +      0.001953 0             0.000000
1083 +      0.003906 0             0.000000
1084 +      0.007812 0             0.000000
1085 +      0.015625 0             0.000000
1086 +      0.031250 0             0.000000
1087 +      0.062500 0             0.000000
1088 +      0.125000 3             0.300000
1089 +      0.250000 0             0.000000
1090 +      0.500000 10            3.550000
1091 +      1.000000 1             0.500000
1092 +      2.000000 5             6.500000
1093 +      4.000000 4            10.000000
1094 +      8.000000 2             9.199999
1095 +     16.000000 0             0.000000
1096 +     32.000000 0             0.000000
1097 +     64.000000 0             0.000000
1098 +    128.000000 0             0.000000
1099 +    256.000000 0             0.000000
1100 +    512.000000 0             0.000000
1101 +   1024.000000 0             0.000000
1102 +   2048.000000 0             0.000000
1103 +   4096.000000 0             0.000000
1104 +   8192.000000 0             0.000000
1105 +  16384.000000 0             0.000000
1106 +  32768.000000 0             0.000000
1107 +  65536.000000 0             0.000000
1108 + 131072.000000 0             0.000000
1109 + 262144.000000 0             0.000000
1110 + 524288.000000 0             0.000000
1111 + 1048576.00000 0             0.000000
1112 + 2097152.00000 0             0.000000
1113 + 4194304.00000 0             0.000000
1114 + 8388608.00000 0             0.000000
1115 +TOO LONG       0       TOO LONG
1116 +SET SESSION query_exec_time=default;
1117 +SET SESSION query_exec_time=0.1;
1118 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1119 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
1120 +FLUSH QUERY_RESPONSE_TIME;
1121 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1122 +SET SESSION query_exec_time=0.31;
1123 +SELECT 1;
1124 +1
1125 +1
1126 +SET SESSION query_exec_time=0.32;
1127 +SELECT 1;
1128 +1
1129 +1
1130 +SET SESSION query_exec_time=0.33;
1131 +SELECT 1;
1132 +1
1133 +1
1134 +SET SESSION query_exec_time=0.34;
1135 +SELECT 1;
1136 +1
1137 +1
1138 +SET SESSION query_exec_time=0.35;
1139 +SELECT 1;
1140 +1
1141 +1
1142 +SET SESSION query_exec_time=0.36;
1143 +SELECT 1;
1144 +1
1145 +1
1146 +SET SESSION query_exec_time=0.37;
1147 +SELECT 1;
1148 +1
1149 +1
1150 +SET SESSION query_exec_time=0.38;
1151 +SELECT 1;
1152 +1
1153 +1
1154 +SET SESSION query_exec_time=0.39;
1155 +SELECT 1;
1156 +1
1157 +1
1158 +SET SESSION query_exec_time=0.4;
1159 +SELECT 1;
1160 +1
1161 +1
1162 +SET SESSION query_exec_time=1.1;
1163 +SELECT 1;
1164 +1
1165 +1
1166 +SET SESSION query_exec_time=1.2;
1167 +SELECT 1;
1168 +1
1169 +1
1170 +SET SESSION query_exec_time=1.3;
1171 +SELECT 1;
1172 +1
1173 +1
1174 +SET SESSION query_exec_time=1.5;
1175 +SELECT 1;
1176 +1
1177 +1
1178 +SET SESSION query_exec_time=1.4;
1179 +SELECT 1;
1180 +1
1181 +1
1182 +SET SESSION query_exec_time=0.5;
1183 +SELECT 1;
1184 +1
1185 +1
1186 +SET SESSION query_exec_time=2.1;
1187 +SELECT 1;
1188 +1
1189 +1
1190 +SET SESSION query_exec_time=2.3;
1191 +SELECT 1;
1192 +1
1193 +1
1194 +SET SESSION query_exec_time=2.5;
1195 +SELECT 1;
1196 +1
1197 +1
1198 +SET SESSION query_exec_time=3.1;
1199 +SELECT 1;
1200 +1
1201 +1
1202 +SET SESSION query_exec_time=4.1;
1203 +SELECT 1;
1204 +1
1205 +1
1206 +SET SESSION query_exec_time=5.1;
1207 +SELECT 1;
1208 +1
1209 +1
1210 +SET SESSION query_exec_time=0.1;
1211 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1212 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1213 +Variable_name  Value
1214 +query_response_time_range_base 2
1215 +SHOW QUERY_RESPONSE_TIME;
1216 +               
1217 +      0.000001 25            0.000000
1218 +      0.000003 0             0.000000
1219 +      0.000007 0             0.000000
1220 +      0.000015 0             0.000000
1221 +      0.000030 0             0.000000
1222 +      0.000061 0             0.000000
1223 +      0.000122 0             0.000000
1224 +      0.000244 0             0.000000
1225 +      0.000488 0             0.000000
1226 +      0.000976 0             0.000000
1227 +      0.001953 0             0.000000
1228 +      0.003906 0             0.000000
1229 +      0.007812 0             0.000000
1230 +      0.015625 0             0.000000
1231 +      0.031250 0             0.000000
1232 +      0.062500 0             0.000000
1233 +      0.125000 2             0.200000
1234 +      0.250000 0             0.000000
1235 +      0.500000 10            3.550000
1236 +      1.000000 1             0.500000
1237 +      2.000000 5             6.500000
1238 +      4.000000 4            10.000000
1239 +      8.000000 2             9.199999
1240 +     16.000000 0             0.000000
1241 +     32.000000 0             0.000000
1242 +     64.000000 0             0.000000
1243 +    128.000000 0             0.000000
1244 +    256.000000 0             0.000000
1245 +    512.000000 0             0.000000
1246 +   1024.000000 0             0.000000
1247 +   2048.000000 0             0.000000
1248 +   4096.000000 0             0.000000
1249 +   8192.000000 0             0.000000
1250 +  16384.000000 0             0.000000
1251 +  32768.000000 0             0.000000
1252 +  65536.000000 0             0.000000
1253 + 131072.000000 0             0.000000
1254 + 262144.000000 0             0.000000
1255 + 524288.000000 0             0.000000
1256 + 1048576.00000 0             0.000000
1257 + 2097152.00000 0             0.000000
1258 + 4194304.00000 0             0.000000
1259 + 8388608.00000 0             0.000000
1260 +TOO LONG       0       TOO LONG
1261 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1262 +time   count   total
1263 +      0.000001 25            0.000000
1264 +      0.000003 0             0.000000
1265 +      0.000007 0             0.000000
1266 +      0.000015 0             0.000000
1267 +      0.000030 0             0.000000
1268 +      0.000061 0             0.000000
1269 +      0.000122 0             0.000000
1270 +      0.000244 0             0.000000
1271 +      0.000488 0             0.000000
1272 +      0.000976 0             0.000000
1273 +      0.001953 0             0.000000
1274 +      0.003906 0             0.000000
1275 +      0.007812 0             0.000000
1276 +      0.015625 0             0.000000
1277 +      0.031250 0             0.000000
1278 +      0.062500 0             0.000000
1279 +      0.125000 3             0.300000
1280 +      0.250000 0             0.000000
1281 +      0.500000 10            3.550000
1282 +      1.000000 1             0.500000
1283 +      2.000000 5             6.500000
1284 +      4.000000 4            10.000000
1285 +      8.000000 2             9.199999
1286 +     16.000000 0             0.000000
1287 +     32.000000 0             0.000000
1288 +     64.000000 0             0.000000
1289 +    128.000000 0             0.000000
1290 +    256.000000 0             0.000000
1291 +    512.000000 0             0.000000
1292 +   1024.000000 0             0.000000
1293 +   2048.000000 0             0.000000
1294 +   4096.000000 0             0.000000
1295 +   8192.000000 0             0.000000
1296 +  16384.000000 0             0.000000
1297 +  32768.000000 0             0.000000
1298 +  65536.000000 0             0.000000
1299 + 131072.000000 0             0.000000
1300 + 262144.000000 0             0.000000
1301 + 524288.000000 0             0.000000
1302 + 1048576.00000 0             0.000000
1303 + 2097152.00000 0             0.000000
1304 + 4194304.00000 0             0.000000
1305 + 8388608.00000 0             0.000000
1306 +TOO LONG       0       TOO LONG
1307 +SET SESSION query_exec_time=default;
1308 +SET SESSION query_exec_time=0.1;
1309 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1310 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
1311 +FLUSH QUERY_RESPONSE_TIME;
1312 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1313 +SET SESSION query_exec_time=0.31;
1314 +SELECT 1;
1315 +1
1316 +1
1317 +SET SESSION query_exec_time=0.32;
1318 +SELECT 1;
1319 +1
1320 +1
1321 +SET SESSION query_exec_time=0.33;
1322 +SELECT 1;
1323 +1
1324 +1
1325 +SET SESSION query_exec_time=0.34;
1326 +SELECT 1;
1327 +1
1328 +1
1329 +SET SESSION query_exec_time=0.35;
1330 +SELECT 1;
1331 +1
1332 +1
1333 +SET SESSION query_exec_time=0.36;
1334 +SELECT 1;
1335 +1
1336 +1
1337 +SET SESSION query_exec_time=0.37;
1338 +SELECT 1;
1339 +1
1340 +1
1341 +SET SESSION query_exec_time=0.38;
1342 +SELECT 1;
1343 +1
1344 +1
1345 +SET SESSION query_exec_time=0.39;
1346 +SELECT 1;
1347 +1
1348 +1
1349 +SET SESSION query_exec_time=0.4;
1350 +SELECT 1;
1351 +1
1352 +1
1353 +SET SESSION query_exec_time=1.1;
1354 +SELECT 1;
1355 +1
1356 +1
1357 +SET SESSION query_exec_time=1.2;
1358 +SELECT 1;
1359 +1
1360 +1
1361 +SET SESSION query_exec_time=1.3;
1362 +SELECT 1;
1363 +1
1364 +1
1365 +SET SESSION query_exec_time=1.5;
1366 +SELECT 1;
1367 +1
1368 +1
1369 +SET SESSION query_exec_time=1.4;
1370 +SELECT 1;
1371 +1
1372 +1
1373 +SET SESSION query_exec_time=0.5;
1374 +SELECT 1;
1375 +1
1376 +1
1377 +SET SESSION query_exec_time=2.1;
1378 +SELECT 1;
1379 +1
1380 +1
1381 +SET SESSION query_exec_time=2.3;
1382 +SELECT 1;
1383 +1
1384 +1
1385 +SET SESSION query_exec_time=2.5;
1386 +SELECT 1;
1387 +1
1388 +1
1389 +SET SESSION query_exec_time=3.1;
1390 +SELECT 1;
1391 +1
1392 +1
1393 +SET SESSION query_exec_time=4.1;
1394 +SELECT 1;
1395 +1
1396 +1
1397 +SET SESSION query_exec_time=5.1;
1398 +SELECT 1;
1399 +1
1400 +1
1401 +SET SESSION query_exec_time=0.1;
1402 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1403 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1404 +Variable_name  Value
1405 +query_response_time_range_base 10
1406 +SHOW QUERY_RESPONSE_TIME;
1407 +               
1408 +      0.000001 25            0.000000
1409 +      0.000010 0             0.000000
1410 +      0.000100 0             0.000000
1411 +      0.001000 0             0.000000
1412 +      0.010000 0             0.000000
1413 +      0.100000 0             0.000000
1414 +      1.000000 13            4.250000
1415 +     10.000000 11           25.699999
1416 +    100.000000 0             0.000000
1417 +   1000.000000 0             0.000000
1418 +  10000.000000 0             0.000000
1419 + 100000.000000 0             0.000000
1420 + 1000000.00000 0             0.000000
1421 +TOO LONG       0       TOO LONG
1422 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1423 +time   count   total
1424 +      0.000001 25            0.000000
1425 +      0.000010 0             0.000000
1426 +      0.000100 0             0.000000
1427 +      0.001000 0             0.000000
1428 +      0.010000 0             0.000000
1429 +      0.100000 0             0.000000
1430 +      1.000000 14            4.350000
1431 +     10.000000 11           25.699999
1432 +    100.000000 0             0.000000
1433 +   1000.000000 0             0.000000
1434 +  10000.000000 0             0.000000
1435 + 100000.000000 0             0.000000
1436 + 1000000.00000 0             0.000000
1437 +TOO LONG       0       TOO LONG
1438 +SET SESSION query_exec_time=default;
1439 +SET SESSION query_exec_time=0.1;
1440 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1441 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
1442 +FLUSH QUERY_RESPONSE_TIME;
1443 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1444 +SET SESSION query_exec_time=0.31;
1445 +SELECT 1;
1446 +1
1447 +1
1448 +SET SESSION query_exec_time=0.32;
1449 +SELECT 1;
1450 +1
1451 +1
1452 +SET SESSION query_exec_time=0.33;
1453 +SELECT 1;
1454 +1
1455 +1
1456 +SET SESSION query_exec_time=0.34;
1457 +SELECT 1;
1458 +1
1459 +1
1460 +SET SESSION query_exec_time=0.35;
1461 +SELECT 1;
1462 +1
1463 +1
1464 +SET SESSION query_exec_time=0.36;
1465 +SELECT 1;
1466 +1
1467 +1
1468 +SET SESSION query_exec_time=0.37;
1469 +SELECT 1;
1470 +1
1471 +1
1472 +SET SESSION query_exec_time=0.38;
1473 +SELECT 1;
1474 +1
1475 +1
1476 +SET SESSION query_exec_time=0.39;
1477 +SELECT 1;
1478 +1
1479 +1
1480 +SET SESSION query_exec_time=0.4;
1481 +SELECT 1;
1482 +1
1483 +1
1484 +SET SESSION query_exec_time=1.1;
1485 +SELECT 1;
1486 +1
1487 +1
1488 +SET SESSION query_exec_time=1.2;
1489 +SELECT 1;
1490 +1
1491 +1
1492 +SET SESSION query_exec_time=1.3;
1493 +SELECT 1;
1494 +1
1495 +1
1496 +SET SESSION query_exec_time=1.5;
1497 +SELECT 1;
1498 +1
1499 +1
1500 +SET SESSION query_exec_time=1.4;
1501 +SELECT 1;
1502 +1
1503 +1
1504 +SET SESSION query_exec_time=0.5;
1505 +SELECT 1;
1506 +1
1507 +1
1508 +SET SESSION query_exec_time=2.1;
1509 +SELECT 1;
1510 +1
1511 +1
1512 +SET SESSION query_exec_time=2.3;
1513 +SELECT 1;
1514 +1
1515 +1
1516 +SET SESSION query_exec_time=2.5;
1517 +SELECT 1;
1518 +1
1519 +1
1520 +SET SESSION query_exec_time=3.1;
1521 +SELECT 1;
1522 +1
1523 +1
1524 +SET SESSION query_exec_time=4.1;
1525 +SELECT 1;
1526 +1
1527 +1
1528 +SET SESSION query_exec_time=5.1;
1529 +SELECT 1;
1530 +1
1531 +1
1532 +SET SESSION query_exec_time=0.1;
1533 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1534 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1535 +Variable_name  Value
1536 +query_response_time_range_base 7
1537 +SHOW QUERY_RESPONSE_TIME;
1538 +               
1539 +      0.000001 25            0.000000
1540 +      0.000008 0             0.000000
1541 +      0.000059 0             0.000000
1542 +      0.000416 0             0.000000
1543 +      0.002915 0             0.000000
1544 +      0.020408 0             0.000000
1545 +      0.142857 2             0.200000
1546 +      1.000000 11            4.050000
1547 +      7.000000 11           25.699999
1548 +     49.000000 0             0.000000
1549 +    343.000000 0             0.000000
1550 +   2401.000000 0             0.000000
1551 +  16807.000000 0             0.000000
1552 + 117649.000000 0             0.000000
1553 + 823543.000000 0             0.000000
1554 + 5764801.00000 0             0.000000
1555 +TOO LONG       0       TOO LONG
1556 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1557 +time   count   total
1558 +      0.000001 25            0.000000
1559 +      0.000008 0             0.000000
1560 +      0.000059 0             0.000000
1561 +      0.000416 0             0.000000
1562 +      0.002915 0             0.000000
1563 +      0.020408 0             0.000000
1564 +      0.142857 3             0.300000
1565 +      1.000000 11            4.050000
1566 +      7.000000 11           25.699999
1567 +     49.000000 0             0.000000
1568 +    343.000000 0             0.000000
1569 +   2401.000000 0             0.000000
1570 +  16807.000000 0             0.000000
1571 + 117649.000000 0             0.000000
1572 + 823543.000000 0             0.000000
1573 + 5764801.00000 0             0.000000
1574 +TOO LONG       0       TOO LONG
1575 +SET SESSION query_exec_time=default;
1576 +SET SESSION query_exec_time=0.1;
1577 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1578 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
1579 +FLUSH QUERY_RESPONSE_TIME;
1580 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1581 +SET SESSION query_exec_time=0.31;
1582 +SELECT 1;
1583 +1
1584 +1
1585 +SET SESSION query_exec_time=0.32;
1586 +SELECT 1;
1587 +1
1588 +1
1589 +SET SESSION query_exec_time=0.33;
1590 +SELECT 1;
1591 +1
1592 +1
1593 +SET SESSION query_exec_time=0.34;
1594 +SELECT 1;
1595 +1
1596 +1
1597 +SET SESSION query_exec_time=0.35;
1598 +SELECT 1;
1599 +1
1600 +1
1601 +SET SESSION query_exec_time=0.36;
1602 +SELECT 1;
1603 +1
1604 +1
1605 +SET SESSION query_exec_time=0.37;
1606 +SELECT 1;
1607 +1
1608 +1
1609 +SET SESSION query_exec_time=0.38;
1610 +SELECT 1;
1611 +1
1612 +1
1613 +SET SESSION query_exec_time=0.39;
1614 +SELECT 1;
1615 +1
1616 +1
1617 +SET SESSION query_exec_time=0.4;
1618 +SELECT 1;
1619 +1
1620 +1
1621 +SET SESSION query_exec_time=1.1;
1622 +SELECT 1;
1623 +1
1624 +1
1625 +SET SESSION query_exec_time=1.2;
1626 +SELECT 1;
1627 +1
1628 +1
1629 +SET SESSION query_exec_time=1.3;
1630 +SELECT 1;
1631 +1
1632 +1
1633 +SET SESSION query_exec_time=1.5;
1634 +SELECT 1;
1635 +1
1636 +1
1637 +SET SESSION query_exec_time=1.4;
1638 +SELECT 1;
1639 +1
1640 +1
1641 +SET SESSION query_exec_time=0.5;
1642 +SELECT 1;
1643 +1
1644 +1
1645 +SET SESSION query_exec_time=2.1;
1646 +SELECT 1;
1647 +1
1648 +1
1649 +SET SESSION query_exec_time=2.3;
1650 +SELECT 1;
1651 +1
1652 +1
1653 +SET SESSION query_exec_time=2.5;
1654 +SELECT 1;
1655 +1
1656 +1
1657 +SET SESSION query_exec_time=3.1;
1658 +SELECT 1;
1659 +1
1660 +1
1661 +SET SESSION query_exec_time=4.1;
1662 +SELECT 1;
1663 +1
1664 +1
1665 +SET SESSION query_exec_time=5.1;
1666 +SELECT 1;
1667 +1
1668 +1
1669 +SET SESSION query_exec_time=0.1;
1670 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1671 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1672 +Variable_name  Value
1673 +query_response_time_range_base 156
1674 +SHOW QUERY_RESPONSE_TIME;
1675 +               
1676 +      0.000041 25            0.000000
1677 +      0.006410 0             0.000000
1678 +      1.000000 13            4.250000
1679 +    156.000000 11           25.699999
1680 +  24336.000000 0             0.000000
1681 + 3796416.00000 0             0.000000
1682 +TOO LONG       0       TOO LONG
1683 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1684 +time   count   total
1685 +      0.000041 25            0.000000
1686 +      0.006410 0             0.000000
1687 +      1.000000 14            4.350000
1688 +    156.000000 11           25.699999
1689 +  24336.000000 0             0.000000
1690 + 3796416.00000 0             0.000000
1691 +TOO LONG       0       TOO LONG
1692 +SET SESSION query_exec_time=default;
1693 +SET SESSION query_exec_time=0.1;
1694 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1695 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
1696 +FLUSH QUERY_RESPONSE_TIME;
1697 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1698 +SET SESSION query_exec_time=0.31;
1699 +SELECT 1;
1700 +1
1701 +1
1702 +SET SESSION query_exec_time=0.32;
1703 +SELECT 1;
1704 +1
1705 +1
1706 +SET SESSION query_exec_time=0.33;
1707 +SELECT 1;
1708 +1
1709 +1
1710 +SET SESSION query_exec_time=0.34;
1711 +SELECT 1;
1712 +1
1713 +1
1714 +SET SESSION query_exec_time=0.35;
1715 +SELECT 1;
1716 +1
1717 +1
1718 +SET SESSION query_exec_time=0.36;
1719 +SELECT 1;
1720 +1
1721 +1
1722 +SET SESSION query_exec_time=0.37;
1723 +SELECT 1;
1724 +1
1725 +1
1726 +SET SESSION query_exec_time=0.38;
1727 +SELECT 1;
1728 +1
1729 +1
1730 +SET SESSION query_exec_time=0.39;
1731 +SELECT 1;
1732 +1
1733 +1
1734 +SET SESSION query_exec_time=0.4;
1735 +SELECT 1;
1736 +1
1737 +1
1738 +SET SESSION query_exec_time=1.1;
1739 +SELECT 1;
1740 +1
1741 +1
1742 +SET SESSION query_exec_time=1.2;
1743 +SELECT 1;
1744 +1
1745 +1
1746 +SET SESSION query_exec_time=1.3;
1747 +SELECT 1;
1748 +1
1749 +1
1750 +SET SESSION query_exec_time=1.5;
1751 +SELECT 1;
1752 +1
1753 +1
1754 +SET SESSION query_exec_time=1.4;
1755 +SELECT 1;
1756 +1
1757 +1
1758 +SET SESSION query_exec_time=0.5;
1759 +SELECT 1;
1760 +1
1761 +1
1762 +SET SESSION query_exec_time=2.1;
1763 +SELECT 1;
1764 +1
1765 +1
1766 +SET SESSION query_exec_time=2.3;
1767 +SELECT 1;
1768 +1
1769 +1
1770 +SET SESSION query_exec_time=2.5;
1771 +SELECT 1;
1772 +1
1773 +1
1774 +SET SESSION query_exec_time=3.1;
1775 +SELECT 1;
1776 +1
1777 +1
1778 +SET SESSION query_exec_time=4.1;
1779 +SELECT 1;
1780 +1
1781 +1
1782 +SET SESSION query_exec_time=5.1;
1783 +SELECT 1;
1784 +1
1785 +1
1786 +SET SESSION query_exec_time=0.1;
1787 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1788 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1789 +Variable_name  Value
1790 +query_response_time_range_base 1000
1791 +SHOW QUERY_RESPONSE_TIME;
1792 +               
1793 +      0.000001 25            0.000000
1794 +      0.001000 0             0.000000
1795 +      1.000000 13            4.250000
1796 +   1000.000000 11           25.699999
1797 + 1000000.00000 0             0.000000
1798 +TOO LONG       0       TOO LONG
1799 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1800 +time   count   total
1801 +      0.000001 25            0.000000
1802 +      0.001000 0             0.000000
1803 +      1.000000 14            4.350000
1804 +   1000.000000 11           25.699999
1805 + 1000000.00000 0             0.000000
1806 +TOO LONG       0       TOO LONG
1807 +SET SESSION query_exec_time=default;
1808 +SET SESSION query_exec_time=0.1;
1809 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1810 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
1811 +Warnings:
1812 +Warning        1292    Truncated incorrect query_response_time_range_base value: '1001'
1813 +FLUSH QUERY_RESPONSE_TIME;
1814 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1815 +SET SESSION query_exec_time=0.31;
1816 +SELECT 1;
1817 +1
1818 +1
1819 +SET SESSION query_exec_time=0.32;
1820 +SELECT 1;
1821 +1
1822 +1
1823 +SET SESSION query_exec_time=0.33;
1824 +SELECT 1;
1825 +1
1826 +1
1827 +SET SESSION query_exec_time=0.34;
1828 +SELECT 1;
1829 +1
1830 +1
1831 +SET SESSION query_exec_time=0.35;
1832 +SELECT 1;
1833 +1
1834 +1
1835 +SET SESSION query_exec_time=0.36;
1836 +SELECT 1;
1837 +1
1838 +1
1839 +SET SESSION query_exec_time=0.37;
1840 +SELECT 1;
1841 +1
1842 +1
1843 +SET SESSION query_exec_time=0.38;
1844 +SELECT 1;
1845 +1
1846 +1
1847 +SET SESSION query_exec_time=0.39;
1848 +SELECT 1;
1849 +1
1850 +1
1851 +SET SESSION query_exec_time=0.4;
1852 +SELECT 1;
1853 +1
1854 +1
1855 +SET SESSION query_exec_time=1.1;
1856 +SELECT 1;
1857 +1
1858 +1
1859 +SET SESSION query_exec_time=1.2;
1860 +SELECT 1;
1861 +1
1862 +1
1863 +SET SESSION query_exec_time=1.3;
1864 +SELECT 1;
1865 +1
1866 +1
1867 +SET SESSION query_exec_time=1.5;
1868 +SELECT 1;
1869 +1
1870 +1
1871 +SET SESSION query_exec_time=1.4;
1872 +SELECT 1;
1873 +1
1874 +1
1875 +SET SESSION query_exec_time=0.5;
1876 +SELECT 1;
1877 +1
1878 +1
1879 +SET SESSION query_exec_time=2.1;
1880 +SELECT 1;
1881 +1
1882 +1
1883 +SET SESSION query_exec_time=2.3;
1884 +SELECT 1;
1885 +1
1886 +1
1887 +SET SESSION query_exec_time=2.5;
1888 +SELECT 1;
1889 +1
1890 +1
1891 +SET SESSION query_exec_time=3.1;
1892 +SELECT 1;
1893 +1
1894 +1
1895 +SET SESSION query_exec_time=4.1;
1896 +SELECT 1;
1897 +1
1898 +1
1899 +SET SESSION query_exec_time=5.1;
1900 +SELECT 1;
1901 +1
1902 +1
1903 +SET SESSION query_exec_time=0.1;
1904 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1905 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1906 +Variable_name  Value
1907 +query_response_time_range_base 1000
1908 +SHOW QUERY_RESPONSE_TIME;
1909 +               
1910 +      0.000001 25            0.000000
1911 +      0.001000 0             0.000000
1912 +      1.000000 13            4.250000
1913 +   1000.000000 11           25.699999
1914 + 1000000.00000 0             0.000000
1915 +TOO LONG       0       TOO LONG
1916 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
1917 +time   count   total
1918 +      0.000001 25            0.000000
1919 +      0.001000 0             0.000000
1920 +      1.000000 14            4.350000
1921 +   1000.000000 11           25.699999
1922 + 1000000.00000 0             0.000000
1923 +TOO LONG       0       TOO LONG
1924 +SET SESSION query_exec_time=default;
1925 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
1926 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
1927 --- /dev/null
1928 +++ b/mysql-test/r/percona_query_response_time-stored.result
1929 @@ -0,0 +1,544 @@
1930 +CREATE TABLE t(a INT);
1931 +CREATE PROCEDURE test_f(t DECIMAL(3,2))
1932 +BEGIN
1933 +SET SESSION query_exec_time=t;
1934 +INSERT INTO t VALUES(1);
1935 +SET SESSION query_exec_time=0.1;
1936 +DELETE FROM t;
1937 +END^
1938 +SET SESSION query_exec_time=0.1;
1939 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1940 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
1941 +Warnings:
1942 +Warning        1292    Truncated incorrect query_response_time_range_base value: '1'
1943 +FLUSH QUERY_RESPONSE_TIME;
1944 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
1945 +CALL test_f(0.31);
1946 +CALL test_f(0.32);
1947 +CALL test_f(0.33);
1948 +CALL test_f(0.34);
1949 +CALL test_f(0.35);
1950 +CALL test_f(0.36);
1951 +CALL test_f(0.37);
1952 +CALL test_f(0.38);
1953 +CALL test_f(0.39);
1954 +CALL test_f(0.4);
1955 +CALL test_f(1.1);
1956 +CALL test_f(1.2);
1957 +CALL test_f(1.3);
1958 +CALL test_f(1.5);
1959 +CALL test_f(1.4);
1960 +CALL test_f(0.5);
1961 +CALL test_f(2.1);
1962 +CALL test_f(2.3);
1963 +CALL test_f(2.5);
1964 +CALL test_f(3.1);
1965 +CALL test_f(4.1);
1966 +CALL test_f(5.1);
1967 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
1968 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
1969 +Variable_name  Value
1970 +query_response_time_range_base 2
1971 +SHOW QUERY_RESPONSE_TIME;
1972 +               
1973 +      0.000001 46            0.000000
1974 +      0.000003 0             0.000000
1975 +      0.000007 0             0.000000
1976 +      0.000015 0             0.000000
1977 +      0.000030 0             0.000000
1978 +      0.000061 0             0.000000
1979 +      0.000122 0             0.000000
1980 +      0.000244 0             0.000000
1981 +      0.000488 0             0.000000
1982 +      0.000976 0             0.000000
1983 +      0.001953 0             0.000000
1984 +      0.003906 0             0.000000
1985 +      0.007812 0             0.000000
1986 +      0.015625 0             0.000000
1987 +      0.031250 0             0.000000
1988 +      0.062500 0             0.000000
1989 +      0.125000 46            4.600000
1990 +      0.250000 0             0.000000
1991 +      0.500000 10            3.550000
1992 +      1.000000 1             0.500000
1993 +      2.000000 5             6.500000
1994 +      4.000000 4            10.000000
1995 +      8.000000 2             9.199999
1996 +     16.000000 0             0.000000
1997 +     32.000000 0             0.000000
1998 +     64.000000 0             0.000000
1999 +    128.000000 0             0.000000
2000 +    256.000000 0             0.000000
2001 +    512.000000 0             0.000000
2002 +   1024.000000 0             0.000000
2003 +   2048.000000 0             0.000000
2004 +   4096.000000 0             0.000000
2005 +   8192.000000 0             0.000000
2006 +  16384.000000 0             0.000000
2007 +  32768.000000 0             0.000000
2008 +  65536.000000 0             0.000000
2009 + 131072.000000 0             0.000000
2010 + 262144.000000 0             0.000000
2011 + 524288.000000 0             0.000000
2012 + 1048576.00000 0             0.000000
2013 + 2097152.00000 0             0.000000
2014 + 4194304.00000 0             0.000000
2015 + 8388608.00000 0             0.000000
2016 +TOO LONG       0       TOO LONG
2017 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2018 +time   count   total
2019 +      0.000001 46            0.000000
2020 +      0.000003 0             0.000000
2021 +      0.000007 0             0.000000
2022 +      0.000015 0             0.000000
2023 +      0.000030 0             0.000000
2024 +      0.000061 0             0.000000
2025 +      0.000122 0             0.000000
2026 +      0.000244 0             0.000000
2027 +      0.000488 0             0.000000
2028 +      0.000976 0             0.000000
2029 +      0.001953 0             0.000000
2030 +      0.003906 0             0.000000
2031 +      0.007812 0             0.000000
2032 +      0.015625 0             0.000000
2033 +      0.031250 0             0.000000
2034 +      0.062500 0             0.000000
2035 +      0.125000 47            4.700000
2036 +      0.250000 0             0.000000
2037 +      0.500000 10            3.550000
2038 +      1.000000 1             0.500000
2039 +      2.000000 5             6.500000
2040 +      4.000000 4            10.000000
2041 +      8.000000 2             9.199999
2042 +     16.000000 0             0.000000
2043 +     32.000000 0             0.000000
2044 +     64.000000 0             0.000000
2045 +    128.000000 0             0.000000
2046 +    256.000000 0             0.000000
2047 +    512.000000 0             0.000000
2048 +   1024.000000 0             0.000000
2049 +   2048.000000 0             0.000000
2050 +   4096.000000 0             0.000000
2051 +   8192.000000 0             0.000000
2052 +  16384.000000 0             0.000000
2053 +  32768.000000 0             0.000000
2054 +  65536.000000 0             0.000000
2055 + 131072.000000 0             0.000000
2056 + 262144.000000 0             0.000000
2057 + 524288.000000 0             0.000000
2058 + 1048576.00000 0             0.000000
2059 + 2097152.00000 0             0.000000
2060 + 4194304.00000 0             0.000000
2061 + 8388608.00000 0             0.000000
2062 +TOO LONG       0       TOO LONG
2063 +SET SESSION query_exec_time=default;
2064 +SET SESSION query_exec_time=0.1;
2065 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2066 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
2067 +FLUSH QUERY_RESPONSE_TIME;
2068 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
2069 +CALL test_f(0.31);
2070 +CALL test_f(0.32);
2071 +CALL test_f(0.33);
2072 +CALL test_f(0.34);
2073 +CALL test_f(0.35);
2074 +CALL test_f(0.36);
2075 +CALL test_f(0.37);
2076 +CALL test_f(0.38);
2077 +CALL test_f(0.39);
2078 +CALL test_f(0.4);
2079 +CALL test_f(1.1);
2080 +CALL test_f(1.2);
2081 +CALL test_f(1.3);
2082 +CALL test_f(1.5);
2083 +CALL test_f(1.4);
2084 +CALL test_f(0.5);
2085 +CALL test_f(2.1);
2086 +CALL test_f(2.3);
2087 +CALL test_f(2.5);
2088 +CALL test_f(3.1);
2089 +CALL test_f(4.1);
2090 +CALL test_f(5.1);
2091 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2092 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2093 +Variable_name  Value
2094 +query_response_time_range_base 2
2095 +SHOW QUERY_RESPONSE_TIME;
2096 +               
2097 +      0.000001 46            0.000000
2098 +      0.000003 0             0.000000
2099 +      0.000007 0             0.000000
2100 +      0.000015 0             0.000000
2101 +      0.000030 0             0.000000
2102 +      0.000061 0             0.000000
2103 +      0.000122 0             0.000000
2104 +      0.000244 0             0.000000
2105 +      0.000488 0             0.000000
2106 +      0.000976 0             0.000000
2107 +      0.001953 0             0.000000
2108 +      0.003906 0             0.000000
2109 +      0.007812 0             0.000000
2110 +      0.015625 0             0.000000
2111 +      0.031250 0             0.000000
2112 +      0.062500 0             0.000000
2113 +      0.125000 46            4.600000
2114 +      0.250000 0             0.000000
2115 +      0.500000 10            3.550000
2116 +      1.000000 1             0.500000
2117 +      2.000000 5             6.500000
2118 +      4.000000 4            10.000000
2119 +      8.000000 2             9.199999
2120 +     16.000000 0             0.000000
2121 +     32.000000 0             0.000000
2122 +     64.000000 0             0.000000
2123 +    128.000000 0             0.000000
2124 +    256.000000 0             0.000000
2125 +    512.000000 0             0.000000
2126 +   1024.000000 0             0.000000
2127 +   2048.000000 0             0.000000
2128 +   4096.000000 0             0.000000
2129 +   8192.000000 0             0.000000
2130 +  16384.000000 0             0.000000
2131 +  32768.000000 0             0.000000
2132 +  65536.000000 0             0.000000
2133 + 131072.000000 0             0.000000
2134 + 262144.000000 0             0.000000
2135 + 524288.000000 0             0.000000
2136 + 1048576.00000 0             0.000000
2137 + 2097152.00000 0             0.000000
2138 + 4194304.00000 0             0.000000
2139 + 8388608.00000 0             0.000000
2140 +TOO LONG       0       TOO LONG
2141 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2142 +time   count   total
2143 +      0.000001 46            0.000000
2144 +      0.000003 0             0.000000
2145 +      0.000007 0             0.000000
2146 +      0.000015 0             0.000000
2147 +      0.000030 0             0.000000
2148 +      0.000061 0             0.000000
2149 +      0.000122 0             0.000000
2150 +      0.000244 0             0.000000
2151 +      0.000488 0             0.000000
2152 +      0.000976 0             0.000000
2153 +      0.001953 0             0.000000
2154 +      0.003906 0             0.000000
2155 +      0.007812 0             0.000000
2156 +      0.015625 0             0.000000
2157 +      0.031250 0             0.000000
2158 +      0.062500 0             0.000000
2159 +      0.125000 47            4.700000
2160 +      0.250000 0             0.000000
2161 +      0.500000 10            3.550000
2162 +      1.000000 1             0.500000
2163 +      2.000000 5             6.500000
2164 +      4.000000 4            10.000000
2165 +      8.000000 2             9.199999
2166 +     16.000000 0             0.000000
2167 +     32.000000 0             0.000000
2168 +     64.000000 0             0.000000
2169 +    128.000000 0             0.000000
2170 +    256.000000 0             0.000000
2171 +    512.000000 0             0.000000
2172 +   1024.000000 0             0.000000
2173 +   2048.000000 0             0.000000
2174 +   4096.000000 0             0.000000
2175 +   8192.000000 0             0.000000
2176 +  16384.000000 0             0.000000
2177 +  32768.000000 0             0.000000
2178 +  65536.000000 0             0.000000
2179 + 131072.000000 0             0.000000
2180 + 262144.000000 0             0.000000
2181 + 524288.000000 0             0.000000
2182 + 1048576.00000 0             0.000000
2183 + 2097152.00000 0             0.000000
2184 + 4194304.00000 0             0.000000
2185 + 8388608.00000 0             0.000000
2186 +TOO LONG       0       TOO LONG
2187 +SET SESSION query_exec_time=default;
2188 +SET SESSION query_exec_time=0.1;
2189 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2190 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
2191 +FLUSH QUERY_RESPONSE_TIME;
2192 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
2193 +CALL test_f(0.31);
2194 +CALL test_f(0.32);
2195 +CALL test_f(0.33);
2196 +CALL test_f(0.34);
2197 +CALL test_f(0.35);
2198 +CALL test_f(0.36);
2199 +CALL test_f(0.37);
2200 +CALL test_f(0.38);
2201 +CALL test_f(0.39);
2202 +CALL test_f(0.4);
2203 +CALL test_f(1.1);
2204 +CALL test_f(1.2);
2205 +CALL test_f(1.3);
2206 +CALL test_f(1.5);
2207 +CALL test_f(1.4);
2208 +CALL test_f(0.5);
2209 +CALL test_f(2.1);
2210 +CALL test_f(2.3);
2211 +CALL test_f(2.5);
2212 +CALL test_f(3.1);
2213 +CALL test_f(4.1);
2214 +CALL test_f(5.1);
2215 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2216 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2217 +Variable_name  Value
2218 +query_response_time_range_base 10
2219 +SHOW QUERY_RESPONSE_TIME;
2220 +               
2221 +      0.000001 46            0.000000
2222 +      0.000010 0             0.000000
2223 +      0.000100 0             0.000000
2224 +      0.001000 0             0.000000
2225 +      0.010000 0             0.000000
2226 +      0.100000 0             0.000000
2227 +      1.000000 57            8.650000
2228 +     10.000000 11           25.699999
2229 +    100.000000 0             0.000000
2230 +   1000.000000 0             0.000000
2231 +  10000.000000 0             0.000000
2232 + 100000.000000 0             0.000000
2233 + 1000000.00000 0             0.000000
2234 +TOO LONG       0       TOO LONG
2235 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2236 +time   count   total
2237 +      0.000001 46            0.000000
2238 +      0.000010 0             0.000000
2239 +      0.000100 0             0.000000
2240 +      0.001000 0             0.000000
2241 +      0.010000 0             0.000000
2242 +      0.100000 0             0.000000
2243 +      1.000000 58            8.750000
2244 +     10.000000 11           25.699999
2245 +    100.000000 0             0.000000
2246 +   1000.000000 0             0.000000
2247 +  10000.000000 0             0.000000
2248 + 100000.000000 0             0.000000
2249 + 1000000.00000 0             0.000000
2250 +TOO LONG       0       TOO LONG
2251 +SET SESSION query_exec_time=default;
2252 +SET SESSION query_exec_time=0.1;
2253 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2254 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
2255 +FLUSH QUERY_RESPONSE_TIME;
2256 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
2257 +CALL test_f(0.31);
2258 +CALL test_f(0.32);
2259 +CALL test_f(0.33);
2260 +CALL test_f(0.34);
2261 +CALL test_f(0.35);
2262 +CALL test_f(0.36);
2263 +CALL test_f(0.37);
2264 +CALL test_f(0.38);
2265 +CALL test_f(0.39);
2266 +CALL test_f(0.4);
2267 +CALL test_f(1.1);
2268 +CALL test_f(1.2);
2269 +CALL test_f(1.3);
2270 +CALL test_f(1.5);
2271 +CALL test_f(1.4);
2272 +CALL test_f(0.5);
2273 +CALL test_f(2.1);
2274 +CALL test_f(2.3);
2275 +CALL test_f(2.5);
2276 +CALL test_f(3.1);
2277 +CALL test_f(4.1);
2278 +CALL test_f(5.1);
2279 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2280 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2281 +Variable_name  Value
2282 +query_response_time_range_base 7
2283 +SHOW QUERY_RESPONSE_TIME;
2284 +               
2285 +      0.000001 46            0.000000
2286 +      0.000008 0             0.000000
2287 +      0.000059 0             0.000000
2288 +      0.000416 0             0.000000
2289 +      0.002915 0             0.000000
2290 +      0.020408 0             0.000000
2291 +      0.142857 46            4.600000
2292 +      1.000000 11            4.050000
2293 +      7.000000 11           25.699999
2294 +     49.000000 0             0.000000
2295 +    343.000000 0             0.000000
2296 +   2401.000000 0             0.000000
2297 +  16807.000000 0             0.000000
2298 + 117649.000000 0             0.000000
2299 + 823543.000000 0             0.000000
2300 + 5764801.00000 0             0.000000
2301 +TOO LONG       0       TOO LONG
2302 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2303 +time   count   total
2304 +      0.000001 46            0.000000
2305 +      0.000008 0             0.000000
2306 +      0.000059 0             0.000000
2307 +      0.000416 0             0.000000
2308 +      0.002915 0             0.000000
2309 +      0.020408 0             0.000000
2310 +      0.142857 47            4.700000
2311 +      1.000000 11            4.050000
2312 +      7.000000 11           25.699999
2313 +     49.000000 0             0.000000
2314 +    343.000000 0             0.000000
2315 +   2401.000000 0             0.000000
2316 +  16807.000000 0             0.000000
2317 + 117649.000000 0             0.000000
2318 + 823543.000000 0             0.000000
2319 + 5764801.00000 0             0.000000
2320 +TOO LONG       0       TOO LONG
2321 +SET SESSION query_exec_time=default;
2322 +SET SESSION query_exec_time=0.1;
2323 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2324 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
2325 +FLUSH QUERY_RESPONSE_TIME;
2326 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
2327 +CALL test_f(0.31);
2328 +CALL test_f(0.32);
2329 +CALL test_f(0.33);
2330 +CALL test_f(0.34);
2331 +CALL test_f(0.35);
2332 +CALL test_f(0.36);
2333 +CALL test_f(0.37);
2334 +CALL test_f(0.38);
2335 +CALL test_f(0.39);
2336 +CALL test_f(0.4);
2337 +CALL test_f(1.1);
2338 +CALL test_f(1.2);
2339 +CALL test_f(1.3);
2340 +CALL test_f(1.5);
2341 +CALL test_f(1.4);
2342 +CALL test_f(0.5);
2343 +CALL test_f(2.1);
2344 +CALL test_f(2.3);
2345 +CALL test_f(2.5);
2346 +CALL test_f(3.1);
2347 +CALL test_f(4.1);
2348 +CALL test_f(5.1);
2349 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2350 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2351 +Variable_name  Value
2352 +query_response_time_range_base 156
2353 +SHOW QUERY_RESPONSE_TIME;
2354 +               
2355 +      0.000041 46            0.000000
2356 +      0.006410 0             0.000000
2357 +      1.000000 57            8.650000
2358 +    156.000000 11           25.699999
2359 +  24336.000000 0             0.000000
2360 + 3796416.00000 0             0.000000
2361 +TOO LONG       0       TOO LONG
2362 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2363 +time   count   total
2364 +      0.000041 46            0.000000
2365 +      0.006410 0             0.000000
2366 +      1.000000 58            8.750000
2367 +    156.000000 11           25.699999
2368 +  24336.000000 0             0.000000
2369 + 3796416.00000 0             0.000000
2370 +TOO LONG       0       TOO LONG
2371 +SET SESSION query_exec_time=default;
2372 +SET SESSION query_exec_time=0.1;
2373 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2374 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
2375 +FLUSH QUERY_RESPONSE_TIME;
2376 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
2377 +CALL test_f(0.31);
2378 +CALL test_f(0.32);
2379 +CALL test_f(0.33);
2380 +CALL test_f(0.34);
2381 +CALL test_f(0.35);
2382 +CALL test_f(0.36);
2383 +CALL test_f(0.37);
2384 +CALL test_f(0.38);
2385 +CALL test_f(0.39);
2386 +CALL test_f(0.4);
2387 +CALL test_f(1.1);
2388 +CALL test_f(1.2);
2389 +CALL test_f(1.3);
2390 +CALL test_f(1.5);
2391 +CALL test_f(1.4);
2392 +CALL test_f(0.5);
2393 +CALL test_f(2.1);
2394 +CALL test_f(2.3);
2395 +CALL test_f(2.5);
2396 +CALL test_f(3.1);
2397 +CALL test_f(4.1);
2398 +CALL test_f(5.1);
2399 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2400 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2401 +Variable_name  Value
2402 +query_response_time_range_base 1000
2403 +SHOW QUERY_RESPONSE_TIME;
2404 +               
2405 +      0.000001 46            0.000000
2406 +      0.001000 0             0.000000
2407 +      1.000000 57            8.650000
2408 +   1000.000000 11           25.699999
2409 + 1000000.00000 0             0.000000
2410 +TOO LONG       0       TOO LONG
2411 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2412 +time   count   total
2413 +      0.000001 46            0.000000
2414 +      0.001000 0             0.000000
2415 +      1.000000 58            8.750000
2416 +   1000.000000 11           25.699999
2417 + 1000000.00000 0             0.000000
2418 +TOO LONG       0       TOO LONG
2419 +SET SESSION query_exec_time=default;
2420 +SET SESSION query_exec_time=0.1;
2421 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2422 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
2423 +Warnings:
2424 +Warning        1292    Truncated incorrect query_response_time_range_base value: '1001'
2425 +FLUSH QUERY_RESPONSE_TIME;
2426 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
2427 +CALL test_f(0.31);
2428 +CALL test_f(0.32);
2429 +CALL test_f(0.33);
2430 +CALL test_f(0.34);
2431 +CALL test_f(0.35);
2432 +CALL test_f(0.36);
2433 +CALL test_f(0.37);
2434 +CALL test_f(0.38);
2435 +CALL test_f(0.39);
2436 +CALL test_f(0.4);
2437 +CALL test_f(1.1);
2438 +CALL test_f(1.2);
2439 +CALL test_f(1.3);
2440 +CALL test_f(1.5);
2441 +CALL test_f(1.4);
2442 +CALL test_f(0.5);
2443 +CALL test_f(2.1);
2444 +CALL test_f(2.3);
2445 +CALL test_f(2.5);
2446 +CALL test_f(3.1);
2447 +CALL test_f(4.1);
2448 +CALL test_f(5.1);
2449 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
2450 +SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
2451 +Variable_name  Value
2452 +query_response_time_range_base 1000
2453 +SHOW QUERY_RESPONSE_TIME;
2454 +               
2455 +      0.000001 46            0.000000
2456 +      0.001000 0             0.000000
2457 +      1.000000 57            8.650000
2458 +   1000.000000 11           25.699999
2459 + 1000000.00000 0             0.000000
2460 +TOO LONG       0       TOO LONG
2461 +SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
2462 +time   count   total
2463 +      0.000001 46            0.000000
2464 +      0.001000 0             0.000000
2465 +      1.000000 58            8.750000
2466 +   1000.000000 11           25.699999
2467 + 1000000.00000 0             0.000000
2468 +TOO LONG       0       TOO LONG
2469 +SET SESSION query_exec_time=default;
2470 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
2471 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
2472 +DROP PROCEDURE test_f;
2473 +DROP TABLE t;
2474 --- /dev/null
2475 +++ b/mysql-test/t/percona_query_response_time-replication.test
2476 @@ -0,0 +1,28 @@
2477 +SET GLOBAL query_exec_time=0.1;
2478 +
2479 +--source include/have_response_time_distribution.inc
2480 +--source include/have_debug.inc
2481 +--source include/have_binlog_format_statement.inc
2482 +--source include/master-slave.inc
2483 +
2484 +--let base=1
2485 +--source include/query_response_time-replication.inc
2486 +--let base=2
2487 +--source include/query_response_time-replication.inc
2488 +--let base=10
2489 +--source include/query_response_time-replication.inc
2490 +--let base=7
2491 +--source include/query_response_time-replication.inc
2492 +--let base=156
2493 +--source include/query_response_time-replication.inc
2494 +--let base=1000
2495 +--source include/query_response_time-replication.inc
2496 +--let base=1001
2497 +--source include/query_response_time-replication.inc
2498 +
2499 +--source include/rpl_end.inc
2500 +
2501 +SET GLOBAL query_exec_time=default;
2502 +
2503 +connection slave;
2504 +SET GLOBAL query_exec_time=default;
2505 --- /dev/null
2506 +++ b/mysql-test/t/percona_query_response_time-stored.test
2507 @@ -0,0 +1,36 @@
2508 +--source include/have_response_time_distribution.inc
2509 +--source include/have_debug.inc
2510 +
2511 +CREATE TABLE t(a INT);
2512 +
2513 +delimiter ^;
2514 +CREATE PROCEDURE test_f(t DECIMAL(3,2))
2515 +BEGIN
2516 +  SET SESSION query_exec_time=t;
2517 +  INSERT INTO t VALUES(1);
2518 +  SET SESSION query_exec_time=0.1;
2519 +  DELETE FROM t;
2520 +END^
2521 +delimiter ;^
2522 +
2523 +--let base=1
2524 +--source include/query_response_time-stored.inc
2525 +--let base=2
2526 +--source include/query_response_time-stored.inc
2527 +--let base=10
2528 +--source include/query_response_time-stored.inc
2529 +--let base=7
2530 +--source include/query_response_time-stored.inc
2531 +--let base=156
2532 +--source include/query_response_time-stored.inc
2533 +--let base=1000
2534 +--source include/query_response_time-stored.inc
2535 +--let base=1001
2536 +--source include/query_response_time-stored.inc
2537 +
2538 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
2539 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
2540 +
2541 +DROP PROCEDURE test_f;
2542 +
2543 +DROP TABLE t;
2544 --- /dev/null
2545 +++ b/mysql-test/t/percona_query_response_time.test
2546 @@ -0,0 +1,20 @@
2547 +--source include/have_response_time_distribution.inc
2548 +--source include/have_debug.inc
2549 +
2550 +--let base=1
2551 +--source include/query_response_time.inc
2552 +--let base=2
2553 +--source include/query_response_time.inc
2554 +--let base=10
2555 +--source include/query_response_time.inc
2556 +--let base=7
2557 +--source include/query_response_time.inc
2558 +--let base=156
2559 +--source include/query_response_time.inc
2560 +--let base=1000
2561 +--source include/query_response_time.inc
2562 +--let base=1001
2563 +--source include/query_response_time.inc
2564 +
2565 +SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
2566 +SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
2567 --- /dev/null
2568 +++ b/patch_info/response-time-distribution.info
2569 @@ -0,0 +1,9 @@
2570 +File=response-time-distribution.patch
2571 +Name=Response time distribution
2572 +Version=1.0
2573 +Author=Percona <info@percona.com>
2574 +License=GPL
2575 +Comment=
2576 +Changelog
2577 +2010-07-02 first version avaliable
2578 +2010-09-15 add column 'total'
2579 --- a/sql/CMakeLists.txt
2580 +++ b/sql/CMakeLists.txt
2581 @@ -51,7 +51,7 @@
2582                 message.h mf_iocache.cc my_decimal.cc ../sql-common/my_time.c
2583                 mysqld.cc net_serv.cc  keycaches.cc
2584                 ../sql-common/client_plugin.c
2585 -               opt_range.cc opt_range.h opt_sum.cc 
2586 +               opt_range.cc opt_range.h query_response_time.h opt_sum.cc 
2587                 ../sql-common/pack.c parse_file.cc password.c procedure.cc 
2588                 protocol.cc records.cc repl_failsafe.cc rpl_filter.cc set_var.cc 
2589                 slave.cc sp.cc sp_cache.cc sp_head.cc sp_pcontext.cc 
2590 @@ -59,7 +59,7 @@
2591                 sql_cache.cc sql_class.cc sql_client.cc sql_crypt.cc sql_crypt.h 
2592                 sql_cursor.cc sql_db.cc sql_delete.cc sql_derived.cc sql_do.cc 
2593                 sql_error.cc sql_handler.cc sql_help.cc sql_insert.cc sql_lex.cc 
2594 -               sql_list.cc sql_load.cc sql_manager.cc sql_parse.cc
2595 +               sql_list.cc sql_load.cc sql_manager.cc sql_parse.cc query_response_time.cc
2596                 sql_partition.cc sql_plugin.cc sql_prepare.cc sql_rename.cc 
2597                 debug_sync.cc debug_sync.h
2598                 sql_repl.cc sql_select.cc sql_show.cc sql_state.c sql_string.cc 
2599 --- a/sql/handler.h
2600 +++ b/sql/handler.h
2601 @@ -581,6 +581,7 @@
2602    SCH_PROFILES,
2603    SCH_REFERENTIAL_CONSTRAINTS,
2604    SCH_PROCEDURES,
2605 +  SCH_QUERY_RESPONSE_TIME,
2606    SCH_SCHEMATA,
2607    SCH_SCHEMA_PRIVILEGES,
2608    SCH_SESSION_STATUS,
2609 --- a/sql/lex.h
2610 +++ b/sql/lex.h
2611 @@ -426,6 +426,7 @@
2612    { "PURGE",           SYM(PURGE)},
2613    { "QUARTER",          SYM(QUARTER_SYM)},
2614    { "QUERY",           SYM(QUERY_SYM)},
2615 +  { "QUERY_RESPONSE_TIME", SYM(QUERY_RESPONSE_TIME_SYM)},
2616    { "QUICK",           SYM(QUICK)},
2617    { "RANGE",            SYM(RANGE_SYM)},
2618    { "READ",            SYM(READ_SYM)},
2619 --- a/sql/mysqld.cc
2620 +++ b/sql/mysqld.cc
2621 @@ -69,6 +69,8 @@
2622  #include "debug_sync.h"
2623  #include "sql_callback.h"
2624  
2625 +#include "query_response_time.h"
2626 +
2627  #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
2628  #include "../storage/perfschema/pfs_server.h"
2629  #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
2630 @@ -611,7 +613,7 @@
2631  MY_LOCALE *my_default_lc_messages;
2632  MY_LOCALE *my_default_lc_time_names;
2633  
2634 -SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen, have_query_cache;
2635 +SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen, have_query_cache, have_response_time_distribution;
2636  SHOW_COMP_OPTION have_geometry, have_rtree_keys;
2637  SHOW_COMP_OPTION have_crypt, have_compress;
2638  SHOW_COMP_OPTION have_profiling;
2639 @@ -912,6 +914,10 @@
2640  my_bool opt_enable_shared_memory;
2641  HANDLE smem_event_connect_request= 0;
2642  #endif
2643 +#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
2644 +ulong   opt_query_response_time_range_base  = QRT_DEFAULT_BASE;
2645 +my_bool opt_query_response_time_stats= 0;
2646 +#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
2647  
2648  my_bool opt_use_ssl  = 0;
2649  char *opt_ssl_ca= NULL, *opt_ssl_capath= NULL, *opt_ssl_cert= NULL,
2650 @@ -1483,6 +1489,9 @@
2651    my_free(opt_bin_logname);
2652    bitmap_free(&temp_pool);
2653    free_max_user_conn();
2654 +#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
2655 +  query_response_time_free();
2656 +#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
2657  #ifdef HAVE_REPLICATION
2658    end_slave_list();
2659  #endif
2660 @@ -4010,6 +4019,9 @@
2661    if (!DEFAULT_ERRMSGS[0][0])
2662      unireg_abort(1);  
2663  
2664 +#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
2665 +  query_response_time_init();
2666 +#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
2667    /* We have to initialize the storage engines before CSV logging */
2668    if (ha_init())
2669    {
2670 @@ -6909,6 +6921,11 @@
2671  #else
2672    have_query_cache=SHOW_OPTION_NO;
2673  #endif
2674 +#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
2675 +  have_response_time_distribution= SHOW_OPTION_YES;
2676 +#else // HAVE_RESPONSE_TIME_DISTRIBUTION
2677 +  have_response_time_distribution= SHOW_OPTION_NO;
2678 +#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
2679  #ifdef HAVE_SPATIAL
2680    have_geometry=SHOW_OPTION_YES;
2681  #else
2682 --- a/sql/mysqld.h
2683 +++ b/sql/mysqld.h
2684 @@ -98,6 +98,10 @@
2685  extern bool opt_disable_networking, opt_skip_show_db;
2686  extern bool opt_skip_name_resolve;
2687  extern bool opt_ignore_builtin_innodb;
2688 +#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
2689 +extern ulong   opt_query_response_time_range_base;
2690 +extern my_bool opt_query_response_time_stats;
2691 +#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
2692  extern my_bool opt_character_set_client_handshake;
2693  extern bool volatile abort_loop;
2694  extern bool in_bootstrap;
2695 --- /dev/null
2696 +++ b/sql/query_response_time.cc
2697 @@ -0,0 +1,310 @@
2698 +#include "mysql_version.h"
2699 +#include "my_global.h"
2700 +#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
2701 +#include "mysql_com.h"
2702 +#include "rpl_tblmap.h"
2703 +#include "table.h"
2704 +#include "field.h"
2705 +#include "sql_show.h"
2706 +#include "query_response_time.h"
2707 +
2708 +#define TIME_STRING_POSITIVE_POWER_LENGTH QRT_TIME_STRING_POSITIVE_POWER_LENGTH
2709 +#define TIME_STRING_NEGATIVE_POWER_LENGTH 6
2710 +#define TOTAL_STRING_POSITIVE_POWER_LENGTH QRT_TOTAL_STRING_POSITIVE_POWER_LENGTH
2711 +#define TOTAL_STRING_NEGATIVE_POWER_LENGTH 6
2712 +#define MINIMUM_BASE 2
2713 +#define MAXIMUM_BASE QRT_MAXIMUM_BASE
2714 +#define POSITIVE_POWER_FILLER QRT_POSITIVE_POWER_FILLER
2715 +#define NEGATIVE_POWER_FILLER QRT_NEGATIVE_POWER_FILLER
2716 +#define STRING_OVERFLOW QRT_STRING_OVERFLOW
2717 +#define TIME_OVERFLOW   QRT_TIME_OVERFLOW
2718 +#define DEFAULT_BASE    QRT_DEFAULT_BASE
2719 +
2720 +#define do_xstr(s) do_str(s)
2721 +#define do_str(s) #s
2722 +#define do_format(filler,width) "%" filler width "lld"
2723 +/*
2724 +  Format strings for snprintf. Generate from:
2725 +  POSITIVE_POWER_FILLER and TIME_STRING_POSITIVE_POWER_LENGTH
2726 +  NEFATIVE_POWER_FILLER and TIME_STRING_NEGATIVE_POWER_LENGTH
2727 +*/
2728 +#define TIME_STRING_POSITIVE_POWER_FORMAT do_format(POSITIVE_POWER_FILLER,do_xstr(TIME_STRING_POSITIVE_POWER_LENGTH))
2729 +#define TIME_STRING_NEGATIVE_POWER_FORMAT do_format(NEGATIVE_POWER_FILLER,do_xstr(TIME_STRING_NEGATIVE_POWER_LENGTH))
2730 +#define TIME_STRING_FORMAT                   TIME_STRING_POSITIVE_POWER_FORMAT "." TIME_STRING_NEGATIVE_POWER_FORMAT
2731 +
2732 +#define TOTAL_STRING_POSITIVE_POWER_FORMAT do_format(POSITIVE_POWER_FILLER,do_xstr(TOTAL_STRING_POSITIVE_POWER_LENGTH))
2733 +#define TOTAL_STRING_NEGATIVE_POWER_FORMAT do_format(NEGATIVE_POWER_FILLER,do_xstr(TOTAL_STRING_NEGATIVE_POWER_LENGTH))
2734 +#define TOTAL_STRING_FORMAT                  TOTAL_STRING_POSITIVE_POWER_FORMAT "." TOTAL_STRING_NEGATIVE_POWER_FORMAT
2735 +
2736 +#define TIME_STRING_LENGTH     QRT_TIME_STRING_LENGTH
2737 +#define TIME_STRING_BUFFER_LENGTH      (TIME_STRING_LENGTH + 1 /* '\0' */)
2738 +
2739 +#define TOTAL_STRING_LENGTH    QRT_TOTAL_STRING_LENGTH
2740 +#define TOTAL_STRING_BUFFER_LENGTH     (TOTAL_STRING_LENGTH + 1 /* '\0' */)
2741 +
2742 +/*
2743 +  Calculate length of "log linear"
2744 +  1)
2745 +  (MINIMUM_BASE ^ result) <= (10 ^ STRING_POWER_LENGTH) < (MINIMUM_BASE ^ (result + 1))
2746 +
2747 +  2)
2748 +  (MINIMUM_BASE ^ result) <= (10 ^ STRING_POWER_LENGTH)
2749 +  and
2750 +  (MINIMUM_BASE ^ (result + 1)) > (10 ^ STRING_POWER_LENGTH)
2751 +
2752 +  3)
2753 +  result     <= LOG(MINIMUM_BASE, 10 ^ STRING_POWER_LENGTH)= STRING_POWER_LENGTH * LOG(MINIMUM_BASE,10)
2754 +  result + 1 >  LOG(MINIMUM_BASE, 10 ^ STRING_POWER_LENGTH)= STRING_POWER_LENGTH * LOG(MINIMUM_BASE,10)
2755 +
2756 +  4) STRING_POWER_LENGTH * LOG(MINIMUM_BASE,10) - 1 < result <= STRING_POWER_LENGTH * LOG(MINIMUM_BASE,10)
2757 +
2758 +  MINIMUM_BASE= 2 always, LOG(MINIMUM_BASE,10)= 3.3219280948873626, result= (int)3.3219280948873626 * STRING_POWER_LENGTH
2759 +
2760 +  Last counter always use for time overflow
2761 +*/
2762 +#define POSITIVE_POWER_COUNT ((int)(3.32192809 * TIME_STRING_POSITIVE_POWER_LENGTH))
2763 +#define NEGATIVE_POWER_COUNT ((int)(3.32192809 * TIME_STRING_NEGATIVE_POWER_LENGTH))
2764 +#define OVERALL_POWER_COUNT (NEGATIVE_POWER_COUNT + 1 + POSITIVE_POWER_COUNT)
2765 +
2766 +#define MILLION ((unsigned long)1000 * 1000)
2767 +
2768 +namespace query_response_time
2769 +{
2770 +
2771 +class utility
2772 +{
2773 +public:
2774 +  utility() : m_base(0)
2775 +  {
2776 +    m_max_dec_value= MILLION;
2777 +    for(int i= 0; TIME_STRING_POSITIVE_POWER_LENGTH > i; ++i)
2778 +      m_max_dec_value *= 10;
2779 +    setup(DEFAULT_BASE);
2780 +  }
2781 +public:
2782 +  uint      base()            const { return m_base; }
2783 +  uint      negative_count()  const { return m_negative_count; }
2784 +  uint      positive_count()  const { return m_positive_count; }
2785 +  uint      bound_count()     const { return m_bound_count; }
2786 +  ulonglong max_dec_value()   const { return m_max_dec_value; }
2787 +  ulonglong bound(uint index) const { return m_bound[ index ]; }
2788 +public:
2789 +  void setup(uint base)
2790 +  {
2791 +    if(base != m_base)
2792 +    {
2793 +      m_base= base;
2794 +
2795 +      const ulonglong million= 1000 * 1000;
2796 +      ulonglong value= million;
2797 +      m_negative_count= 0;
2798 +      while(value > 0)
2799 +      {
2800 +       m_negative_count += 1;
2801 +       value /= m_base;
2802 +      }
2803 +      m_negative_count -= 1;
2804 +
2805 +      value= million;
2806 +      m_positive_count= 0;
2807 +      while(value < m_max_dec_value)
2808 +      {
2809 +       m_positive_count += 1;
2810 +       value *= m_base;
2811 +      }
2812 +      m_bound_count= m_negative_count + m_positive_count;
2813 +
2814 +      value= million;
2815 +      for(uint i= 0; i < m_negative_count; ++i)
2816 +      {
2817 +       value /= m_base;
2818 +       m_bound[m_negative_count - i - 1]= value;
2819 +      }
2820 +      value= million;
2821 +      for(uint i= 0; i < m_positive_count;  ++i)
2822 +      {
2823 +       m_bound[m_negative_count + i]= value;
2824 +       value *= m_base;
2825 +      }
2826 +    }
2827 +  }
2828 +private:
2829 +  uint      m_base;
2830 +  uint      m_negative_count;
2831 +  uint      m_positive_count;
2832 +  uint      m_bound_count;
2833 +  ulonglong m_max_dec_value; /* for TIME_STRING_POSITIVE_POWER_LENGTH=7 is 10000000 */
2834 +  ulonglong m_bound[OVERALL_POWER_COUNT];
2835 +};
2836 +
2837 +void print_time(char* buffer, std::size_t buffer_size, std::size_t string_positive_power_length, const char* format, uint64 value)
2838 +{
2839 +  memset(buffer,'X',buffer_size);
2840 +  buffer[string_positive_power_length]= '.';
2841 +  ulonglong second=      (value / MILLION);
2842 +  ulonglong microsecond= (value % MILLION);
2843 +  std::size_t result_length= snprintf(buffer,buffer_size,format,second,microsecond);
2844 +  if(result_length < 0)
2845 +  {
2846 +    assert(sizeof(STRING_OVERFLOW) <= buffer_size);
2847 +    memcpy(buffer, STRING_OVERFLOW, sizeof(STRING_OVERFLOW));
2848 +    return;
2849 +  }
2850 +  buffer[result_length]= 0;
2851 +}
2852 +
2853 +class time_collector
2854 +{
2855 +public:
2856 +  time_collector(utility& u) : m_utility(&u)
2857 +  {
2858 +    my_atomic_rwlock_init(&time_collector_lock);
2859 +  }
2860 +  ~time_collector()
2861 +  {
2862 +    my_atomic_rwlock_destroy(&time_collector_lock);
2863 +  }
2864 +  uint32 count(uint index) const
2865 +  {
2866 +    my_atomic_rwlock_rdlock(&time_collector_lock);
2867 +    uint32 result= my_atomic_load32((volatile int32*)&m_count[index]);
2868 +    my_atomic_rwlock_rdunlock(&time_collector_lock);
2869 +    return result;
2870 +  }
2871 +  uint64 total(uint index) const
2872 +  {
2873 +    my_atomic_rwlock_rdlock(&time_collector_lock);
2874 +    uint64 result= my_atomic_load64((volatile int64*)&m_total[index]);
2875 +    my_atomic_rwlock_rdunlock(&time_collector_lock);
2876 +    return result;
2877 +  }
2878 +public:
2879 +  void flush()
2880 +  {
2881 +    my_atomic_rwlock_wrlock(&time_collector_lock);
2882 +    memset((void*)&m_count,0,sizeof(m_count));
2883 +    memset((void*)&m_total,0,sizeof(m_total));
2884 +    my_atomic_rwlock_wrunlock(&time_collector_lock);
2885 +  }
2886 +  void collect(uint64 time)
2887 +  {
2888 +    int i= 0;
2889 +    for(int count= m_utility->bound_count(); count > i; ++i)
2890 +    {
2891 +      if(m_utility->bound(i) > time)
2892 +      {
2893 +        my_atomic_rwlock_wrlock(&time_collector_lock);
2894 +        my_atomic_add32((volatile int32*)(&m_count[i]), 1);
2895 +        my_atomic_add64((volatile int64*)(&m_total[i]), time);
2896 +        my_atomic_rwlock_wrunlock(&time_collector_lock);
2897 +        break;
2898 +      }
2899 +    }
2900 +  }
2901 +private:
2902 +  utility* m_utility;
2903 +  /* The lock for atomic operations on m_count and m_total.  Only actually
2904 +  used on architectures that do not have atomic implementation of atomic
2905 +  operations. */
2906 +  my_atomic_rwlock_t time_collector_lock;
2907 +  volatile uint32   m_count[OVERALL_POWER_COUNT + 1];
2908 +  volatile uint64   m_total[OVERALL_POWER_COUNT + 1];
2909 +};
2910 +
2911 +class collector
2912 +{
2913 +public:
2914 +  collector() : m_time(m_utility)
2915 +  {
2916 +    m_utility.setup(DEFAULT_BASE);
2917 +    m_time.flush();
2918 +  }
2919 +public:
2920 +  void flush()
2921 +  {
2922 +    m_utility.setup(opt_query_response_time_range_base);
2923 +    m_time.flush();
2924 +  }
2925 +  int fill(THD* thd, TABLE_LIST *tables, COND *cond)
2926 +  {
2927 +    DBUG_ENTER("fill_schema_query_response_time");
2928 +    TABLE        *table= static_cast<TABLE*>(tables->table);
2929 +    Field        **fields= table->field;
2930 +    for(uint i= 0, count= bound_count() + 1 /* with overflow */; count > i; ++i)
2931 +    {
2932 +      char time[TIME_STRING_BUFFER_LENGTH];
2933 +      char total[TOTAL_STRING_BUFFER_LENGTH];
2934 +      if(i == bound_count())
2935 +      {        
2936 +        assert(sizeof(TIME_OVERFLOW) <= TIME_STRING_BUFFER_LENGTH);
2937 +        assert(sizeof(TIME_OVERFLOW) <= TOTAL_STRING_BUFFER_LENGTH);
2938 +        memcpy(time,TIME_OVERFLOW,sizeof(TIME_OVERFLOW));
2939 +        memcpy(total,TIME_OVERFLOW,sizeof(TIME_OVERFLOW));
2940 +      }
2941 +      else
2942 +      {
2943 +        print_time(time,sizeof(time),TIME_STRING_POSITIVE_POWER_LENGTH,TIME_STRING_FORMAT,this->bound(i));
2944 +        print_time(total,sizeof(total),TOTAL_STRING_POSITIVE_POWER_LENGTH,TOTAL_STRING_FORMAT,this->total(i));
2945 +      }
2946 +      fields[0]->store(time,strlen(time),system_charset_info);
2947 +      fields[1]->store(this->count(i));
2948 +      fields[2]->store(total,strlen(total),system_charset_info);
2949 +      if (schema_table_store_record(thd, table))
2950 +      {
2951 +       DBUG_RETURN(1);
2952 +      }
2953 +    }
2954 +    DBUG_RETURN(0);
2955 +  }
2956 +  void collect(ulonglong time)
2957 +  {
2958 +    m_time.collect(time);
2959 +  }
2960 +  uint bound_count() const
2961 +  {
2962 +    return m_utility.bound_count();
2963 +  }
2964 +  ulonglong bound(uint index)
2965 +  {
2966 +    return m_utility.bound(index);
2967 +  }
2968 +  ulonglong count(uint index)
2969 +  {
2970 +    return m_time.count(index);
2971 +  }
2972 +  ulonglong total(uint index)
2973 +  {
2974 +    return m_time.total(index);
2975 +  }
2976 +private:
2977 +  utility          m_utility;
2978 +  time_collector   m_time;
2979 +};
2980 +
2981 +static collector g_collector;
2982 +
2983 +} // namespace query_response_time
2984 +
2985 +void query_response_time_init()
2986 +{
2987 +}
2988 +
2989 +void query_response_time_free()
2990 +{
2991 +  query_response_time::g_collector.flush();
2992 +}
2993 +
2994 +void query_response_time_flush()
2995 +{
2996 +  query_response_time::g_collector.flush();
2997 +}
2998 +void query_response_time_collect(ulonglong query_time)
2999 +{
3000 +  query_response_time::g_collector.collect(query_time);
3001 +}
3002 +
3003 +int query_response_time_fill(THD* thd, TABLE_LIST *tables, COND *cond)
3004 +{
3005 +  return query_response_time::g_collector.fill(thd,tables,cond);
3006 +}
3007 +#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
3008 --- /dev/null
3009 +++ b/sql/query_response_time.h
3010 @@ -0,0 +1,71 @@
3011 +#ifndef QUERY_RESPONSE_TIME_H
3012 +#define QUERY_RESPONSE_TIME_H
3013 +
3014 +/*
3015 +  Settings for query response time
3016 +*/
3017 +
3018 +/*
3019 +  Maximum string length for (10 ^ (-1 * QRT_STRING_NEGATIVE_POWER_LENGTH)) in text representation.
3020 +  Example: for 6 is 0.000001
3021 +  Always 2
3022 +
3023 +  Maximum string length for (10 ^ (QRT_STRING_POSITIVE_POWER_LENGTH + 1) - 1) in text representation.
3024 +  Example: for 7 is 9999999.0
3025 +*/
3026 +#define QRT_TIME_STRING_POSITIVE_POWER_LENGTH 7
3027 +#define QRT_TOTAL_STRING_POSITIVE_POWER_LENGTH 7
3028 +
3029 +/*
3030 +  Minimum base for log - ALWAYS 2
3031 +  Maximum base for log:
3032 +*/
3033 +#define QRT_MAXIMUM_BASE 1000
3034 +
3035 +/*
3036 +  Filler for whole number (positive power)
3037 +  Example: for
3038 +  QRT_POSITIVE_POWER_FILLER ' '
3039 +  QRT_POSITIVE_POWER_LENGTH 7
3040 +  and number 7234 result is:
3041 +  '   7234'
3042 +*/
3043 +#define QRT_POSITIVE_POWER_FILLER " "
3044 +/*
3045 +  Filler for fractional number. Similiary to whole number
3046 +*/
3047 +#define QRT_NEGATIVE_POWER_FILLER "0"
3048 +
3049 +/*
3050 +  Message if string overflow (string overflow - internal error, this string say about bug in QRT)
3051 +*/
3052 +#define QRT_STRING_OVERFLOW "TOO BIG STRING"
3053 +
3054 +/*
3055 +  Message if time too big for statistic collecting (very long query)
3056 +*/
3057 +#define QRT_TIME_OVERFLOW "TOO LONG"
3058 +
3059 +#define QRT_DEFAULT_BASE 10
3060 +
3061 +#define QRT_TIME_STRING_LENGTH                         \
3062 +  max( (QRT_TIME_STRING_POSITIVE_POWER_LENGTH + 1 /* '.' */ + 6 /*QRT_TIME_STRING_NEGATIVE_POWER_LENGTH*/), \
3063 +       max( (sizeof(QRT_TIME_OVERFLOW) - 1),           \
3064 +           (sizeof(QRT_STRING_OVERFLOW) - 1) ) )
3065 +
3066 +#define QRT_TOTAL_STRING_LENGTH                                \
3067 +  max( (QRT_TOTAL_STRING_POSITIVE_POWER_LENGTH + 1 /* '.' */ + 6 /*QRT_TOTAL_STRING_NEGATIVE_POWER_LENGTH*/), \
3068 +       max( (sizeof(QRT_TIME_OVERFLOW) - 1),           \
3069 +           (sizeof(QRT_STRING_OVERFLOW) - 1) ) )
3070 +
3071 +extern ST_SCHEMA_TABLE query_response_time_table;
3072 +
3073 +#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
3074 +extern void query_response_time_init   ();
3075 +extern void query_response_time_free   ();
3076 +extern void query_response_time_flush  ();
3077 +extern void query_response_time_collect(ulonglong query_time);
3078 +extern int  query_response_time_fill   (THD* thd, TABLE_LIST *tables, COND *cond);
3079 +#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
3080 +
3081 +#endif // QUERY_RESPONSE_TIME_H
3082 --- a/sql/set_var.h
3083 +++ b/sql/set_var.h
3084 @@ -293,6 +293,7 @@
3085  
3086  extern SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen;
3087  extern SHOW_COMP_OPTION have_query_cache;
3088 +extern SHOW_COMP_OPTION have_response_time_distribution;
3089  extern SHOW_COMP_OPTION have_geometry, have_rtree_keys;
3090  extern SHOW_COMP_OPTION have_crypt;
3091  extern SHOW_COMP_OPTION have_compress;
3092 --- a/sql/sql_parse.cc
3093 +++ b/sql/sql_parse.cc
3094 @@ -88,6 +88,7 @@
3095  #include "sp_cache.h"
3096  #include "events.h"
3097  #include "sql_trigger.h"
3098 +#include "query_response_time.h"
3099  #include "transaction.h"
3100  #include "sql_audit.h"
3101  #include "sql_prepare.h"
3102 @@ -1507,6 +1508,7 @@
3103  
3104    ulonglong end_utime_of_query= thd->current_utime();
3105    ulonglong query_exec_time= get_query_exec_time(thd, end_utime_of_query);
3106 +  query_response_time_collect(query_exec_time);
3107  
3108    /*
3109      Low long_query_time value most likely means user is debugging stuff and even
3110 @@ -1671,6 +1673,7 @@
3111    case SCH_CHARSETS:
3112    case SCH_ENGINES:
3113    case SCH_COLLATIONS:
3114 +  case SCH_QUERY_RESPONSE_TIME:
3115    case SCH_COLLATION_CHARACTER_SET_APPLICABILITY:
3116    case SCH_USER_PRIVILEGES:
3117    case SCH_SCHEMA_PRIVILEGES:
3118 --- a/sql/sql_reload.cc
3119 +++ b/sql/sql_reload.cc
3120 @@ -25,7 +25,7 @@
3121  #include "hostname.h"    // hostname_cache_refresh
3122  #include "sql_repl.h"    // reset_master, reset_slave
3123  #include "debug_sync.h"
3124 -
3125 +#include "query_response_time.h"
3126  
3127  /**
3128    Reload/resets privileges and the different caches.
3129 @@ -296,6 +296,12 @@
3130  #endif
3131   if (options & REFRESH_USER_RESOURCES)
3132     reset_mqh((LEX_USER *) NULL, 0);             /* purecov: inspected */
3133 +#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
3134 + if (options & REFRESH_QUERY_RESPONSE_TIME)
3135 + {
3136 +   query_response_time_flush();
3137 + }
3138 +#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
3139   if (*write_to_binlog != -1)
3140     *write_to_binlog= tmp_write_to_binlog;
3141   /*
3142 --- a/sql/sql_show.cc
3143 +++ b/sql/sql_show.cc
3144 @@ -50,6 +50,7 @@
3145  #include "event_data_objects.h"
3146  #endif
3147  #include <my_dir.h>
3148 +#include "query_response_time.h"
3149  #include "lock.h"                           // MYSQL_OPEN_IGNORE_FLUSH
3150  #include "debug_sync.h"
3151  #include "datadict.h"   // dd_frm_type()
3152 @@ -7865,6 +7866,14 @@
3153  
3154  */
3155  
3156 +ST_FIELD_INFO query_response_time_fields_info[] =
3157 +  {
3158 +    {"time",  QRT_TIME_STRING_LENGTH,      MYSQL_TYPE_STRING,  0, 0,            "", SKIP_OPEN_TABLE },
3159 +    {"count", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE },
3160 +    {"total",  QRT_TIME_STRING_LENGTH,     MYSQL_TYPE_STRING,  0, 0,            "", SKIP_OPEN_TABLE },
3161 +    {0,       0,                           MYSQL_TYPE_STRING,  0, 0,             0, SKIP_OPEN_TABLE }
3162 +  };
3163 +
3164  ST_SCHEMA_TABLE schema_tables[]=
3165  {
3166    {"CHARACTER_SETS", charsets_fields_info, create_schema_table, 
3167 @@ -7918,6 +7927,13 @@
3168     1, 9, 0, OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
3169    {"ROUTINES", proc_fields_info, create_schema_table, 
3170     fill_schema_proc, make_proc_old_format, 0, -1, -1, 0, 0},
3171 +#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
3172 +  {"QUERY_RESPONSE_TIME", query_response_time_fields_info, create_schema_table, 
3173 +   query_response_time_fill, make_old_format, 0, -1, -1, 0, 0},
3174 +#else 
3175 +  {"QUERY_RESPONSE_TIME", query_response_time_fields_info, create_schema_table, 
3176 +   0, make_old_format, 0, -1, -1, 0, 0},
3177 +#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
3178    {"SCHEMATA", schema_fields_info, create_schema_table,
3179     fill_schema_schemata, make_schemata_old_format, 0, 1, -1, 0, 0},
3180    {"SCHEMA_PRIVILEGES", schema_privileges_fields_info, create_schema_table,
3181 --- a/sql/sql_yacc.yy
3182 +++ b/sql/sql_yacc.yy
3183 @@ -1194,6 +1194,7 @@
3184  %token  PURGE
3185  %token  QUARTER_SYM
3186  %token  QUERY_SYM
3187 +%token  QUERY_RESPONSE_TIME_SYM
3188  %token  QUICK
3189  %token  RANGE_SYM                     /* SQL-2003-R */
3190  %token  READS_SYM                     /* SQL-2003-R */
3191 @@ -11080,6 +11081,15 @@
3192            {
3193              Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
3194            }
3195 +        | QUERY_RESPONSE_TIME_SYM wild_and_where
3196 +         {
3197 +#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
3198 +           LEX *lex= Lex;
3199 +           lex->sql_command= SQLCOM_SELECT;
3200 +           if (prepare_schema_table(YYTHD, lex, 0, SCH_QUERY_RESPONSE_TIME))
3201 +             MYSQL_YYABORT;
3202 +#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
3203 +         }
3204          | CREATE PROCEDURE_SYM sp_name
3205            {
3206              LEX *lex= Lex;
3207 @@ -11316,6 +11326,12 @@
3208            { Lex->type|= REFRESH_STATUS; }
3209          | SLAVE
3210            { Lex->type|= REFRESH_SLAVE; }
3211 +        | QUERY_RESPONSE_TIME_SYM
3212 +          { 
3213 +#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
3214 +            Lex->type|= REFRESH_QUERY_RESPONSE_TIME;
3215 +#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
3216 +          }
3217          | MASTER_SYM
3218            { Lex->type|= REFRESH_MASTER; }
3219          | DES_KEY_FILE
3220 @@ -12617,6 +12633,7 @@
3221          | PROXY_SYM                {}
3222          | QUARTER_SYM              {}
3223          | QUERY_SYM                {}
3224 +        | QUERY_RESPONSE_TIME_SYM  {}
3225          | QUICK                    {}
3226          | READ_ONLY_SYM            {}
3227          | REBUILD_SYM              {}
3228 --- a/sql/sys_vars.cc
3229 +++ b/sql/sys_vars.cc
3230 @@ -49,6 +49,7 @@
3231  #include "../storage/perfschema/pfs_server.h"
3232  #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
3233  
3234 +#include "query_response_time.h" 
3235  /*
3236    This forward declaration is needed because including sql_base.h
3237    causes further includes.  [TODO] Eliminate this forward declaration
3238 @@ -1860,6 +1861,26 @@
3239         DEFAULT(FALSE));
3240  #endif /* HAVE_QUERY_CACHE */
3241  
3242 +
3243 +static Sys_var_have Sys_have_response_time_distribution(
3244 +       "have_response_time_distribution", "have_response_time_distribution",
3245 +       READ_ONLY GLOBAL_VAR(have_response_time_distribution), NO_CMD_LINE);
3246 +
3247 +#ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
3248 +static Sys_var_mybool Sys_query_response_time_stats(
3249 +       "query_response_time_stats", "Enable or disable query response time statisics collecting",
3250 +       GLOBAL_VAR(opt_query_response_time_stats), CMD_LINE(OPT_ARG),
3251 +       DEFAULT(FALSE));
3252 +
3253 +static Sys_var_ulong Sys_query_response_time_range_base(
3254 +       "query_response_time_range_base",
3255 +       "Select base of log for query_response_time ranges. WARNING: variable change affect only after flush",
3256 +       GLOBAL_VAR(opt_query_response_time_range_base),
3257 +       CMD_LINE(REQUIRED_ARG), VALID_RANGE(2, QRT_MAXIMUM_BASE),
3258 +       DEFAULT(QRT_DEFAULT_BASE),
3259 +       BLOCK_SIZE(1));
3260 +#endif // HAVE_RESPONSE_TIME_DISTRIBUTION
3261 +
3262  static Sys_var_mybool Sys_secure_auth(
3263         "secure_auth",
3264         "Disallow authentication for accounts that have old (pre-4.1) "
3265 --- /dev/null
3266 +++ b/mysql-test/r/have_response_time_distribution.require
3267 @@ -0,0 +1,2 @@
3268 +Variable_name  Value
3269 +have_response_time_distribution        YES
3270 --- a/include/atomic/x86-gcc.h  2011-05-11 14:54:11.000000000 +0300
3271 +++ b/include/atomic/x86-gcc.h  2011-07-21 16:20:24.563057000 +0300
3272 @@ -108,27 +108,22 @@
3273    v=tmp;
3274  
3275  /*
3276 -  On some platforms (e.g. Mac OS X and Solaris) the ebx register
3277 -  is held as a pointer to the global offset table. Thus we're not
3278 -  allowed to use the b-register on those platforms when compiling
3279 -  PIC code, to avoid this we push ebx and pop ebx. The new value
3280 -  is copied directly from memory to avoid problems with a implicit
3281 -  manipulation of the stack pointer by the push.
3282 -
3283    cmpxchg8b works on both 32-bit platforms and 64-bit platforms but
3284    the code here is only used on 32-bit platforms, on 64-bit
3285    platforms the much simpler make_atomic_cas_body32 will work
3286    fine.
3287  */
3288 -#define make_atomic_cas_body64                                    \
3289 -  asm volatile ("push %%ebx;"                                     \
3290 -                "movl (%%ecx), %%ebx;"                            \
3291 -                "movl 4(%%ecx), %%ecx;"                           \
3292 -                LOCK_prefix "; cmpxchg8b %0;"                     \
3293 -                "setz %2; pop %%ebx"                              \
3294 -                : "=m" (*a), "+A" (*cmp), "=c" (ret)              \
3295 -                : "c" (&set), "m" (*a)                            \
3296 -                : "memory", "esp")
3297 +#define make_atomic_cas_body64                                     \
3298 +  asm ("movl %%edi, -4(%%esp);"                                    \
3299 +       "leal %0, %%edi;"                                           \
3300 +       "xchgl %%ebx, %%esi;"                                       \
3301 +       LOCK_prefix "; cmpxchg8b (%%edi);"                          \
3302 +       "movl %%esi, %%ebx;"                                        \
3303 +       "movl -4(%%esp), %%edi;"                                    \
3304 +       "setz %1;"                                                  \
3305 +       : "+m" (*a), "=q" (ret), "+A" (*cmp)                        \
3306 +       : "S" ((int32)(set & 0xFFFFFFFF)), "c" ((int32)(set >> 32)) \
3307 +       : "flags")
3308  #endif
3309  
3310  /*
This page took 0.380193 seconds and 4 git commands to generate.