CREATE TABLE t(a INT);
CREATE PROCEDURE test_f(t INT)
BEGIN
SET SESSION query_response_time_exec_time_debug=t;
INSERT INTO t VALUES(1);
SET SESSION query_response_time_exec_time_debug=100000;
DELETE FROM t;
END^
SET SESSION query_response_time_exec_time_debug=100000;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
Warnings:
Warning	1292	Truncated incorrect query_response_time_range_base value: '1'
SET GLOBAL query_response_time_flush=1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(310000);
CALL test_f(320000);
CALL test_f(330000);
CALL test_f(340000);
CALL test_f(350000);
CALL test_f(360000);
CALL test_f(370000);
CALL test_f(380000);
CALL test_f(390000);
CALL test_f(400000);
CALL test_f(1100000);
CALL test_f(1200000);
CALL test_f(1300000);
CALL test_f(1500000);
CALL test_f(1400000);
CALL test_f(500000);
CALL test_f(2100000);
CALL test_f(2300000);
CALL test_f(2500000);
CALL test_f(3100000);
CALL test_f(4100000);
CALL test_f(5100000);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name	Value
query_response_time_range_base	2
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
TIME	COUNT	TOTAL
      0.000001	45	      0.000000
      0.000003	0	      0.000000
      0.000007	0	      0.000000
      0.000015	0	      0.000000
      0.000030	0	      0.000000
      0.000061	0	      0.000000
      0.000122	0	      0.000000
      0.000244	0	      0.000000
      0.000488	0	      0.000000
      0.000976	0	      0.000000
      0.001953	0	      0.000000
      0.003906	0	      0.000000
      0.007812	0	      0.000000
      0.015625	0	      0.000000
      0.031250	0	      0.000000
      0.062500	0	      0.000000
      0.125000	44	      4.400000
      0.250000	0	      0.000000
      0.500000	10	      3.550000
      1.000000	1	      0.500000
      2.000000	5	      6.500000
      4.000000	4	     10.000000
      8.000000	2	      9.200000
     16.000000	0	      0.000000
     32.000000	0	      0.000000
     64.000000	0	      0.000000
    128.000000	0	      0.000000
    256.000000	0	      0.000000
    512.000000	0	      0.000000
   1024.000000	0	      0.000000
   2048.000000	0	      0.000000
   4096.000000	0	      0.000000
   8192.000000	0	      0.000000
  16384.000000	0	      0.000000
  32768.000000	0	      0.000000
  65536.000000	0	      0.000000
 131072.000000	0	      0.000000
 262144.000000	0	      0.000000
 524288.000000	0	      0.000000
1048576.000000	0	      0.000000
2097152.000000	0	      0.000000
4194304.000000	0	      0.000000
8388608.000000	0	      0.000000
TOO LONG	0	TOO LONG
SET SESSION query_response_time_exec_time_debug=default;
SET SESSION query_response_time_exec_time_debug=100000;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
SET GLOBAL query_response_time_flush=1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(310000);
CALL test_f(320000);
CALL test_f(330000);
CALL test_f(340000);
CALL test_f(350000);
CALL test_f(360000);
CALL test_f(370000);
CALL test_f(380000);
CALL test_f(390000);
CALL test_f(400000);
CALL test_f(1100000);
CALL test_f(1200000);
CALL test_f(1300000);
CALL test_f(1500000);
CALL test_f(1400000);
CALL test_f(500000);
CALL test_f(2100000);
CALL test_f(2300000);
CALL test_f(2500000);
CALL test_f(3100000);
CALL test_f(4100000);
CALL test_f(5100000);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name	Value
query_response_time_range_base	2
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
TIME	COUNT	TOTAL
      0.000001	45	      0.000000
      0.000003	0	      0.000000
      0.000007	0	      0.000000
      0.000015	0	      0.000000
      0.000030	0	      0.000000
      0.000061	0	      0.000000
      0.000122	0	      0.000000
      0.000244	0	      0.000000
      0.000488	0	      0.000000
      0.000976	0	      0.000000
      0.001953	0	      0.000000
      0.003906	0	      0.000000
      0.007812	0	      0.000000
      0.015625	0	      0.000000
      0.031250	0	      0.000000
      0.062500	0	      0.000000
      0.125000	44	      4.400000
      0.250000	0	      0.000000
      0.500000	10	      3.550000
      1.000000	1	      0.500000
      2.000000	5	      6.500000
      4.000000	4	     10.000000
      8.000000	2	      9.200000
     16.000000	0	      0.000000
     32.000000	0	      0.000000
     64.000000	0	      0.000000
    128.000000	0	      0.000000
    256.000000	0	      0.000000
    512.000000	0	      0.000000
   1024.000000	0	      0.000000
   2048.000000	0	      0.000000
   4096.000000	0	      0.000000
   8192.000000	0	      0.000000
  16384.000000	0	      0.000000
  32768.000000	0	      0.000000
  65536.000000	0	      0.000000
 131072.000000	0	      0.000000
 262144.000000	0	      0.000000
 524288.000000	0	      0.000000
