mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
62 lines
2.4 KiB
Text
62 lines
2.4 KiB
Text
|
--source include/have_response_time_distribution.inc
|
||
|
--source include/master-slave.inc
|
||
|
--source include/have_binlog_format_statement.inc
|
||
|
--source include/have_debug.inc
|
||
|
--disable_query_log
|
||
|
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement:");
|
||
|
--enable_query_log
|
||
|
|
||
|
connection master;
|
||
|
-- disable_warnings
|
||
|
DROP TABLE IF EXISTS t;
|
||
|
-- enable_warnings
|
||
|
CREATE TABLE t(id INT);
|
||
|
SELECT * from t;
|
||
|
|
||
|
sync_slave_with_master;
|
||
|
|
||
|
connection slave;
|
||
|
SELECT * from t;
|
||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
|
||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
|
||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||
|
source include/percona_query_response_time_flush.inc;
|
||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=ON;
|
||
|
|
||
|
connection master;
|
||
|
INSERT INTO t SELECT SLEEP(0.4);
|
||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||
|
INSERT INTO t SELECT SLEEP(0.4);
|
||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||
|
sync_slave_with_master;
|
||
|
|
||
|
connection slave;
|
||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||
|
|
||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
|
||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||
|
source include/percona_query_response_time_flush.inc;
|
||
|
|
||
|
connection master;
|
||
|
INSERT INTO t SELECT SLEEP(0.4);
|
||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||
|
INSERT INTO t SELECT SLEEP(0.4);
|
||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||
|
sync_slave_with_master;
|
||
|
|
||
|
connection slave;
|
||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||
|
|
||
|
connection master;
|
||
|
DROP TABLE IF EXISTS t;
|
||
|
sync_slave_with_master;
|
||
|
connection slave;
|
||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
|
||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=OFF;
|
||
|
|
||
|
STOP SLAVE;
|
||
|
-- source include/wait_for_slave_to_stop.inc
|