1048576.000000	0	      0.000000
2097152.000000	0	      0.000000
4194304.000000	0	      0.000000
8388608.000000	0	      0.000000
TOO LONG	0	TOO LONG
SET SESSION query_response_time_exec_time_debug=default;
SET SESSION query_response_time_exec_time_debug=100000;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
SET GLOBAL query_response_time_flush=1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(310000);
CALL test_f(320000);
CALL test_f(330000);
CALL test_f(340000);
CALL test_f(350000);
CALL test_f(360000);
CALL test_f(370000);
CALL test_f(380000);
CALL test_f(390000);
CALL test_f(400000);
CALL test_f(1100000);
CALL test_f(1200000);
CALL test_f(1300000);
CALL test_f(1500000);
CALL test_f(1400000);
CALL test_f(500000);
CALL test_f(2100000);
CALL test_f(2300000);
CALL test_f(2500000);
CALL test_f(3100000);
CALL test_f(4100000);
CALL test_f(5100000);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name	Value
query_response_time_range_base	10
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
TIME	COUNT	TOTAL
      0.000001	45	      0.000000
      0.000010	0	      0.000000
      0.000100	0	      0.000000
      0.001000	0	      0.000000
      0.010000	0	      0.000000
      0.100000	0	      0.000000
      1.000000	55	      8.450000
     10.000000	11	     25.700000
    100.000000	0	      0.000000
   1000.000000	0	      0.000000
  10000.000000	0	      0.000000
 100000.000000	0	      0.000000
1000000.000000	0	      0.000000
TOO LONG	0	TOO LONG
SET SESSION query_response_time_exec_time_debug=default;
SET SESSION query_response_time_exec_time_debug=100000;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
SET GLOBAL query_response_time_flush=1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(310000);
CALL test_f(320000);
CALL test_f(330000);
CALL test_f(340000);
CALL test_f(350000);
CALL test_f(360000);
CALL test_f(370000);
CALL test_f(380000);
CALL test_f(390000);
CALL test_f(400000);
CALL test_f(1100000);
CALL test_f(1200000);
CALL test_f(1300000);
CALL test_f(1500000);
CALL test_f(1400000);
CALL test_f(500000);
CALL test_f(2100000);
CALL test_f(2300000);
CALL test_f(2500000);
CALL test_f(3100000);
CALL test_f(4100000);
CALL test_f(5100000);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name	Value
query_response_time_range_base	7
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
TIME	COUNT	TOTAL
      0.000001	45	      0.000000
      0.000008	0	      0.000000
      0.000059	0	      0.000000
      0.000416	0	      0.000000
      0.002915	0	      0.000000
      0.020408	0	      0.000000
      0.142857	44	      4.400000
      1.000000	11	      4.050000
      7.000000	11	     25.700000
     49.000000	0	      0.000000
    343.000000	0	      0.000000
   2401.000000	0	      0.000000
  16807.000000	0	      0.000000
 117649.000000	0	      0.000000
 823543.000000	0	      0.000000
5764801.000000	0	      0.000000
TOO LONG	0	TOO LONG
SET SESSION query_response_time_exec_time_debug=default;
SET SESSION query_response_time_exec_time_debug=100000;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
SET GLOBAL query_response_time_flush=1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(310000);
CALL test_f(320000);
CALL test_f(330000);
CALL test_f(340000);
CALL test_f(350000);
CALL test_f(360000);
CALL test_f(370000);
CALL test_f(380000);
CALL test_f(390000);
CALL test_f(400000);
CALL test_f(1100000);
CALL test_f(1200000);
CALL test_f(1300000);
CALL test_f(1500000);
CALL test_f(1400000);
CALL test_f(500000);
CALL test_f(2100000);
CALL test_f(2300000);
CALL test_f(2500000);
CALL test_f(3100000);
CALL test_f(4100000);
CALL test_f(5100000);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name	Value
query_response_time_range_base	156
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
TIME	COUNT	TOTAL
      0.000041	45	      0.000000
      0.006410	0	      0.000000
      1.000000	55	      8.450000
    156.000000	11	     25.700000
  24336.000000	0	      0.000000
3796416.000000	0	      0.000000
TOO LONG	0	TOO LONG
SET SESSION query_response_time_exec_time_debug=default;
SET SESSION query_response_time_exec_time_debug=100000;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
SET GLOBAL query_response_time_flush=1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(310000);
CALL test_f(320000);
CALL test_f(330000);
CALL test_f(340000);
CALL test_f(350000);
CALL test_f(360000);
CALL test_f(370000);
CALL test_f(380000);
CALL test_f(390000);
CALL test_f(400000);
CALL test_f(1100000);
CALL test_f(1200000);
CALL test_f(1300000);
CALL test_f(1500000);
CALL test_f(1400000);
CALL test_f(500000);
CALL test_f(2100000);
CALL test_f(2300000);
CALL test_f(2500000);
CALL test_f(3100000);
CALL test_f(4100000);
CALL test_f(5100000);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name	Value
query_response_time_range_base	1000
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
TIME	COUNT	TOTAL
      0.000001	45	      0.000000
      0.001000	0	      0.000000
      1.000000	55	      8.450000
   1000.000000	11	     25.700000
1000000.000000	0	      0.000000
TOO LONG	0	TOO LONG
SET SESSION query_response_time_exec_time_debug=default;
SET SESSION query_response_time_exec_time_debug=100000;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
Warnings:
Warning	1292	Truncated incorrect query_response_time_range_base value: '1001'
SET GLOBAL query_response_time_flush=1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(310000);
CALL test_f(320000);
CALL test_f(330000);
CALL test_f(340000);
CALL test_f(350000);
CALL test_f(360000);
CALL test_f(370000);
CALL test_f(380000);
CALL test_f(390000);
CALL test_f(400000);
CALL test_f(1100000);
CALL test_f(1200000);
CALL test_f(1300000);
CALL test_f(1500000);
CALL test_f(1400000);
CALL test_f(500000);
CALL test_f(2100000);
CALL test_f(2300000);
CALL test_f(2500000);
CALL test_f(3100000);
CALL test_f(4100000);
CALL test_f(5100000);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name	Value
query_response_time_range_base	1000
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
TIME	COUNT	TOTAL
      0.000001	45	      0.000000
      0.001000	0	      0.000000
      1.000000	55	      8.450000
   1000.000000	11	     25.700000
1000000.000000	0	      0.000000
TOO LONG	0	TOO LONG
SET SESSION query_response_time_exec_time_debug=default;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
DROP PROCEDURE test_f;
DROP TABLE t;
