mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge XtraDB from Percona-Server 5.1.52-11.6 into MariaDB 5.1
revid:oleg.tsarev@percona.com-20101118145125-wjhjrb5jwhi0g7sj
This commit is contained in:
@ -1 +0,0 @@
|
||||
FLUSH QUERY_RESPONSE_TIME;
|
@ -1,8 +0,0 @@
|
||||
SELECT d.count,
|
||||
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
|
||||
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
|
||||
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
|
||||
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
@ -1,19 +0,0 @@
|
||||
SELECT SLEEP(0.31);
|
||||
SELECT SLEEP(0.32);
|
||||
SELECT SLEEP(0.33);
|
||||
SELECT SLEEP(0.34);
|
||||
SELECT SLEEP(0.35);
|
||||
SELECT SLEEP(0.36);
|
||||
SELECT SLEEP(0.37);
|
||||
SELECT SLEEP(0.38);
|
||||
SELECT SLEEP(0.39);
|
||||
SELECT SLEEP(0.40);
|
||||
SELECT SLEEP(1.1);
|
||||
SELECT SLEEP(1.2);
|
||||
SELECT SLEEP(1.3);
|
||||
SELECT SLEEP(1.5);
|
||||
SELECT SLEEP(1.4);
|
||||
SELECT SLEEP(0.5);
|
||||
SELECT SLEEP(2.1);
|
||||
SELECT SLEEP(2.3);
|
||||
SELECT SLEEP(2.5);
|
@ -1 +0,0 @@
|
||||
--innodb_buffer_pool_shm_key=123456
|
@ -1,6 +0,0 @@
|
||||
show variables like 'innodb_buffer_pool_shm%';
|
||||
Variable_name Value
|
||||
innodb_buffer_pool_shm_key 123456
|
||||
show variables like 'innodb_buffer_pool_shm%';
|
||||
Variable_name Value
|
||||
innodb_buffer_pool_shm_key 123456
|
@ -1,18 +0,0 @@
|
||||
--source include/have_innodb.inc
|
||||
show variables like 'innodb_buffer_pool_shm%';
|
||||
|
||||
#clean shutdown (restart_mysqld.inc is not clean if over 10 sec...)
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
wait
|
||||
EOF
|
||||
shutdown_server 120;
|
||||
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
restart
|
||||
EOF
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
--disable_reconnect
|
||||
|
||||
show variables like 'innodb_buffer_pool_shm%';
|
||||
--sleep 1
|
||||
--system ipcrm -M 123456
|
@ -1,15 +0,0 @@
|
||||
SET @old_max_connections = @@max_connections;
|
||||
SET @old_log_warnings = @@log_warnings;
|
||||
SET GLOBAL max_connections=2;
|
||||
SET GLOBAL LOG_WARNINGS = 0;
|
||||
connect(localhost,root,,test,port,socket);
|
||||
ERROR HY000: Too many connections
|
||||
SET GLOBAL LOG_WARNINGS = 1;
|
||||
connect(localhost,root,,test,port,socket);
|
||||
ERROR HY000: Too many connections
|
||||
SET GLOBAL LOG_WARNINGS = 0;
|
||||
connect(localhost,root,,test,port,socket);
|
||||
ERROR HY000: Too many connections
|
||||
SET GLOBAL max_connections = @old_max_connections;
|
||||
SET GLOBAL log_warnings = @old_log_warnings;
|
||||
1
|
@ -1,52 +0,0 @@
|
||||
--source include/not_embedded.inc
|
||||
|
||||
connect (main,localhost,root,,);
|
||||
connection main;
|
||||
SET @old_max_connections = @@max_connections;
|
||||
SET @old_log_warnings = @@log_warnings;
|
||||
SET GLOBAL max_connections=2;
|
||||
let $port=`SELECT Variable_value FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name LIKE 'port'`;
|
||||
let $socket=`SELECT Variable_value FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name LIKE 'socket'`;
|
||||
|
||||
SET GLOBAL LOG_WARNINGS = 0;
|
||||
--connect (conn0,localhost,root,,)
|
||||
connection conn0;
|
||||
replace_result $port port $socket socket;
|
||||
--error 1040
|
||||
--connect(conn1,localhost,root,,)
|
||||
disconnect conn0;
|
||||
SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
|
||||
|
||||
connection main;
|
||||
SET GLOBAL LOG_WARNINGS = 1;
|
||||
--connect (conn1,localhost,root,,)
|
||||
replace_result $port port $socket socket;
|
||||
--error 1040
|
||||
--connect (conn0,localhost,root,,)
|
||||
disconnect conn1;
|
||||
SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
|
||||
|
||||
connection main;
|
||||
SET GLOBAL LOG_WARNINGS = 0;
|
||||
--connect (conn0,localhost,root,,)
|
||||
replace_result $port port $socket socket;
|
||||
--error 1040
|
||||
--connect(conn1,localhost,root,,)
|
||||
disconnect conn0;
|
||||
SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
|
||||
|
||||
connection main;
|
||||
SET GLOBAL max_connections = @old_max_connections;
|
||||
SET GLOBAL log_warnings = @old_log_warnings;
|
||||
let $log_error_= `SELECT @@GLOBAL.log_error`;
|
||||
if(!`select LENGTH('$log_error_')`)
|
||||
{
|
||||
# MySQL Server on windows is started with --console and thus
|
||||
# does not know the location of its .err log, use default location
|
||||
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
}
|
||||
# Assign env variable LOG_ERROR
|
||||
let LOG_ERROR=$log_error_;
|
||||
|
||||
let cmd=cat $log_error | grep "Too many connections" | wc -l;
|
||||
exec $cmd;
|
@ -1,60 +0,0 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
DROP TABLE IF EXISTS t;
|
||||
CREATE TABLE t(id INT);
|
||||
SELECT * from t;
|
||||
id
|
||||
SELECT * from t;
|
||||
id
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 2
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 10
|
||||
FLUSH QUERY_RESPONSE_TIME;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=ON;
|
||||
INSERT INTO t VALUES(0);
|
||||
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
|
||||
0
|
||||
INSERT INTO t VALUES(1);
|
||||
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
|
||||
0
|
||||
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
|
||||
2
|
||||
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
|
||||
3
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 2
|
||||
FLUSH QUERY_RESPONSE_TIME;
|
||||
INSERT INTO t VALUES(0);
|
||||
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
|
||||
0
|
||||
INSERT INTO t VALUES(1);
|
||||
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
|
||||
0
|
||||
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
|
||||
2
|
||||
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
|
||||
3
|
||||
DROP TABLE IF EXISTS t;
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=OFF;
|
@ -1,52 +0,0 @@
|
||||
--source include/master-slave.inc
|
||||
|
||||
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 ENABLE_QUERY_RESPONSE_TIME_STATS=ON;
|
||||
|
||||
connection master;
|
||||
INSERT INTO t VALUES(0);
|
||||
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
INSERT INTO t VALUES(1);
|
||||
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 VALUES(0);
|
||||
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
INSERT INTO t VALUES(1);
|
||||
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 ENABLE_QUERY_RESPONSE_TIME_STATS=OFF;
|
@ -1,316 +0,0 @@
|
||||
CREATE FUNCTION test_f()
|
||||
RETURNS CHAR(30) DETERMINISTIC
|
||||
BEGIN
|
||||
DECLARE first VARCHAR(5);
|
||||
DECLARE second VARCHAR(5);
|
||||
DECLARE result VARCHAR(20);
|
||||
SELECT SLEEP(1.11) INTO first;
|
||||
SET first= 'Hello';
|
||||
SET second=', ';
|
||||
SET result= CONCAT(first,second);
|
||||
SET result= CONCAT(result,'world!');
|
||||
RETURN result;
|
||||
END/
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 2
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 2
|
||||
FLUSH QUERY_RESPONSE_TIME;
|
||||
SELECT d.count,
|
||||
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
|
||||
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
|
||||
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
|
||||
count query_count query_total not_zero_region_count region_count
|
||||
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
region_count
|
||||
44
|
||||
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
time
|
||||
0.000001
|
||||
0.000003
|
||||
0.000007
|
||||
0.000015
|
||||
0.000030
|
||||
0.000061
|
||||
0.000122
|
||||
0.000244
|
||||
0.000488
|
||||
0.000976
|
||||
0.001953
|
||||
0.003906
|
||||
0.007812
|
||||
0.015625
|
||||
0.031250
|
||||
0.062500
|
||||
0.125000
|
||||
0.250000
|
||||
0.500000
|
||||
1.000000
|
||||
2.000000
|
||||
4.000000
|
||||
8.000000
|
||||
16.000000
|
||||
32.000000
|
||||
64.000000
|
||||
128.000000
|
||||
256.000000
|
||||
512.000000
|
||||
1024.000000
|
||||
2048.000000
|
||||
4096.000000
|
||||
8192.000000
|
||||
16384.000000
|
||||
32768.000000
|
||||
65536.000000
|
||||
131072.000000
|
||||
262144.000000
|
||||
524288.000000
|
||||
1048576.00000
|
||||
2097152.00000
|
||||
4194304.00000
|
||||
8388608.00000
|
||||
TOO LONG
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT test_f();
|
||||
test_f()
|
||||
Hello, world!
|
||||
SELECT test_f();
|
||||
test_f()
|
||||
Hello, world!
|
||||
SELECT test_f();
|
||||
test_f()
|
||||
Hello, world!
|
||||
SELECT test_f();
|
||||
test_f()
|
||||
Hello, world!
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SELECT d.count,
|
||||
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
|
||||
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
|
||||
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
|
||||
count query_count query_total not_zero_region_count region_count
|
||||
1 5 4 2 44
|
||||
4 5 4 2 44
|
||||
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
region_count
|
||||
44
|
||||
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
time
|
||||
0.000001
|
||||
0.000003
|
||||
0.000007
|
||||
0.000015
|
||||
0.000030
|
||||
0.000061
|
||||
0.000122
|
||||
0.000244
|
||||
0.000488
|
||||
0.000976
|
||||
0.001953
|
||||
0.003906
|
||||
0.007812
|
||||
0.015625
|
||||
0.031250
|
||||
0.062500
|
||||
0.125000
|
||||
0.250000
|
||||
0.500000
|
||||
1.000000
|
||||
2.000000
|
||||
4.000000
|
||||
8.000000
|
||||
16.000000
|
||||
32.000000
|
||||
64.000000
|
||||
128.000000
|
||||
256.000000
|
||||
512.000000
|
||||
1024.000000
|
||||
2048.000000
|
||||
4096.000000
|
||||
8192.000000
|
||||
16384.000000
|
||||
32768.000000
|
||||
65536.000000
|
||||
131072.000000
|
||||
262144.000000
|
||||
524288.000000
|
||||
1048576.00000
|
||||
2097152.00000
|
||||
4194304.00000
|
||||
8388608.00000
|
||||
TOO LONG
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 2
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 10
|
||||
FLUSH QUERY_RESPONSE_TIME;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT test_f();
|
||||
test_f()
|
||||
Hello, world!
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SELECT d.count,
|
||||
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
|
||||
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
|
||||
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
|
||||
count query_count query_total not_zero_region_count region_count
|
||||
1 2 1 2 14
|
||||
1 2 1 2 14
|
||||
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
region_count
|
||||
14
|
||||
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
time
|
||||
0.000001
|
||||
0.000010
|
||||
0.000100
|
||||
0.001000
|
||||
0.010000
|
||||
0.100000
|
||||
1.000000
|
||||
10.000000
|
||||
100.000000
|
||||
1000.000000
|
||||
10000.000000
|
||||
100000.000000
|
||||
1000000.00000
|
||||
TOO LONG
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 10
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 7
|
||||
FLUSH QUERY_RESPONSE_TIME;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT test_f();
|
||||
test_f()
|
||||
Hello, world!
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SELECT d.count,
|
||||
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
|
||||
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
|
||||
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
|
||||
count query_count query_total not_zero_region_count region_count
|
||||
1 2 1 2 17
|
||||
1 2 1 2 17
|
||||
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
region_count
|
||||
17
|
||||
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
time
|
||||
0.000001
|
||||
0.000008
|
||||
0.000059
|
||||
0.000416
|
||||
0.002915
|
||||
0.020408
|
||||
0.142857
|
||||
1.000000
|
||||
7.000000
|
||||
49.000000
|
||||
343.000000
|
||||
2401.000000
|
||||
16807.000000
|
||||
117649.000000
|
||||
823543.000000
|
||||
5764801.00000
|
||||
TOO LONG
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 7
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 156
|
||||
FLUSH QUERY_RESPONSE_TIME;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT test_f();
|
||||
test_f()
|
||||
Hello, world!
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SELECT d.count,
|
||||
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
|
||||
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
|
||||
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
|
||||
count query_count query_total not_zero_region_count region_count
|
||||
1 2 1 2 7
|
||||
1 2 1 2 7
|
||||
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
region_count
|
||||
7
|
||||
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
time
|
||||
0.000041
|
||||
0.006410
|
||||
1.000000
|
||||
156.000000
|
||||
24336.000000
|
||||
3796416.00000
|
||||
TOO LONG
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 156
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 1000
|
||||
FLUSH QUERY_RESPONSE_TIME;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT test_f();
|
||||
test_f()
|
||||
Hello, world!
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SELECT d.count,
|
||||
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
|
||||
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
|
||||
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
|
||||
count query_count query_total not_zero_region_count region_count
|
||||
1 2 1 2 6
|
||||
1 2 1 2 6
|
||||
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
region_count
|
||||
6
|
||||
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
time
|
||||
0.000001
|
||||
0.001000
|
||||
1.000000
|
||||
1000.000000
|
||||
1000000.00000
|
||||
TOO LONG
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 1000
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 1000
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
|
||||
DROP FUNCTION test_f;
|
@ -1,87 +0,0 @@
|
||||
source include/have_innodb.inc;
|
||||
|
||||
delimiter /;
|
||||
CREATE FUNCTION test_f()
|
||||
RETURNS CHAR(30) DETERMINISTIC
|
||||
BEGIN
|
||||
DECLARE first VARCHAR(5);
|
||||
DECLARE second VARCHAR(5);
|
||||
DECLARE result VARCHAR(20);
|
||||
SELECT SLEEP(1.11) INTO first;
|
||||
SET first= 'Hello';
|
||||
SET second=', ';
|
||||
SET result= CONCAT(first,second);
|
||||
SET result= CONCAT(result,'world!');
|
||||
RETURN result;
|
||||
END/
|
||||
delimiter ;/
|
||||
|
||||
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 = 2;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
|
||||
source include/percona_query_response_time_flush.inc;
|
||||
source include/percona_query_response_time_show.inc;
|
||||
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT test_f();
|
||||
SELECT test_f();
|
||||
SELECT test_f();
|
||||
SELECT test_f();
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
|
||||
source include/percona_query_response_time_show.inc;
|
||||
|
||||
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 ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT test_f();
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
|
||||
source include/percona_query_response_time_show.inc;
|
||||
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
|
||||
source include/percona_query_response_time_flush.inc;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT test_f();
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
|
||||
source include/percona_query_response_time_show.inc;
|
||||
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
|
||||
source include/percona_query_response_time_flush.inc;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT test_f();
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
|
||||
source include/percona_query_response_time_show.inc;
|
||||
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
|
||||
source include/percona_query_response_time_flush.inc;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT test_f();
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
|
||||
source include/percona_query_response_time_show.inc;
|
||||
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
|
||||
|
||||
DROP FUNCTION test_f;
|
@ -1,570 +0,0 @@
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 2
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 2
|
||||
FLUSH QUERY_RESPONSE_TIME;
|
||||
SELECT d.count,
|
||||
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
|
||||
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
|
||||
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
|
||||
count query_count query_total not_zero_region_count region_count
|
||||
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
region_count
|
||||
44
|
||||
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
time
|
||||
0.000001
|
||||
0.000003
|
||||
0.000007
|
||||
0.000015
|
||||
0.000030
|
||||
0.000061
|
||||
0.000122
|
||||
0.000244
|
||||
0.000488
|
||||
0.000976
|
||||
0.001953
|
||||
0.003906
|
||||
0.007812
|
||||
0.015625
|
||||
0.031250
|
||||
0.062500
|
||||
0.125000
|
||||
0.250000
|
||||
0.500000
|
||||
1.000000
|
||||
2.000000
|
||||
4.000000
|
||||
8.000000
|
||||
16.000000
|
||||
32.000000
|
||||
64.000000
|
||||
128.000000
|
||||
256.000000
|
||||
512.000000
|
||||
1024.000000
|
||||
2048.000000
|
||||
4096.000000
|
||||
8192.000000
|
||||
16384.000000
|
||||
32768.000000
|
||||
65536.000000
|
||||
131072.000000
|
||||
262144.000000
|
||||
524288.000000
|
||||
1048576.00000
|
||||
2097152.00000
|
||||
4194304.00000
|
||||
8388608.00000
|
||||
TOO LONG
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT SLEEP(0.31);
|
||||
SLEEP(0.31)
|
||||
0
|
||||
SELECT SLEEP(0.32);
|
||||
SLEEP(0.32)
|
||||
0
|
||||
SELECT SLEEP(0.33);
|
||||
SLEEP(0.33)
|
||||
0
|
||||
SELECT SLEEP(0.34);
|
||||
SLEEP(0.34)
|
||||
0
|
||||
SELECT SLEEP(0.35);
|
||||
SLEEP(0.35)
|
||||
0
|
||||
SELECT SLEEP(0.36);
|
||||
SLEEP(0.36)
|
||||
0
|
||||
SELECT SLEEP(0.37);
|
||||
SLEEP(0.37)
|
||||
0
|
||||
SELECT SLEEP(0.38);
|
||||
SLEEP(0.38)
|
||||
0
|
||||
SELECT SLEEP(0.39);
|
||||
SLEEP(0.39)
|
||||
0
|
||||
SELECT SLEEP(0.40);
|
||||
SLEEP(0.40)
|
||||
0
|
||||
SELECT SLEEP(1.1);
|
||||
SLEEP(1.1)
|
||||
0
|
||||
SELECT SLEEP(1.2);
|
||||
SLEEP(1.2)
|
||||
0
|
||||
SELECT SLEEP(1.3);
|
||||
SLEEP(1.3)
|
||||
0
|
||||
SELECT SLEEP(1.5);
|
||||
SLEEP(1.5)
|
||||
0
|
||||
SELECT SLEEP(1.4);
|
||||
SLEEP(1.4)
|
||||
0
|
||||
SELECT SLEEP(0.5);
|
||||
SLEEP(0.5)
|
||||
0
|
||||
SELECT SLEEP(2.1);
|
||||
SLEEP(2.1)
|
||||
0
|
||||
SELECT SLEEP(2.3);
|
||||
SLEEP(2.3)
|
||||
0
|
||||
SELECT SLEEP(2.5);
|
||||
SLEEP(2.5)
|
||||
0
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SELECT d.count,
|
||||
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
|
||||
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
|
||||
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
|
||||
count query_count query_total not_zero_region_count region_count
|
||||
1 20 15 5 44
|
||||
10 20 15 5 44
|
||||
1 20 15 5 44
|
||||
5 20 15 5 44
|
||||
3 20 15 5 44
|
||||
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
region_count
|
||||
44
|
||||
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
time
|
||||
0.000001
|
||||
0.000003
|
||||
0.000007
|
||||
0.000015
|
||||
0.000030
|
||||
0.000061
|
||||
0.000122
|
||||
0.000244
|
||||
0.000488
|
||||
0.000976
|
||||
0.001953
|
||||
0.003906
|
||||
0.007812
|
||||
0.015625
|
||||
0.031250
|
||||
0.062500
|
||||
0.125000
|
||||
0.250000
|
||||
0.500000
|
||||
1.000000
|
||||
2.000000
|
||||
4.000000
|
||||
8.000000
|
||||
16.000000
|
||||
32.000000
|
||||
64.000000
|
||||
128.000000
|
||||
256.000000
|
||||
512.000000
|
||||
1024.000000
|
||||
2048.000000
|
||||
4096.000000
|
||||
8192.000000
|
||||
16384.000000
|
||||
32768.000000
|
||||
65536.000000
|
||||
131072.000000
|
||||
262144.000000
|
||||
524288.000000
|
||||
1048576.00000
|
||||
2097152.00000
|
||||
4194304.00000
|
||||
8388608.00000
|
||||
TOO LONG
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 2
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 10
|
||||
FLUSH QUERY_RESPONSE_TIME;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT SLEEP(0.31);
|
||||
SLEEP(0.31)
|
||||
0
|
||||
SELECT SLEEP(0.32);
|
||||
SLEEP(0.32)
|
||||
0
|
||||
SELECT SLEEP(0.33);
|
||||
SLEEP(0.33)
|
||||
0
|
||||
SELECT SLEEP(0.34);
|
||||
SLEEP(0.34)
|
||||
0
|
||||
SELECT SLEEP(0.35);
|
||||
SLEEP(0.35)
|
||||
0
|
||||
SELECT SLEEP(0.36);
|
||||
SLEEP(0.36)
|
||||
0
|
||||
SELECT SLEEP(0.37);
|
||||
SLEEP(0.37)
|
||||
0
|
||||
SELECT SLEEP(0.38);
|
||||
SLEEP(0.38)
|
||||
0
|
||||
SELECT SLEEP(0.39);
|
||||
SLEEP(0.39)
|
||||
0
|
||||
SELECT SLEEP(0.40);
|
||||
SLEEP(0.40)
|
||||
0
|
||||
SELECT SLEEP(1.1);
|
||||
SLEEP(1.1)
|
||||
0
|
||||
SELECT SLEEP(1.2);
|
||||
SLEEP(1.2)
|
||||
0
|
||||
SELECT SLEEP(1.3);
|
||||
SLEEP(1.3)
|
||||
0
|
||||
SELECT SLEEP(1.5);
|
||||
SLEEP(1.5)
|
||||
0
|
||||
SELECT SLEEP(1.4);
|
||||
SLEEP(1.4)
|
||||
0
|
||||
SELECT SLEEP(0.5);
|
||||
SLEEP(0.5)
|
||||
0
|
||||
SELECT SLEEP(2.1);
|
||||
SLEEP(2.1)
|
||||
0
|
||||
SELECT SLEEP(2.3);
|
||||
SLEEP(2.3)
|
||||
0
|
||||
SELECT SLEEP(2.5);
|
||||
SLEEP(2.5)
|
||||
0
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SELECT d.count,
|
||||
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
|
||||
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
|
||||
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
|
||||
count query_count query_total not_zero_region_count region_count
|
||||
1 20 17 3 14
|
||||
11 20 17 3 14
|
||||
8 20 17 3 14
|
||||
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
region_count
|
||||
14
|
||||
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
time
|
||||
0.000001
|
||||
0.000010
|
||||
0.000100
|
||||
0.001000
|
||||
0.010000
|
||||
0.100000
|
||||
1.000000
|
||||
10.000000
|
||||
100.000000
|
||||
1000.000000
|
||||
10000.000000
|
||||
100000.000000
|
||||
1000000.00000
|
||||
TOO LONG
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 10
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 7
|
||||
FLUSH QUERY_RESPONSE_TIME;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT SLEEP(0.31);
|
||||
SLEEP(0.31)
|
||||
0
|
||||
SELECT SLEEP(0.32);
|
||||
SLEEP(0.32)
|
||||
0
|
||||
SELECT SLEEP(0.33);
|
||||
SLEEP(0.33)
|
||||
0
|
||||
SELECT SLEEP(0.34);
|
||||
SLEEP(0.34)
|
||||
0
|
||||
SELECT SLEEP(0.35);
|
||||
SLEEP(0.35)
|
||||
0
|
||||
SELECT SLEEP(0.36);
|
||||
SLEEP(0.36)
|
||||
0
|
||||
SELECT SLEEP(0.37);
|
||||
SLEEP(0.37)
|
||||
0
|
||||
SELECT SLEEP(0.38);
|
||||
SLEEP(0.38)
|
||||
0
|
||||
SELECT SLEEP(0.39);
|
||||
SLEEP(0.39)
|
||||
0
|
||||
SELECT SLEEP(0.40);
|
||||
SLEEP(0.40)
|
||||
0
|
||||
SELECT SLEEP(1.1);
|
||||
SLEEP(1.1)
|
||||
0
|
||||
SELECT SLEEP(1.2);
|
||||
SLEEP(1.2)
|
||||
0
|
||||
SELECT SLEEP(1.3);
|
||||
SLEEP(1.3)
|
||||
0
|
||||
SELECT SLEEP(1.5);
|
||||
SLEEP(1.5)
|
||||
0
|
||||
SELECT SLEEP(1.4);
|
||||
SLEEP(1.4)
|
||||
0
|
||||
SELECT SLEEP(0.5);
|
||||
SLEEP(0.5)
|
||||
0
|
||||
SELECT SLEEP(2.1);
|
||||
SLEEP(2.1)
|
||||
0
|
||||
SELECT SLEEP(2.3);
|
||||
SLEEP(2.3)
|
||||
0
|
||||
SELECT SLEEP(2.5);
|
||||
SLEEP(2.5)
|
||||
0
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SELECT d.count,
|
||||
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
|
||||
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
|
||||
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
|
||||
count query_count query_total not_zero_region_count region_count
|
||||
1 20 17 3 17
|
||||
11 20 17 3 17
|
||||
8 20 17 3 17
|
||||
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
region_count
|
||||
17
|
||||
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
time
|
||||
0.000001
|
||||
0.000008
|
||||
0.000059
|
||||
0.000416
|
||||
0.002915
|
||||
0.020408
|
||||
0.142857
|
||||
1.000000
|
||||
7.000000
|
||||
49.000000
|
||||
343.000000
|
||||
2401.000000
|
||||
16807.000000
|
||||
117649.000000
|
||||
823543.000000
|
||||
5764801.00000
|
||||
TOO LONG
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 7
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 156
|
||||
FLUSH QUERY_RESPONSE_TIME;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT SLEEP(0.31);
|
||||
SLEEP(0.31)
|
||||
0
|
||||
SELECT SLEEP(0.32);
|
||||
SLEEP(0.32)
|
||||
0
|
||||
SELECT SLEEP(0.33);
|
||||
SLEEP(0.33)
|
||||
0
|
||||
SELECT SLEEP(0.34);
|
||||
SLEEP(0.34)
|
||||
0
|
||||
SELECT SLEEP(0.35);
|
||||
SLEEP(0.35)
|
||||
0
|
||||
SELECT SLEEP(0.36);
|
||||
SLEEP(0.36)
|
||||
0
|
||||
SELECT SLEEP(0.37);
|
||||
SLEEP(0.37)
|
||||
0
|
||||
SELECT SLEEP(0.38);
|
||||
SLEEP(0.38)
|
||||
0
|
||||
SELECT SLEEP(0.39);
|
||||
SLEEP(0.39)
|
||||
0
|
||||
SELECT SLEEP(0.40);
|
||||
SLEEP(0.40)
|
||||
0
|
||||
SELECT SLEEP(1.1);
|
||||
SLEEP(1.1)
|
||||
0
|
||||
SELECT SLEEP(1.2);
|
||||
SLEEP(1.2)
|
||||
0
|
||||
SELECT SLEEP(1.3);
|
||||
SLEEP(1.3)
|
||||
0
|
||||
SELECT SLEEP(1.5);
|
||||
SLEEP(1.5)
|
||||
0
|
||||
SELECT SLEEP(1.4);
|
||||
SLEEP(1.4)
|
||||
0
|
||||
SELECT SLEEP(0.5);
|
||||
SLEEP(0.5)
|
||||
0
|
||||
SELECT SLEEP(2.1);
|
||||
SLEEP(2.1)
|
||||
0
|
||||
SELECT SLEEP(2.3);
|
||||
SLEEP(2.3)
|
||||
0
|
||||
SELECT SLEEP(2.5);
|
||||
SLEEP(2.5)
|
||||
0
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SELECT d.count,
|
||||
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
|
||||
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
|
||||
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
|
||||
count query_count query_total not_zero_region_count region_count
|
||||
1 20 17 3 7
|
||||
11 20 17 3 7
|
||||
8 20 17 3 7
|
||||
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
region_count
|
||||
7
|
||||
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
time
|
||||
0.000041
|
||||
0.006410
|
||||
1.000000
|
||||
156.000000
|
||||
24336.000000
|
||||
3796416.00000
|
||||
TOO LONG
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 156
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 1000
|
||||
FLUSH QUERY_RESPONSE_TIME;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
SELECT SLEEP(0.31);
|
||||
SLEEP(0.31)
|
||||
0
|
||||
SELECT SLEEP(0.32);
|
||||
SLEEP(0.32)
|
||||
0
|
||||
SELECT SLEEP(0.33);
|
||||
SLEEP(0.33)
|
||||
0
|
||||
SELECT SLEEP(0.34);
|
||||
SLEEP(0.34)
|
||||
0
|
||||
SELECT SLEEP(0.35);
|
||||
SLEEP(0.35)
|
||||
0
|
||||
SELECT SLEEP(0.36);
|
||||
SLEEP(0.36)
|
||||
0
|
||||
SELECT SLEEP(0.37);
|
||||
SLEEP(0.37)
|
||||
0
|
||||
SELECT SLEEP(0.38);
|
||||
SLEEP(0.38)
|
||||
0
|
||||
SELECT SLEEP(0.39);
|
||||
SLEEP(0.39)
|
||||
0
|
||||
SELECT SLEEP(0.40);
|
||||
SLEEP(0.40)
|
||||
0
|
||||
SELECT SLEEP(1.1);
|
||||
SLEEP(1.1)
|
||||
0
|
||||
SELECT SLEEP(1.2);
|
||||
SLEEP(1.2)
|
||||
0
|
||||
SELECT SLEEP(1.3);
|
||||
SLEEP(1.3)
|
||||
0
|
||||
SELECT SLEEP(1.5);
|
||||
SLEEP(1.5)
|
||||
0
|
||||
SELECT SLEEP(1.4);
|
||||
SLEEP(1.4)
|
||||
0
|
||||
SELECT SLEEP(0.5);
|
||||
SLEEP(0.5)
|
||||
0
|
||||
SELECT SLEEP(2.1);
|
||||
SLEEP(2.1)
|
||||
0
|
||||
SELECT SLEEP(2.3);
|
||||
SLEEP(2.3)
|
||||
0
|
||||
SELECT SLEEP(2.5);
|
||||
SLEEP(2.5)
|
||||
0
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SELECT d.count,
|
||||
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
|
||||
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
|
||||
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
|
||||
count query_count query_total not_zero_region_count region_count
|
||||
1 20 17 3 6
|
||||
11 20 17 3 6
|
||||
8 20 17 3 6
|
||||
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
region_count
|
||||
6
|
||||
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
|
||||
time
|
||||
0.000001
|
||||
0.001000
|
||||
1.000000
|
||||
1000.000000
|
||||
1000000.00000
|
||||
TOO LONG
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 1000
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
Variable_name Value
|
||||
query_response_time_range_base 1000
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
|
@ -1,65 +0,0 @@
|
||||
source include/have_innodb.inc;
|
||||
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 = 2;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
|
||||
source include/percona_query_response_time_flush.inc;
|
||||
source include/percona_query_response_time_show.inc;
|
||||
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
source include/percona_query_response_time_sleep.inc;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
|
||||
source include/percona_query_response_time_show.inc;
|
||||
|
||||
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 ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
source include/percona_query_response_time_sleep.inc;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
|
||||
source include/percona_query_response_time_show.inc;
|
||||
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
|
||||
source include/percona_query_response_time_flush.inc;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
source include/percona_query_response_time_sleep.inc;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
|
||||
source include/percona_query_response_time_show.inc;
|
||||
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
|
||||
source include/percona_query_response_time_flush.inc;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
source include/percona_query_response_time_sleep.inc;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
|
||||
source include/percona_query_response_time_show.inc;
|
||||
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
|
||||
source include/percona_query_response_time_flush.inc;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
|
||||
source include/percona_query_response_time_sleep.inc;
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
|
||||
source include/percona_query_response_time_show.inc;
|
||||
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
|
||||
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
|
||||
|
||||
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
|
||||
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
|
@ -36,12 +36,10 @@ delayed_insert_limit Value
|
||||
delayed_insert_timeout Value
|
||||
delayed_queue_size Value
|
||||
div_precision_increment Value
|
||||
enable_query_response_time_stats Value
|
||||
engine_condition_pushdown Value
|
||||
error_count Value
|
||||
event_scheduler Value
|
||||
expire_logs_days Value
|
||||
fast_index_creation Value
|
||||
flush Value
|
||||
flush_time Value
|
||||
foreign_key_checks Value
|
||||
@ -80,8 +78,6 @@ innodb_additional_mem_pool_size Value
|
||||
innodb_auto_lru_dump Value
|
||||
innodb_autoextend_increment Value
|
||||
innodb_autoinc_lock_mode Value
|
||||
innodb_buffer_pool_shm_checksum Value
|
||||
innodb_buffer_pool_shm_key Value
|
||||
innodb_buffer_pool_size Value
|
||||
innodb_change_buffering Value
|
||||
innodb_checkpoint_age_target Value
|
||||
@ -250,7 +246,6 @@ query_cache_strip_comments Value
|
||||
query_cache_type Value
|
||||
query_cache_wlock_invalidate Value
|
||||
query_prealloc_size Value
|
||||
query_response_time_range_base Value
|
||||
rand_seed1 Value
|
||||
rand_seed2 Value
|
||||
range_alloc_block_size Value
|
||||
|
@ -1,9 +0,0 @@
|
||||
SELECT sleep(2);
|
||||
sleep(2)
|
||||
0
|
||||
set log_slow_verbosity=innodb;
|
||||
SELECT sleep(2);
|
||||
sleep(2)
|
||||
0
|
||||
cat MYSQLD_DATADIR/percona_slow_query_log-log_slow_verbosity.log | grep -c "No InnoDB statistics available for this query"
|
||||
1
|
@ -1,15 +0,0 @@
|
||||
-- source include/not_windows.inc
|
||||
|
||||
source include/have_innodb.inc;
|
||||
|
||||
SELECT sleep(2);
|
||||
|
||||
set log_slow_verbosity=innodb;
|
||||
|
||||
SELECT sleep(2);
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-log_slow_verbosity.log | grep -c "No InnoDB statistics available for this query";
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
exec echo '$cmd';
|
||||
exec $cmd;
|
@ -1,21 +0,0 @@
|
||||
SELECT sleep(1);
|
||||
sleep(1)
|
||||
0
|
||||
SELECT sleep(6);
|
||||
sleep(6)
|
||||
0
|
||||
SELECT sleep(10);
|
||||
sleep(10)
|
||||
0
|
||||
set long_query_time=8;
|
||||
SELECT sleep(1);
|
||||
sleep(1)
|
||||
0
|
||||
SELECT sleep(6);
|
||||
sleep(6)
|
||||
0
|
||||
SELECT sleep(12);
|
||||
sleep(12)
|
||||
0
|
||||
cat MYSQLD_DATADIR/percona_slow_query_log-long_query_time.log | grep -c Query_time
|
||||
3
|
@ -1,18 +0,0 @@
|
||||
source include/not_windows.inc;
|
||||
source include/have_innodb.inc;
|
||||
|
||||
SELECT sleep(1);
|
||||
SELECT sleep(6);
|
||||
SELECT sleep(10);
|
||||
|
||||
set long_query_time=8;
|
||||
|
||||
SELECT sleep(1);
|
||||
SELECT sleep(6);
|
||||
SELECT sleep(12);
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-long_query_time.log | grep -c Query_time;
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
exec echo '$cmd';
|
||||
exec $cmd;
|
@ -1,12 +0,0 @@
|
||||
SELECT sleep(2);
|
||||
sleep(2)
|
||||
0
|
||||
set global slow_query_log_microseconds_timestamp=ON;
|
||||
SELECT sleep(2);
|
||||
sleep(2)
|
||||
0
|
||||
set global slow_query_log_microseconds_timestamp=OFF;
|
||||
cat MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+'
|
||||
1
|
||||
cat MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+'
|
||||
2
|
@ -1,21 +0,0 @@
|
||||
source include/not_windows.inc;
|
||||
source include/have_innodb.inc;
|
||||
|
||||
SELECT sleep(2);
|
||||
|
||||
set global slow_query_log_microseconds_timestamp=ON;
|
||||
|
||||
SELECT sleep(2);
|
||||
|
||||
set global slow_query_log_microseconds_timestamp=OFF;
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+';
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
exec echo "$cmd";
|
||||
exec $cmd;
|
||||
|
||||
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+';
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
exec echo "$cmd";
|
||||
exec $cmd;
|
@ -1 +0,0 @@
|
||||
--slow-query-log-file=percona_slow_query_log-use_global_long_query_time.log --long-query-time=2
|
@ -1,12 +0,0 @@
|
||||
drop table if exists t1;
|
||||
create table t (a int not null);
|
||||
insert into t values (1),(2),(3);
|
||||
SELECT SQL_NO_FCACHE SLEEP(0);
|
||||
SLEEP(0)
|
||||
0
|
||||
SELECT /*!40001 SQL_NO_CACHE */ /*!50084 SQL_NO_FCACHE */ * FROM t;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
DROP TABLE t;
|
@ -1,11 +0,0 @@
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
create table t (a int not null);
|
||||
insert into t values (1),(2),(3);
|
||||
|
||||
SELECT SQL_NO_FCACHE SLEEP(0);
|
||||
SELECT /*!40001 SQL_NO_CACHE */ /*!50084 SQL_NO_FCACHE */ * FROM t;
|
||||
|
||||
DROP TABLE t;
|
@ -1,3 +1,4 @@
|
||||
--disable_ps_protocol
|
||||
set global query_cache_strip_comments=ON;
|
||||
-- source include/percona_query_cache_with_comments_begin.inc
|
||||
-- source include/percona_query_cache_with_comments.inc
|
@ -8,5 +8,5 @@ sleep(2)
|
||||
0
|
||||
set global use_global_log_slow_control=none;
|
||||
set global log_slow_verbosity=microtime;
|
||||
cat MYSQLD_DATADIR/percona_slow_query_log-control_global_slow.log | grep -c "No InnoDB statistics available for this query"
|
||||
cat var/mysqld.1/data/percona_slow_query_log-control_global_slow.log | grep "No InnoDB statistics available for this query" | wc -l
|
||||
1
|
@ -1,5 +1,3 @@
|
||||
--source include/not_windows.inc
|
||||
|
||||
source include/have_innodb.inc;
|
||||
SELECT sleep(2);
|
||||
set global log_slow_verbosity=innodb;
|
||||
@ -7,8 +5,6 @@ set global use_global_log_slow_control="log_slow_verbosity,long_query_time";
|
||||
SELECT sleep(2);
|
||||
set global use_global_log_slow_control=none;
|
||||
set global log_slow_verbosity=microtime;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-control_global_slow.log | grep -c "No InnoDB statistics available for this query";
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
exec echo '$cmd';
|
||||
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-control_global_slow.log | grep "No InnoDB statistics available for this query" | wc -l;
|
||||
echo $cmd;
|
||||
exec $cmd;
|
@ -21,5 +21,5 @@ SELECT sleep(2);
|
||||
sleep(2)
|
||||
0
|
||||
drop table if exists t;
|
||||
cat MYSQLD_DATADIR/percona_slow_query_log-log_slow_filter.log | grep -c Query_time
|
||||
cat var/mysqld.1/data/percona_slow_query_log-log_slow_filter.log | grep Query_time | wc -l
|
||||
2
|
@ -1,5 +1,3 @@
|
||||
-- source include/not_windows.inc
|
||||
|
||||
source include/have_innodb.inc;
|
||||
|
||||
SET GLOBAL SLOW_QUERY_LOG=OFF;
|
||||
@ -28,8 +26,6 @@ SELECT sleep(2);
|
||||
drop table if exists t;
|
||||
--enable_warnings
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-log_slow_filter.log | grep -c Query_time;
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
exec echo '$cmd';
|
||||
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-log_slow_filter.log | grep Query_time | wc -l;
|
||||
echo $cmd;
|
||||
exec $cmd;
|
@ -0,0 +1,9 @@
|
||||
SELECT sleep(2);
|
||||
sleep(2)
|
||||
0
|
||||
set log_slow_verbosity=innodb;
|
||||
SELECT sleep(2);
|
||||
sleep(2)
|
||||
0
|
||||
cat var/mysqld.1/data/percona_slow_query_log-log_slow_verbosity.log | grep "No InnoDB statistics available for this query" | wc -l
|
||||
1
|
@ -0,0 +1,11 @@
|
||||
source include/have_innodb.inc;
|
||||
|
||||
SELECT sleep(2);
|
||||
|
||||
set log_slow_verbosity=innodb;
|
||||
|
||||
SELECT sleep(2);
|
||||
|
||||
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-log_slow_verbosity.log | grep "No InnoDB statistics available for this query" | wc -l;
|
||||
echo $cmd;
|
||||
exec $cmd;
|
@ -1 +1 @@
|
||||
--slow-query-log-file=percona_slow_query_log-long_query_time.log --long-query-time=3
|
||||
--slow-query-log-file=percona_slow_query_log-long_query_time.log --long-query-time=2
|
@ -0,0 +1,22 @@
|
||||
SELECT sleep(1);
|
||||
sleep(1)
|
||||
0
|
||||
SELECT sleep(3);
|
||||
sleep(3)
|
||||
0
|
||||
SELECT sleep(5);
|
||||
sleep(5)
|
||||
0
|
||||
set long_query_time=4;
|
||||
SELECT sleep(1);
|
||||
sleep(1)
|
||||
0
|
||||
SELECT sleep(3);
|
||||
sleep(3)
|
||||
0
|
||||
SELECT sleep(5);
|
||||
sleep(5)
|
||||
0
|
||||
set long_query_time=2;
|
||||
cat var/mysqld.1/data/percona_slow_query_log-long_query_time.log | grep Query_time | wc -l
|
||||
3
|
@ -0,0 +1,17 @@
|
||||
source include/have_innodb.inc;
|
||||
|
||||
SELECT sleep(1);
|
||||
SELECT sleep(3);
|
||||
SELECT sleep(5);
|
||||
|
||||
set long_query_time=4;
|
||||
|
||||
SELECT sleep(1);
|
||||
SELECT sleep(3);
|
||||
SELECT sleep(5);
|
||||
|
||||
set long_query_time=2;
|
||||
|
||||
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-long_query_time.log | grep Query_time | wc -l;
|
||||
echo $cmd;
|
||||
exec $cmd;
|
@ -0,0 +1,12 @@
|
||||
SELECT sleep(2);
|
||||
sleep(2)
|
||||
0
|
||||
set global slow_query_log_microseconds_timestamp=ON;
|
||||
SELECT sleep(2);
|
||||
sleep(2)
|
||||
0
|
||||
set global slow_query_log_microseconds_timestamp=OFF;
|
||||
cat var/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+' | wc -l
|
||||
1
|
||||
cat var/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+' | wc -l
|
||||
2
|
@ -0,0 +1,17 @@
|
||||
source include/have_innodb.inc;
|
||||
|
||||
SELECT sleep(2);
|
||||
|
||||
set global slow_query_log_microseconds_timestamp=ON;
|
||||
|
||||
SELECT sleep(2);
|
||||
|
||||
set global slow_query_log_microseconds_timestamp=OFF;
|
||||
|
||||
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+' | wc -l;
|
||||
echo $cmd;
|
||||
exec $cmd;
|
||||
|
||||
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+' | wc -l;
|
||||
echo $cmd;
|
||||
exec $cmd;
|
@ -21,5 +21,5 @@ SELECT sleep(2);
|
||||
sleep(2)
|
||||
0
|
||||
drop table if exists t;
|
||||
cat MYSQLD_DATADIR/percona_slow_query_log-min_examined_row_limit.log | grep -c Query_time
|
||||
cat var/mysqld.1/data/percona_slow_query_log-min_examined_row_limit.log | grep Query_time | wc -l
|
||||
2
|
@ -1,4 +1,3 @@
|
||||
source include/not_windows.inc;
|
||||
source include/have_innodb.inc;
|
||||
|
||||
SET GLOBAL SLOW_QUERY_LOG=OFF;
|
||||
@ -27,8 +26,6 @@ SELECT sleep(2);
|
||||
drop table if exists t;
|
||||
--enable_warnings
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-min_examined_row_limit.log | grep -c Query_time;
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
exec echo '$cmd';
|
||||
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-min_examined_row_limit.log | grep Query_time | wc -l;
|
||||
echo $cmd;
|
||||
exec $cmd;
|
@ -1,5 +1,6 @@
|
||||
source include/have_innodb.inc;
|
||||
source include/master-slave.inc;
|
||||
-- source include/have_binlog_format_mixed_or_statement.inc
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/master-slave.inc
|
||||
|
||||
connection master;
|
||||
-- disable_warnings
|
@ -11,8 +11,6 @@ CREATE TABLE t(id INT);
|
||||
# Start slave replication
|
||||
START SLAVE;
|
||||
INSERT INTO t VALUES (1);
|
||||
# Read information about master binlog
|
||||
# Sync(1) slave thread
|
||||
# Read and change log_slow_slave_statements to ON on slave
|
||||
show variables like 'log_slow_slave_statements';
|
||||
Variable_name Value
|
||||
@ -22,14 +20,10 @@ show variables like 'log_slow_slave_statements';
|
||||
Variable_name Value
|
||||
log_slow_slave_statements ON
|
||||
INSERT INTO t VALUES (2);
|
||||
# Read information about master binlog
|
||||
# Sync slave(2) thread
|
||||
# Restart slave
|
||||
STOP SLAVE;
|
||||
START SLAVE;
|
||||
INSERT INTO t VALUES (3);
|
||||
# Read information about master binlog
|
||||
# Sync(3) slave thread
|
||||
show variables like 'long_query_time';
|
||||
Variable_name Value
|
||||
long_query_time 1.000000
|
||||
@ -50,8 +44,6 @@ show global variables like 'use_global_long_query_time';
|
||||
Variable_name Value
|
||||
use_global_long_query_time OFF
|
||||
INSERT INTO t VALUES (4);
|
||||
# Read information about master binlog
|
||||
# Sync slave(4) thread
|
||||
show variables like 'long_query_time';
|
||||
Variable_name Value
|
||||
long_query_time 1.000000
|
||||
@ -72,8 +64,6 @@ show global variables like 'use_global_long_query_time';
|
||||
Variable_name Value
|
||||
use_global_long_query_time ON
|
||||
INSERT INTO t VALUES (5);
|
||||
# Read information about master binlog
|
||||
# Sync slave(5) thread
|
||||
show variables like 'long_query_time';
|
||||
Variable_name Value
|
||||
long_query_time 0.000000
|
||||
@ -99,5 +89,3 @@ set global use_global_long_query_time=0;
|
||||
1
|
||||
set global log_slow_slave_statements=OFF;
|
||||
DROP TABLE t;
|
||||
# Read information about master binlog
|
||||
# Sync slave(6) thread
|
@ -1,5 +1,4 @@
|
||||
-- source include/not_windows.inc
|
||||
|
||||
-- source include/have_binlog_format_mixed_or_statement.inc
|
||||
-- echo # Activate master-slave replication
|
||||
-- source include/master-slave.inc
|
||||
|
||||
@ -21,14 +20,8 @@ START SLAVE;
|
||||
#-- echo # Make insert(1) on master
|
||||
connection master;
|
||||
INSERT INTO t VALUES (1);
|
||||
-- echo # Read information about master binlog
|
||||
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
|
||||
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
|
||||
|
||||
-- echo # Sync(1) slave thread
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
|
||||
|
||||
-- echo # Read and change log_slow_slave_statements to ON on slave
|
||||
show variables like 'log_slow_slave_statements';
|
||||
set global log_slow_slave_statements=ON;
|
||||
@ -37,13 +30,8 @@ show variables like 'log_slow_slave_statements';
|
||||
#-- echo # Make insert(2) on master
|
||||
connection master;
|
||||
INSERT INTO t VALUES (2);
|
||||
-- echo # Read information about master binlog
|
||||
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
|
||||
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
|
||||
|
||||
-- echo # Sync slave(2) thread
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
|
||||
-- echo # Restart slave
|
||||
STOP SLAVE;
|
||||
-- source include/wait_for_slave_to_stop.inc
|
||||
@ -53,13 +41,8 @@ START SLAVE;
|
||||
#-- echo # Make insert(3) on master
|
||||
connection master;
|
||||
INSERT INTO t VALUES (3);
|
||||
-- echo # Read information about master binlog
|
||||
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
|
||||
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
|
||||
|
||||
-- echo # Sync(3) slave thread
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
|
||||
show variables like 'long_query_time';
|
||||
show global variables like 'long_query_time';
|
||||
show global variables like 'use_global_long_query_time';
|
||||
@ -71,13 +54,8 @@ show global variables like 'use_global_long_query_time';
|
||||
#-- echo # Make insert(4) on master
|
||||
connection master;
|
||||
INSERT INTO t VALUES (4);
|
||||
-- echo # Read information about master binlog
|
||||
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
|
||||
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
|
||||
|
||||
-- echo # Sync slave(4) thread
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
|
||||
show variables like 'long_query_time';
|
||||
show global variables like 'long_query_time';
|
||||
show global variables like 'use_global_long_query_time';
|
||||
@ -88,16 +66,9 @@ show global variables like 'use_global_long_query_time';
|
||||
|
||||
#-- echo # Make insert(5) on master
|
||||
connection master;
|
||||
let $MASTER_DATADIR= `select @@datadir`;
|
||||
INSERT INTO t VALUES (5);
|
||||
-- echo # Read information about master binlog
|
||||
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
|
||||
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
|
||||
|
||||
-- echo # Sync slave(5) thread
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
let $SLAVE_DATADIR= `select @@datadir`;
|
||||
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
|
||||
show variables like 'long_query_time';
|
||||
show global variables like 'long_query_time';
|
||||
show global variables like 'use_global_long_query_time';
|
||||
@ -107,7 +78,7 @@ set global use_global_long_query_time=0;
|
||||
-- echo # Analyse master slow_query_log
|
||||
let $i=5;
|
||||
let $k=1;
|
||||
let $cmd=cat ./$MASTER_DATADIR/percona_log_slow_slave_statements-master.log | grep;
|
||||
let $cmd=cat ./var/mysqld.1/data/percona_log_slow_slave_statements-master.log | grep;
|
||||
while($i)
|
||||
{
|
||||
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
|
||||
@ -119,7 +90,7 @@ while($i)
|
||||
-- echo # Analyse slave slow_query_log
|
||||
let $i=5;
|
||||
let $k=1;
|
||||
let $cmd=cat $SLAVE_DATADIR/percona_log_slow_slave_statements-slave.log | grep;
|
||||
let $cmd=cat ./var/mysqld.2/data/percona_log_slow_slave_statements-slave.log | grep;
|
||||
while($i)
|
||||
{
|
||||
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
|
||||
@ -132,10 +103,5 @@ set global log_slow_slave_statements=OFF;
|
||||
connection master;
|
||||
DROP TABLE t;
|
||||
|
||||
-- echo # Read information about master binlog
|
||||
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
|
||||
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
|
||||
|
||||
-- echo # Sync slave(6) thread
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
|
@ -1,5 +1,4 @@
|
||||
-- source include/not_windows.inc
|
||||
|
||||
-- source include/have_binlog_format_mixed_or_statement.inc
|
||||
-- echo # Activate master-slave replication
|
||||
-- source include/master-slave.inc
|
||||
|
||||
@ -114,7 +113,6 @@ START SLAVE;
|
||||
|
||||
#-- echo # Make insert(7) on master
|
||||
connection master;
|
||||
let $MASTER_DATADIR= `select @@datadir`;
|
||||
INSERT INTO t VALUES (7);
|
||||
-- echo # Read information about master binlog
|
||||
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
|
||||
@ -122,16 +120,15 @@ let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
|
||||
|
||||
-- echo # Sync slave(7) thread
|
||||
connection slave;
|
||||
let $SLAVE_DATADIR= `select @@datadir`;
|
||||
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
|
||||
|
||||
-- echo # Analyse master slow_query_log
|
||||
let $i=7;
|
||||
let $k=1;
|
||||
let $cmd=cat $MASTER_DATADIR/percona_log_slow_slave_statements-master.log | grep -c;
|
||||
let $cmd=cat ./var/mysqld.1/data/percona_log_slow_slave_statements-master.log | grep;
|
||||
while($i)
|
||||
{
|
||||
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)";
|
||||
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
|
||||
exec $current_cmd;
|
||||
dec $i;
|
||||
inc $k;
|
||||
@ -140,10 +137,10 @@ while($i)
|
||||
-- echo # Analyse slave slow_query_log
|
||||
let $i=7;
|
||||
let $k=1;
|
||||
let $cmd=cat $SLAVE_DATADIR/percona_log_slow_slave_statements-slave.log | grep -c;
|
||||
let $cmd=cat ./var/mysqld.2/data/percona_log_slow_slave_statements-slave.log | grep;
|
||||
while($i)
|
||||
{
|
||||
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)";
|
||||
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
|
||||
exec $current_cmd;
|
||||
dec $i;
|
||||
inc $k;
|
@ -0,0 +1 @@
|
||||
--slow-query-log-file=percona_slow_query_log-use_global_long_query_time.log --long-query-time=2 --use_global_log_slow_control=long_query_time --use_global_long_query_time=1
|
@ -20,7 +20,7 @@ sleep(5)
|
||||
0
|
||||
set global long_query_time=2;
|
||||
set global use_global_long_query_time=0;
|
||||
cat MYSQLD_DATADIR/percona_slow_query_log-use_global_long_query_time.log | grep -c Query_time
|
||||
cat var/mysqld.1/data/percona_slow_query_log-use_global_long_query_time.log | grep Query_time | wc -l
|
||||
3
|
||||
show global variables like 'use_global_log_slow_control';
|
||||
Variable_name Value
|
||||
@ -56,4 +56,4 @@ use_global_log_slow_control log_slow_filter
|
||||
show global variables like 'use_global_long_query_time';
|
||||
Variable_name Value
|
||||
use_global_long_query_time OFF
|
||||
set global use_global_log_slow_control = none;
|
||||
set global use_global_log_slow_control = long_query_time;
|
@ -1,4 +1,3 @@
|
||||
source include/not_windows.inc;
|
||||
source include/have_innodb.inc;
|
||||
|
||||
SELECT sleep(1);
|
||||
@ -15,10 +14,8 @@ SELECT sleep(5);
|
||||
set global long_query_time=2;
|
||||
set global use_global_long_query_time=0;
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-use_global_long_query_time.log | grep -c Query_time;
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
exec echo '$cmd';
|
||||
let $cmd = cat var/mysqld.1/data/percona_slow_query_log-use_global_long_query_time.log | grep Query_time | wc -l;
|
||||
echo $cmd;
|
||||
exec $cmd;
|
||||
|
||||
show global variables like 'use_global_log_slow_control';
|
||||
@ -40,4 +37,4 @@ set global use_global_long_query_time = OFF;
|
||||
show global variables like 'use_global_log_slow_control';
|
||||
show global variables like 'use_global_long_query_time';
|
||||
|
||||
set global use_global_log_slow_control = none;
|
||||
set global use_global_log_slow_control = long_query_time;
|
@ -0,0 +1,23 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
DROP TABLE IF EXISTS t;
|
||||
CREATE TABLE t(id INT);
|
||||
INSERT INTO t SELECT SLEEP(5);
|
||||
STOP SLAVE;
|
||||
select count(*) from t;
|
||||
count(*)
|
||||
0
|
||||
SHOW SLAVE STATUS NOLOCK;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
|
||||
host user port 1 master-bin.000001 276 slave-relay-bin.000003 422 master-bin.000001 No No 0 0 276 577 None 0 No NULL No 0 0
|
||||
select count(*) from t;
|
||||
count(*)
|
||||
0
|
||||
START SLAVE;
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
DROP TABLE t;
|
@ -0,0 +1,28 @@
|
||||
--source include/master-slave.inc
|
||||
|
||||
connection master;
|
||||
-- disable_warnings
|
||||
DROP TABLE IF EXISTS t;
|
||||
-- enable_warnings
|
||||
CREATE TABLE t(id INT);
|
||||
sync_slave_with_master;
|
||||
connection master;
|
||||
send INSERT INTO t SELECT SLEEP(5);
|
||||
sleep 1;
|
||||
connection slave;
|
||||
send STOP SLAVE;
|
||||
connection slave1;
|
||||
select count(*) from t;
|
||||
replace_column 2 host 3 user 4 port;
|
||||
SHOW SLAVE STATUS NOLOCK;
|
||||
select count(*) from t;
|
||||
|
||||
connection slave;
|
||||
reap;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
connection master;
|
||||
reap;
|
||||
DROP TABLE t;
|
||||
sync_slave_with_master;
|
@ -1,3 +1,21 @@
|
||||
2010-10-11 The InnoDB Team
|
||||
* row/row0sel.c
|
||||
Fix Bug #57345 btr_pcur_store_position abort for load with
|
||||
concurrent lock/unlock tables
|
||||
|
||||
2010-10-06 The InnoDB Team
|
||||
* row/row0mysql.c, innodb_bug57255.result, innodb_bug57255.test
|
||||
Fix Bug #Cascade Delete results in "Got error -1 from storage engine"
|
||||
|
||||
2010-09-27 The InnoDB Team
|
||||
|
||||
* row/row0sel.c, innodb_bug56716.result, innodb_bug56716.test:
|
||||
Fix Bug #56716 InnoDB locks a record gap without locking the table
|
||||
|
||||
2010-09-06 The InnoDB Team
|
||||
* dict/dict0load.c, innodb_bug53756.test innodb_bug53756.result
|
||||
Fix Bug #53756 ALTER TABLE ADD PRIMARY KEY affects crash recovery
|
||||
|
||||
2010-08-24 The InnoDB Team
|
||||
|
||||
* handler/ha_innodb.c, dict/dict0dict.c:
|
||||
@ -27,7 +45,6 @@
|
||||
* handler/ha_innodb.cc
|
||||
Fix Bug #55382 Assignment with SELECT expressions takes unexpected
|
||||
S locks in READ COMMITTED
|
||||
>>>>>>> MERGE-SOURCE
|
||||
|
||||
2010-07-27 The InnoDB Team
|
||||
|
||||
|
@ -1925,7 +1925,6 @@ btr_page_split_and_insert(
|
||||
buf_block_t* left_block;
|
||||
buf_block_t* right_block;
|
||||
buf_block_t* insert_block;
|
||||
page_t* insert_page;
|
||||
page_cur_t* page_cursor;
|
||||
rec_t* first_rec;
|
||||
byte* buf = 0; /* remove warning */
|
||||
@ -2183,8 +2182,6 @@ insert_empty:
|
||||
insert_block = right_block;
|
||||
}
|
||||
|
||||
insert_page = buf_block_get_frame(insert_block);
|
||||
|
||||
/* 7. Reposition the cursor for insert and try insertion */
|
||||
page_cursor = btr_cur_get_page_cur(cursor);
|
||||
|
||||
@ -2196,8 +2193,12 @@ insert_empty:
|
||||
|
||||
#ifdef UNIV_ZIP_DEBUG
|
||||
{
|
||||
page_t* insert_page
|
||||
= buf_block_get_frame(insert_block);
|
||||
|
||||
page_zip_des_t* insert_page_zip
|
||||
= buf_block_get_page_zip(insert_block);
|
||||
|
||||
ut_a(!insert_page_zip
|
||||
|| page_zip_validate(insert_page_zip, insert_page));
|
||||
}
|
||||
@ -2590,7 +2591,6 @@ btr_compress(
|
||||
ulint n_recs;
|
||||
ulint max_ins_size;
|
||||
ulint max_ins_size_reorg;
|
||||
ulint level;
|
||||
|
||||
block = btr_cur_get_block(cursor);
|
||||
page = btr_cur_get_page(cursor);
|
||||
@ -2600,7 +2600,6 @@ btr_compress(
|
||||
ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
|
||||
MTR_MEMO_X_LOCK));
|
||||
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
|
||||
level = btr_page_get_level(page, mtr);
|
||||
space = dict_index_get_space(index);
|
||||
zip_size = dict_table_zip_size(index->table);
|
||||
|
||||
|
@ -2013,7 +2013,6 @@ btr_cur_optimistic_update(
|
||||
page_t* page;
|
||||
page_zip_des_t* page_zip;
|
||||
rec_t* rec;
|
||||
rec_t* orig_rec;
|
||||
ulint max_size;
|
||||
ulint new_rec_size;
|
||||
ulint old_rec_size;
|
||||
@ -2027,7 +2026,7 @@ btr_cur_optimistic_update(
|
||||
|
||||
block = btr_cur_get_block(cursor);
|
||||
page = buf_block_get_frame(block);
|
||||
orig_rec = rec = btr_cur_get_rec(cursor);
|
||||
rec = btr_cur_get_rec(cursor);
|
||||
index = cursor->index;
|
||||
ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
|
||||
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
|
||||
@ -4673,12 +4672,17 @@ btr_free_externally_stored_field(
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_t* rec_block;
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
buf_block_t* ext_block;
|
||||
|
||||
mtr_start(&mtr);
|
||||
|
||||
rec_block = buf_page_get(page_get_space_id(
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
rec_block =
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
buf_page_get(page_get_space_id(
|
||||
page_align(field_ref)),
|
||||
rec_zip_size,
|
||||
page_get_page_no(
|
||||
|
@ -467,7 +467,6 @@ btr_pcur_move_backward_from_page(
|
||||
mtr_t* mtr) /*!< in: mtr */
|
||||
{
|
||||
ulint prev_page_no;
|
||||
ulint space;
|
||||
page_t* page;
|
||||
buf_block_t* prev_block;
|
||||
ulint latch_mode;
|
||||
@ -503,7 +502,6 @@ btr_pcur_move_backward_from_page(
|
||||
page = btr_pcur_get_page(cursor);
|
||||
|
||||
prev_page_no = btr_page_get_prev(page, mtr);
|
||||
space = buf_block_get_space(btr_pcur_get_block(cursor));
|
||||
|
||||
if (prev_page_no == FIL_NULL) {
|
||||
} else if (btr_pcur_is_before_first_on_page(cursor)) {
|
||||
|
@ -1620,7 +1620,6 @@ btr_search_update_hash_on_delete(
|
||||
rec_t* rec;
|
||||
ulint fold;
|
||||
dulint index_id;
|
||||
ibool found;
|
||||
ulint offsets_[REC_OFFS_NORMAL_SIZE];
|
||||
mem_heap_t* heap = NULL;
|
||||
rec_offs_init(offsets_);
|
||||
@ -1653,7 +1652,7 @@ btr_search_update_hash_on_delete(
|
||||
}
|
||||
rw_lock_x_lock(&btr_search_latch);
|
||||
|
||||
found = ha_search_and_delete_if_found(table, fold, rec);
|
||||
ha_search_and_delete_if_found(table, fold, rec);
|
||||
|
||||
rw_lock_x_unlock(&btr_search_latch);
|
||||
}
|
||||
|
@ -53,10 +53,6 @@ Created 11/5/1995 Heikki Tuuri
|
||||
#include "page0zip.h"
|
||||
#include "trx0trx.h"
|
||||
#include "srv0start.h"
|
||||
#include "que0que.h"
|
||||
#include "read0read.h"
|
||||
#include "row0row.h"
|
||||
#include "ha_prototypes.h"
|
||||
|
||||
/* prototypes for new functions added to ha_innodb.cc */
|
||||
trx_t* innobase_get_trx();
|
||||
@ -314,30 +310,6 @@ read-ahead or flush occurs */
|
||||
UNIV_INTERN ibool buf_debug_prints = FALSE;
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
/* Buffer pool shared memory segment information */
|
||||
typedef struct buf_shm_info_struct buf_shm_info_t;
|
||||
|
||||
struct buf_shm_info_struct {
|
||||
char head_str[8];
|
||||
ulint binary_id;
|
||||
ibool is_new; /* during initializing */
|
||||
ibool clean; /* clean shutdowned and free */
|
||||
ibool reusable; /* reusable */
|
||||
ulint buf_pool_size; /* backup value */
|
||||
ulint page_size; /* backup value */
|
||||
ulint frame_offset; /* offset of the first frame based on chunk->mem */
|
||||
ulint zip_hash_offset;
|
||||
ulint zip_hash_n;
|
||||
|
||||
ulint checksum;
|
||||
|
||||
buf_pool_t buf_pool_backup;
|
||||
buf_chunk_t chunk_backup;
|
||||
|
||||
ib_uint64_t dummy;
|
||||
};
|
||||
|
||||
#define BUF_SHM_INFO_HEAD "XTRA_SHM"
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
/********************************************************************//**
|
||||
@ -784,45 +756,6 @@ buf_block_init(
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
buf_block_reuse(
|
||||
/*============*/
|
||||
buf_block_t* block,
|
||||
ptrdiff_t frame_offset)
|
||||
{
|
||||
/* block_init */
|
||||
block->frame += frame_offset;
|
||||
|
||||
UNIV_MEM_DESC(block->frame, UNIV_PAGE_SIZE, block);
|
||||
|
||||
block->index = NULL;
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
/* recreate later */
|
||||
block->page.in_page_hash = FALSE;
|
||||
block->page.in_zip_hash = FALSE;
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
|
||||
block->n_pointers = 0;
|
||||
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
|
||||
|
||||
if (block->page.zip.data)
|
||||
block->page.zip.data += frame_offset;
|
||||
|
||||
block->is_hashed = FALSE;
|
||||
|
||||
mutex_create(&block->mutex, SYNC_BUF_BLOCK);
|
||||
|
||||
rw_lock_create(&block->lock, SYNC_LEVEL_VARYING);
|
||||
ut_ad(rw_lock_validate(&(block->lock)));
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
rw_lock_create(&block->debug_latch, SYNC_NO_ORDER_CHECK);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
}
|
||||
|
||||
/********************************************************************//**
|
||||
Allocates a chunk of buffer frames.
|
||||
@return chunk, or NULL on failure */
|
||||
@ -835,188 +768,26 @@ buf_chunk_init(
|
||||
{
|
||||
buf_block_t* block;
|
||||
byte* frame;
|
||||
ulint zip_hash_n = 0;
|
||||
ulint zip_hash_mem_size = 0;
|
||||
hash_table_t* zip_hash_tmp = NULL;
|
||||
ulint i;
|
||||
buf_shm_info_t* shm_info = NULL;
|
||||
|
||||
/* Round down to a multiple of page size,
|
||||
although it already should be. */
|
||||
mem_size = ut_2pow_round(mem_size, UNIV_PAGE_SIZE);
|
||||
|
||||
srv_buffer_pool_shm_is_reused = FALSE;
|
||||
|
||||
if (srv_buffer_pool_shm_key) {
|
||||
/* zip_hash size */
|
||||
zip_hash_n = (mem_size / UNIV_PAGE_SIZE) * 2;
|
||||
zip_hash_mem_size = ut_2pow_round(hash_create_needed(zip_hash_n)
|
||||
+ (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE);
|
||||
}
|
||||
|
||||
/* Reserve space for the block descriptors. */
|
||||
mem_size += ut_2pow_round((mem_size / UNIV_PAGE_SIZE) * (sizeof *block)
|
||||
+ (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE);
|
||||
if (srv_buffer_pool_shm_key) {
|
||||
mem_size += ut_2pow_round(sizeof(buf_shm_info_t)
|
||||
+ (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE);
|
||||
mem_size += zip_hash_mem_size;
|
||||
}
|
||||
|
||||
chunk->mem_size = mem_size;
|
||||
|
||||
if (srv_buffer_pool_shm_key) {
|
||||
ulint binary_id;
|
||||
ibool is_new;
|
||||
|
||||
ut_a(buf_pool->n_chunks == 1);
|
||||
|
||||
fprintf(stderr,
|
||||
"InnoDB: Warning: The innodb_buffer_pool_shm_key option has been specified.\n"
|
||||
"InnoDB: Do not change the following between restarts of the server while this option is being used:\n"
|
||||
"InnoDB: * the mysqld executable between restarts of the server.\n"
|
||||
"InnoDB: * the value of innodb_buffer_pool_size.\n"
|
||||
"InnoDB: * the value of innodb_page_size.\n"
|
||||
"InnoDB: * datafiles created by InnoDB during this session.\n"
|
||||
"InnoDB: Otherwise, data corruption in datafiles may result.\n");
|
||||
|
||||
/* FIXME: This is vague id still */
|
||||
binary_id = (ulint) ((byte*)mtr_commit - (byte*)btr_root_get)
|
||||
+ (ulint) ((byte*)os_get_os_version - (byte*)buf_calc_page_new_checksum)
|
||||
+ (ulint) ((byte*)page_dir_find_owner_slot - (byte*)dfield_data_is_binary_equal)
|
||||
+ (ulint) ((byte*)que_graph_publish - (byte*)dict_casedn_str)
|
||||
+ (ulint) ((byte*)read_view_oldest_copy_or_open_new - (byte*)fil_space_get_version)
|
||||
+ (ulint) ((byte*)rec_get_n_extern_new - (byte*)fsp_get_size_low)
|
||||
+ (ulint) ((byte*)row_get_trx_id_offset - (byte*)ha_create_func)
|
||||
+ (ulint) ((byte*)srv_set_io_thread_op_info - (byte*)thd_is_replication_slave_thread)
|
||||
+ (ulint) ((byte*)mutex_create_func - (byte*)ibuf_inside)
|
||||
+ (ulint) ((byte*)trx_set_detailed_error - (byte*)lock_check_trx_id_sanity)
|
||||
+ (ulint) ((byte*)ut_time - (byte*)mem_heap_strdup);
|
||||
|
||||
chunk->mem = os_shm_alloc(&chunk->mem_size, srv_buffer_pool_shm_key, &is_new);
|
||||
|
||||
if (UNIV_UNLIKELY(chunk->mem == NULL)) {
|
||||
return(NULL);
|
||||
}
|
||||
init_again:
|
||||
#ifdef UNIV_SET_MEM_TO_ZERO
|
||||
if (is_new) {
|
||||
memset(chunk->mem, '\0', chunk->mem_size);
|
||||
}
|
||||
#endif
|
||||
/* for ut_fold_binary_32(), these values should be 32-bit aligned */
|
||||
ut_a(sizeof(buf_shm_info_t) % 4 == 0);
|
||||
ut_a((ulint)chunk->mem % 4 == 0);
|
||||
ut_a(chunk->mem_size % 4 == 0);
|
||||
|
||||
shm_info = chunk->mem;
|
||||
|
||||
zip_hash_tmp = (hash_table_t*)((byte*)chunk->mem + chunk->mem_size - zip_hash_mem_size);
|
||||
|
||||
if (is_new) {
|
||||
strncpy(shm_info->head_str, BUF_SHM_INFO_HEAD, 8);
|
||||
shm_info->binary_id = binary_id;
|
||||
shm_info->is_new = TRUE; /* changed to FALSE when the initialization is finished */
|
||||
shm_info->clean = FALSE; /* changed to TRUE when free the segment. */
|
||||
shm_info->reusable = FALSE; /* changed to TRUE when validation is finished. */
|
||||
shm_info->buf_pool_size = srv_buf_pool_size;
|
||||
shm_info->page_size = srv_page_size;
|
||||
shm_info->zip_hash_offset = chunk->mem_size - zip_hash_mem_size;
|
||||
shm_info->zip_hash_n = zip_hash_n;
|
||||
} else {
|
||||
ulint checksum;
|
||||
|
||||
if (strncmp(shm_info->head_str, BUF_SHM_INFO_HEAD, 8)) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: The shared memory segment seems not to be for buffer pool.\n");
|
||||
return(NULL);
|
||||
}
|
||||
if (shm_info->binary_id != binary_id) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: The shared memory segment seems not to be for this binary.\n");
|
||||
return(NULL);
|
||||
}
|
||||
if (shm_info->is_new) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: The shared memory was not initialized yet.\n");
|
||||
return(NULL);
|
||||
}
|
||||
if (shm_info->buf_pool_size != srv_buf_pool_size) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: srv_buf_pool_size is different (shm=%lu current=%lu).\n",
|
||||
shm_info->buf_pool_size, srv_buf_pool_size);
|
||||
return(NULL);
|
||||
}
|
||||
if (shm_info->page_size != srv_page_size) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: srv_page_size is different (shm=%lu current=%lu).\n",
|
||||
shm_info->page_size, srv_page_size);
|
||||
return(NULL);
|
||||
}
|
||||
if (!shm_info->reusable) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Warning: The shared memory has unrecoverable contents.\n"
|
||||
"InnoDB: The shared memory segment is initialized.\n");
|
||||
is_new = TRUE;
|
||||
goto init_again;
|
||||
}
|
||||
if (!shm_info->clean) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Warning: The shared memory was not shut down cleanly.\n"
|
||||
"InnoDB: The shared memory segment is initialized.\n");
|
||||
is_new = TRUE;
|
||||
goto init_again;
|
||||
}
|
||||
|
||||
ut_a(shm_info->zip_hash_offset == chunk->mem_size - zip_hash_mem_size);
|
||||
ut_a(shm_info->zip_hash_n == zip_hash_n);
|
||||
|
||||
/* check checksum */
|
||||
if (srv_buffer_pool_shm_checksum) {
|
||||
checksum = ut_fold_binary_32((byte*)chunk->mem + sizeof(buf_shm_info_t),
|
||||
chunk->mem_size - sizeof(buf_shm_info_t));
|
||||
} else {
|
||||
checksum = BUF_NO_CHECKSUM_MAGIC;
|
||||
}
|
||||
|
||||
if (shm_info->checksum != BUF_NO_CHECKSUM_MAGIC
|
||||
&& shm_info->checksum != checksum) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: checksum of the shared memory is not match. "
|
||||
"(stored=%lu calculated=%lu)\n",
|
||||
shm_info->checksum, checksum);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* flag to use the segment. */
|
||||
shm_info->clean = FALSE; /* changed to TRUE when free the segment. */
|
||||
}
|
||||
|
||||
/* init zip_hash contents */
|
||||
if (is_new) {
|
||||
hash_create_init(zip_hash_tmp, zip_hash_n);
|
||||
} else {
|
||||
/* adjust offset is done later */
|
||||
hash_create_reuse(zip_hash_tmp);
|
||||
|
||||
srv_buffer_pool_shm_is_reused = TRUE;
|
||||
}
|
||||
} else {
|
||||
chunk->mem = os_mem_alloc_large(&chunk->mem_size);
|
||||
|
||||
if (UNIV_UNLIKELY(chunk->mem == NULL)) {
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate the block descriptors from
|
||||
the start of the memory block. */
|
||||
if (srv_buffer_pool_shm_key) {
|
||||
chunk->blocks = (buf_block_t*)((byte*)chunk->mem + sizeof(buf_shm_info_t));
|
||||
} else {
|
||||
chunk->blocks = chunk->mem;
|
||||
}
|
||||
|
||||
/* Align a pointer to the first frame. Note that when
|
||||
os_large_page_size is smaller than UNIV_PAGE_SIZE,
|
||||
@ -1024,13 +795,8 @@ init_again:
|
||||
it is bigger, we may allocate more blocks than requested. */
|
||||
|
||||
frame = ut_align(chunk->mem, UNIV_PAGE_SIZE);
|
||||
if (srv_buffer_pool_shm_key) {
|
||||
/* reserve zip_hash space and always -1 for reproductibity */
|
||||
chunk->size = (chunk->mem_size - zip_hash_mem_size) / UNIV_PAGE_SIZE - 1;
|
||||
} else {
|
||||
chunk->size = chunk->mem_size / UNIV_PAGE_SIZE
|
||||
- (frame != chunk->mem);
|
||||
}
|
||||
|
||||
/* Subtract the space needed for block descriptors. */
|
||||
{
|
||||
@ -1044,98 +810,6 @@ init_again:
|
||||
chunk->size = size;
|
||||
}
|
||||
|
||||
if (shm_info && !(shm_info->is_new)) {
|
||||
/* convert the shared memory segment for reuse */
|
||||
ptrdiff_t phys_offset;
|
||||
ptrdiff_t logi_offset;
|
||||
ptrdiff_t blocks_offset;
|
||||
byte* previous_frame_address;
|
||||
|
||||
if (chunk->size < shm_info->chunk_backup.size) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: The buffer pool became smaller because of allocated address.\n"
|
||||
"InnoDB: Retrying may avoid this situation.\n");
|
||||
shm_info->clean = TRUE; /* release the flag for retrying */
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
chunk->size = shm_info->chunk_backup.size;
|
||||
phys_offset = frame - ((byte*)chunk->mem + shm_info->frame_offset);
|
||||
logi_offset = frame - chunk->blocks[0].frame;
|
||||
previous_frame_address = chunk->blocks[0].frame;
|
||||
blocks_offset = (byte*)chunk->blocks - (byte*)shm_info->chunk_backup.blocks;
|
||||
|
||||
if (phys_offset || logi_offset || blocks_offset) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Buffer pool in the shared memory segment should be converted.\n"
|
||||
"InnoDB: Previous frames in address : %p\n"
|
||||
"InnoDB: Previous frames were located : %p\n"
|
||||
"InnoDB: Current frames should be located: %p\n"
|
||||
"InnoDB: Pysical offset : %ld (%#lx)\n"
|
||||
"InnoDB: Logical offset (frames) : %ld (%#lx)\n"
|
||||
"InnoDB: Logical offset (blocks) : %ld (%#lx)\n",
|
||||
(byte*)chunk->mem + shm_info->frame_offset,
|
||||
chunk->blocks[0].frame, frame,
|
||||
(long) phys_offset, (ulong) phys_offset, (long) logi_offset, (ulong) logi_offset,
|
||||
(long) blocks_offset, (ulong) blocks_offset);
|
||||
} else {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Buffer pool in the shared memory segment can be used as it is.\n");
|
||||
}
|
||||
|
||||
if (phys_offset) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Aligning physical offset...");
|
||||
|
||||
memmove(frame, (byte*)chunk->mem + shm_info->frame_offset,
|
||||
chunk->size * UNIV_PAGE_SIZE);
|
||||
|
||||
fprintf(stderr,
|
||||
" Done.\n");
|
||||
}
|
||||
|
||||
/* buf_block_t */
|
||||
block = chunk->blocks;
|
||||
for (i = chunk->size; i--; ) {
|
||||
buf_block_reuse(block, logi_offset);
|
||||
block++;
|
||||
}
|
||||
|
||||
if (logi_offset || blocks_offset) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Aligning logical offset...");
|
||||
|
||||
|
||||
/* buf_pool_t buf_pool_backup */
|
||||
UT_LIST_OFFSET(flush_list, buf_page_t, shm_info->buf_pool_backup.flush_list,
|
||||
previous_frame_address, logi_offset, blocks_offset);
|
||||
UT_LIST_OFFSET(free, buf_page_t, shm_info->buf_pool_backup.free,
|
||||
previous_frame_address, logi_offset, blocks_offset);
|
||||
UT_LIST_OFFSET(LRU, buf_page_t, shm_info->buf_pool_backup.LRU,
|
||||
previous_frame_address, logi_offset, blocks_offset);
|
||||
if (shm_info->buf_pool_backup.LRU_old)
|
||||
shm_info->buf_pool_backup.LRU_old =
|
||||
(buf_page_t*)((byte*)(shm_info->buf_pool_backup.LRU_old)
|
||||
+ (((byte*)shm_info->buf_pool_backup.LRU_old > previous_frame_address)
|
||||
? logi_offset : blocks_offset));
|
||||
|
||||
UT_LIST_OFFSET(unzip_LRU, buf_block_t, shm_info->buf_pool_backup.unzip_LRU,
|
||||
previous_frame_address, logi_offset, blocks_offset);
|
||||
|
||||
UT_LIST_OFFSET(zip_list, buf_page_t, shm_info->buf_pool_backup.zip_clean,
|
||||
previous_frame_address, logi_offset, blocks_offset);
|
||||
for (i = 0; i < BUF_BUDDY_SIZES_MAX; i++) {
|
||||
UT_LIST_OFFSET(zip_list, buf_page_t, shm_info->buf_pool_backup.zip_free[i],
|
||||
previous_frame_address, logi_offset, blocks_offset);
|
||||
}
|
||||
|
||||
HASH_OFFSET(zip_hash_tmp, buf_page_t, hash,
|
||||
previous_frame_address, logi_offset, blocks_offset);
|
||||
|
||||
fprintf(stderr,
|
||||
" Done.\n");
|
||||
}
|
||||
} else {
|
||||
/* Init block structs and assign frames for them. Then we
|
||||
assign the frames to the first blocks (we already mapped the
|
||||
memory above). */
|
||||
@ -1159,11 +833,6 @@ init_again:
|
||||
block++;
|
||||
frame += UNIV_PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
if (shm_info) {
|
||||
shm_info->frame_offset = chunk->blocks[0].frame - (byte*)chunk->mem;
|
||||
}
|
||||
|
||||
return(chunk);
|
||||
}
|
||||
@ -1345,8 +1014,6 @@ buf_chunk_free(
|
||||
UNIV_MEM_UNDESC(block);
|
||||
}
|
||||
|
||||
ut_a(!srv_buffer_pool_shm_key);
|
||||
|
||||
os_mem_free_large(chunk->mem, chunk->mem_size);
|
||||
}
|
||||
|
||||
@ -1396,10 +1063,7 @@ buf_pool_init(void)
|
||||
srv_buf_pool_curr_size = buf_pool->curr_size * UNIV_PAGE_SIZE;
|
||||
|
||||
buf_pool->page_hash = hash_create(2 * buf_pool->curr_size);
|
||||
/* zip_hash is allocated to shm when srv_buffer_pool_shm_key is enabled */
|
||||
if (!srv_buffer_pool_shm_key) {
|
||||
buf_pool->zip_hash = hash_create(2 * buf_pool->curr_size);
|
||||
}
|
||||
|
||||
buf_pool->last_printout_time = time(NULL);
|
||||
|
||||
@ -1414,86 +1078,6 @@ buf_pool_init(void)
|
||||
--------------------------- */
|
||||
/* All fields are initialized by mem_zalloc(). */
|
||||
|
||||
if (srv_buffer_pool_shm_key) {
|
||||
buf_shm_info_t* shm_info;
|
||||
|
||||
ut_a((byte*)chunk->blocks == (byte*)chunk->mem + sizeof(buf_shm_info_t));
|
||||
shm_info = chunk->mem;
|
||||
|
||||
buf_pool->zip_hash = (hash_table_t*)((byte*)chunk->mem + shm_info->zip_hash_offset);
|
||||
|
||||
if(shm_info->is_new) {
|
||||
shm_info->is_new = FALSE; /* initialization was finished */
|
||||
} else {
|
||||
buf_block_t* block = chunk->blocks;
|
||||
buf_page_t* b;
|
||||
|
||||
/* shm_info->buf_pool_backup should be converted */
|
||||
/* at buf_chunk_init(). So copy simply. */
|
||||
buf_pool->flush_list = shm_info->buf_pool_backup.flush_list;
|
||||
buf_pool->freed_page_clock = shm_info->buf_pool_backup.freed_page_clock;
|
||||
buf_pool->free = shm_info->buf_pool_backup.free;
|
||||
buf_pool->LRU = shm_info->buf_pool_backup.LRU;
|
||||
buf_pool->LRU_old = shm_info->buf_pool_backup.LRU_old;
|
||||
buf_pool->LRU_old_len = shm_info->buf_pool_backup.LRU_old_len;
|
||||
buf_pool->unzip_LRU = shm_info->buf_pool_backup.unzip_LRU;
|
||||
buf_pool->zip_clean = shm_info->buf_pool_backup.zip_clean;
|
||||
for (i = 0; i < BUF_BUDDY_SIZES_MAX; i++) {
|
||||
buf_pool->zip_free[i] = shm_info->buf_pool_backup.zip_free[i];
|
||||
}
|
||||
|
||||
for (i = 0; i < chunk->size; i++, block++) {
|
||||
if (buf_block_get_state(block)
|
||||
== BUF_BLOCK_FILE_PAGE) {
|
||||
ut_d(block->page.in_page_hash = TRUE);
|
||||
HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
|
||||
buf_page_address_fold(
|
||||
block->page.space,
|
||||
block->page.offset),
|
||||
&block->page);
|
||||
}
|
||||
}
|
||||
|
||||
for (b = UT_LIST_GET_FIRST(buf_pool->zip_clean); b;
|
||||
b = UT_LIST_GET_NEXT(zip_list, b)) {
|
||||
ut_ad(!b->in_flush_list);
|
||||
ut_ad(b->in_LRU_list);
|
||||
|
||||
ut_d(b->in_page_hash = TRUE);
|
||||
HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
|
||||
buf_page_address_fold(b->space, b->offset), b);
|
||||
}
|
||||
|
||||
for (b = UT_LIST_GET_FIRST(buf_pool->flush_list); b;
|
||||
b = UT_LIST_GET_NEXT(flush_list, b)) {
|
||||
ut_ad(b->in_flush_list);
|
||||
ut_ad(b->in_LRU_list);
|
||||
|
||||
switch (buf_page_get_state(b)) {
|
||||
case BUF_BLOCK_ZIP_DIRTY:
|
||||
ut_d(b->in_page_hash = TRUE);
|
||||
HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
|
||||
buf_page_address_fold(b->space,
|
||||
b->offset), b);
|
||||
break;
|
||||
case BUF_BLOCK_FILE_PAGE:
|
||||
/* uncompressed page */
|
||||
break;
|
||||
case BUF_BLOCK_ZIP_FREE:
|
||||
case BUF_BLOCK_ZIP_PAGE:
|
||||
case BUF_BLOCK_NOT_USED:
|
||||
case BUF_BLOCK_READY_FOR_USE:
|
||||
case BUF_BLOCK_MEMORY:
|
||||
case BUF_BLOCK_REMOVE_HASH:
|
||||
ut_error;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
mutex_exit(&LRU_list_mutex);
|
||||
rw_lock_x_unlock(&page_hash_latch);
|
||||
buf_pool_mutex_exit();
|
||||
@ -1518,34 +1102,6 @@ buf_pool_free(void)
|
||||
buf_chunk_t* chunk;
|
||||
buf_chunk_t* chunks;
|
||||
|
||||
if (srv_buffer_pool_shm_key) {
|
||||
buf_shm_info_t* shm_info;
|
||||
|
||||
ut_a(buf_pool->n_chunks == 1);
|
||||
|
||||
chunk = buf_pool->chunks;
|
||||
shm_info = chunk->mem;
|
||||
ut_a((byte*)chunk->blocks == (byte*)chunk->mem + sizeof(buf_shm_info_t));
|
||||
|
||||
/* validation the shared memory segment doesn't have unrecoverable contents. */
|
||||
/* Currently, validation became not needed */
|
||||
shm_info->reusable = TRUE;
|
||||
|
||||
memcpy(&(shm_info->buf_pool_backup), buf_pool, sizeof(buf_pool_t));
|
||||
memcpy(&(shm_info->chunk_backup), chunk, sizeof(buf_chunk_t));
|
||||
|
||||
if (srv_fast_shutdown < 2) {
|
||||
if (srv_buffer_pool_shm_checksum) {
|
||||
shm_info->checksum = ut_fold_binary_32((byte*)chunk->mem + sizeof(buf_shm_info_t),
|
||||
chunk->mem_size - sizeof(buf_shm_info_t));
|
||||
} else {
|
||||
shm_info->checksum = BUF_NO_CHECKSUM_MAGIC;
|
||||
}
|
||||
shm_info->clean = TRUE;
|
||||
}
|
||||
|
||||
os_shm_free(chunk->mem, chunk->mem_size);
|
||||
} else {
|
||||
chunks = buf_pool->chunks;
|
||||
chunk = chunks + buf_pool->n_chunks;
|
||||
|
||||
@ -1554,13 +1110,10 @@ buf_pool_free(void)
|
||||
would fail at shutdown. */
|
||||
os_mem_free_large(chunk->mem, chunk->mem_size);
|
||||
}
|
||||
}
|
||||
|
||||
mem_free(buf_pool->chunks);
|
||||
hash_table_free(buf_pool->page_hash);
|
||||
if (!srv_buffer_pool_shm_key) {
|
||||
hash_table_free(buf_pool->zip_hash);
|
||||
}
|
||||
mem_free(buf_pool);
|
||||
buf_pool = NULL;
|
||||
}
|
||||
@ -1755,11 +1308,6 @@ try_again:
|
||||
//buf_pool_mutex_enter();
|
||||
mutex_enter(&LRU_list_mutex);
|
||||
|
||||
if (srv_buffer_pool_shm_key) {
|
||||
/* Cannot support shrink */
|
||||
goto func_done;
|
||||
}
|
||||
|
||||
shrink_again:
|
||||
if (buf_pool->n_chunks <= 1) {
|
||||
|
||||
@ -2003,11 +1551,6 @@ void
|
||||
buf_pool_resize(void)
|
||||
/*=================*/
|
||||
{
|
||||
if (srv_buffer_pool_shm_key) {
|
||||
/* Cannot support resize */
|
||||
return;
|
||||
}
|
||||
|
||||
//buf_pool_mutex_enter();
|
||||
mutex_enter(&LRU_list_mutex);
|
||||
|
||||
|
@ -129,11 +129,16 @@ buf_flush_delete_from_flush_rbt(
|
||||
buf_page_t* bpage) /*!< in: bpage to be removed. */
|
||||
{
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
ibool ret = FALSE;
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
//ut_ad(buf_pool_mutex_own());
|
||||
ut_ad(mutex_own(&flush_list_mutex));
|
||||
ret = rbt_delete(buf_pool->flush_rbt, &bpage);
|
||||
#ifdef UNIV_DEBUG
|
||||
ret =
|
||||
#endif /* UNIV_DEBUG */
|
||||
rbt_delete(buf_pool->flush_rbt, &bpage);
|
||||
ut_ad(ret);
|
||||
}
|
||||
|
||||
@ -1303,7 +1308,6 @@ buf_flush_batch(
|
||||
buf_page_t* bpage;
|
||||
buf_page_t* prev_bpage = NULL;
|
||||
ulint page_count = 0;
|
||||
ulint old_page_count;
|
||||
ulint space;
|
||||
ulint offset;
|
||||
ulint remaining = 0;
|
||||
@ -1396,15 +1400,9 @@ flush_next:
|
||||
mutex_exit(&LRU_list_mutex);
|
||||
}
|
||||
|
||||
old_page_count = page_count;
|
||||
|
||||
/* Try to flush also all the neighbors */
|
||||
page_count += buf_flush_try_neighbors(
|
||||
space, offset, flush_type, srv_flush_neighbor_pages);
|
||||
/* fprintf(stderr,
|
||||
"Flush type %lu, page no %lu, neighb %lu\n",
|
||||
flush_type, offset,
|
||||
page_count - old_page_count); */
|
||||
|
||||
//buf_pool_mutex_enter();
|
||||
if (flush_type == BUF_FLUSH_LRU) {
|
||||
|
@ -693,7 +693,6 @@ dict_create_index_tree_step(
|
||||
{
|
||||
dict_index_t* index;
|
||||
dict_table_t* sys_indexes;
|
||||
dict_table_t* table;
|
||||
dtuple_t* search_tuple;
|
||||
ulint zip_size;
|
||||
btr_pcur_t pcur;
|
||||
@ -702,7 +701,6 @@ dict_create_index_tree_step(
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
index = node->index;
|
||||
table = node->table;
|
||||
|
||||
sys_indexes = dict_sys->sys_indexes;
|
||||
|
||||
|
@ -4791,7 +4791,6 @@ dict_index_print_low(
|
||||
{
|
||||
ib_int64_t n_vals;
|
||||
ulint i;
|
||||
const char* type_string;
|
||||
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
@ -4806,14 +4805,6 @@ dict_index_print_low(
|
||||
|
||||
dict_index_stat_mutex_exit(index);
|
||||
|
||||
if (dict_index_is_clust(index)) {
|
||||
type_string = "clustered index";
|
||||
} else if (dict_index_is_unique(index)) {
|
||||
type_string = "unique index";
|
||||
} else {
|
||||
type_string = "secondary index";
|
||||
}
|
||||
|
||||
fprintf(stderr,
|
||||
" INDEX: name %s, id %lu %lu, fields %lu/%lu,"
|
||||
" uniq %lu, type %lu\n"
|
||||
|
@ -384,18 +384,13 @@ eval_notfound(
|
||||
/*==========*/
|
||||
func_node_t* func_node) /*!< in: function node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2;
|
||||
sym_node_t* cursor;
|
||||
sel_node_t* sel_node;
|
||||
ibool ibool_val;
|
||||
|
||||
arg1 = func_node->args;
|
||||
arg2 = que_node_get_next(arg1);
|
||||
|
||||
ut_ad(func_node->func == PARS_NOTFOUND_TOKEN);
|
||||
|
||||
cursor = arg1;
|
||||
cursor = func_node->args;
|
||||
|
||||
ut_ad(que_node_get_type(cursor) == QUE_NODE_SYMBOL);
|
||||
|
||||
|
@ -127,70 +127,6 @@ hash_create(
|
||||
return(table);
|
||||
}
|
||||
|
||||
/*************************************************************//**
|
||||
*/
|
||||
UNIV_INTERN
|
||||
ulint
|
||||
hash_create_needed(
|
||||
/*===============*/
|
||||
ulint n)
|
||||
{
|
||||
ulint prime;
|
||||
ulint offset;
|
||||
|
||||
prime = ut_find_prime(n);
|
||||
|
||||
offset = (sizeof(hash_table_t) + 7) / 8;
|
||||
offset *= 8;
|
||||
|
||||
return(offset + sizeof(hash_cell_t) * prime);
|
||||
}
|
||||
|
||||
UNIV_INTERN
|
||||
void
|
||||
hash_create_init(
|
||||
/*=============*/
|
||||
hash_table_t* table,
|
||||
ulint n)
|
||||
{
|
||||
ulint prime;
|
||||
ulint offset;
|
||||
|
||||
prime = ut_find_prime(n);
|
||||
|
||||
offset = (sizeof(hash_table_t) + 7) / 8;
|
||||
offset *= 8;
|
||||
|
||||
table->array = (hash_cell_t*)(((byte*)table) + offset);
|
||||
table->n_cells = prime;
|
||||
# if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
|
||||
table->adaptive = FALSE;
|
||||
# endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
|
||||
table->n_mutexes = 0;
|
||||
table->mutexes = NULL;
|
||||
table->heaps = NULL;
|
||||
table->heap = NULL;
|
||||
ut_d(table->magic_n = HASH_TABLE_MAGIC_N);
|
||||
|
||||
/* Initialize the cell array */
|
||||
hash_table_clear(table);
|
||||
}
|
||||
|
||||
UNIV_INTERN
|
||||
void
|
||||
hash_create_reuse(
|
||||
/*==============*/
|
||||
hash_table_t* table)
|
||||
{
|
||||
ulint offset;
|
||||
|
||||
offset = (sizeof(hash_table_t) + 7) / 8;
|
||||
offset *= 8;
|
||||
|
||||
table->array = (hash_cell_t*)(((byte*)table) + offset);
|
||||
ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
|
||||
}
|
||||
|
||||
/*************************************************************//**
|
||||
Frees a hash table. */
|
||||
UNIV_INTERN
|
||||
|
@ -194,7 +194,6 @@ static my_bool innobase_rollback_on_timeout = FALSE;
|
||||
static my_bool innobase_create_status_file = FALSE;
|
||||
static my_bool innobase_stats_on_metadata = TRUE;
|
||||
static my_bool innobase_use_sys_stats_table = FALSE;
|
||||
static my_bool innobase_buffer_pool_shm_checksum = TRUE;
|
||||
|
||||
static char* internal_innobase_data_file_path = NULL;
|
||||
|
||||
@ -2427,7 +2426,6 @@ innobase_change_buffering_inited_ok:
|
||||
srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
|
||||
srv_use_checksums = (ibool) innobase_use_checksums;
|
||||
srv_fast_checksum = (ibool) innobase_fast_checksum;
|
||||
srv_buffer_pool_shm_checksum = (ibool) innobase_buffer_pool_shm_checksum;
|
||||
|
||||
#ifdef HAVE_LARGE_PAGES
|
||||
if ((os_use_large_pages = (ibool) my_use_large_pages))
|
||||
@ -7418,7 +7416,6 @@ innobase_drop_database(
|
||||
ulint len = 0;
|
||||
trx_t* trx;
|
||||
char* ptr;
|
||||
int error;
|
||||
char* namebuf;
|
||||
THD* thd = current_thd;
|
||||
|
||||
@ -7461,7 +7458,7 @@ innobase_drop_database(
|
||||
#else
|
||||
trx = innobase_trx_allocate(thd);
|
||||
#endif
|
||||
error = row_drop_database_for_mysql(namebuf, trx);
|
||||
row_drop_database_for_mysql(namebuf, trx);
|
||||
my_free(namebuf, MYF(0));
|
||||
|
||||
/* Flush the log to reduce probability that the .frm files and
|
||||
@ -9330,12 +9327,9 @@ innodb_show_status(
|
||||
|
||||
mutex_exit(&srv_monitor_file_mutex);
|
||||
|
||||
bool result = FALSE;
|
||||
stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
|
||||
STRING_WITH_LEN(""), str, flen);
|
||||
|
||||
if (stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
|
||||
STRING_WITH_LEN(""), str, flen)) {
|
||||
result= TRUE;
|
||||
}
|
||||
my_free(str, MYF(0));
|
||||
|
||||
DBUG_RETURN(FALSE);
|
||||
@ -11383,16 +11377,6 @@ static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
|
||||
"The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
|
||||
NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L);
|
||||
|
||||
static MYSQL_SYSVAR_UINT(buffer_pool_shm_key, srv_buffer_pool_shm_key,
|
||||
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
|
||||
"[experimental] The key value of shared memory segment for the buffer pool. 0 (default) disables the feature.",
|
||||
NULL, NULL, 0, 0, INT_MAX32, 0);
|
||||
|
||||
static MYSQL_SYSVAR_BOOL(buffer_pool_shm_checksum, innobase_buffer_pool_shm_checksum,
|
||||
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
|
||||
"Enable buffer_pool_shm checksum validation (enabled by default).",
|
||||
NULL, NULL, TRUE);
|
||||
|
||||
static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
|
||||
PLUGIN_VAR_RQCMDARG,
|
||||
"Helps in performance tuning in heavily concurrent environments.",
|
||||
@ -11658,8 +11642,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
|
||||
MYSQL_SYSVAR(additional_mem_pool_size),
|
||||
MYSQL_SYSVAR(autoextend_increment),
|
||||
MYSQL_SYSVAR(buffer_pool_size),
|
||||
MYSQL_SYSVAR(buffer_pool_shm_key),
|
||||
MYSQL_SYSVAR(buffer_pool_shm_checksum),
|
||||
MYSQL_SYSVAR(checksums),
|
||||
MYSQL_SYSVAR(fast_checksum),
|
||||
MYSQL_SYSVAR(commit_concurrency),
|
||||
|
@ -1876,6 +1876,7 @@ trx_i_s_common_fill_table(
|
||||
deadlock occurs between the mysqld server and mysql client,
|
||||
see http://bugs.mysql.com/29900 ; when that bug is resolved
|
||||
we can enable the DBUG_RETURN(ret) above */
|
||||
ret++; // silence a gcc46 warning
|
||||
DBUG_RETURN(0);
|
||||
#endif
|
||||
}
|
||||
|
@ -47,6 +47,5 @@ struct innodb_enhancement {
|
||||
{"innodb_fast_checksum","Using the checksum on 32bit-unit calculation","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
|
||||
{"innodb_files_extend","allow >4GB transaction log files, and can vary universal page size of datafiles","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
|
||||
{"innodb_sys_tables_sys_indexes","Expose InnoDB SYS_TABLES and SYS_INDEXES schema tables","","http://www.percona.com/docs/wiki/percona-xtradb"},
|
||||
{"innodb_buffer_pool_shm","Put buffer pool contents to shared memory segment and reuse it at clean restart [experimental]","","http://www.percona.com/docs/wiki/percona-xtradb"},
|
||||
{NULL, NULL, NULL, NULL}
|
||||
};
|
||||
|
@ -36,7 +36,6 @@ Created 11/5/1995 Heikki Tuuri
|
||||
#include "ut0rbt.h"
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
#include "os0proc.h"
|
||||
#include "srv0srv.h"
|
||||
|
||||
/** @name Modes for buf_page_get_gen */
|
||||
/* @{ */
|
||||
@ -1302,10 +1301,7 @@ struct buf_block_struct{
|
||||
/**********************************************************************//**
|
||||
Compute the hash fold value for blocks in buf_pool->zip_hash. */
|
||||
/* @{ */
|
||||
/* the fold should be relative when srv_buffer_pool_shm_key is enabled */
|
||||
#define BUF_POOL_ZIP_FOLD_PTR(ptr) (!srv_buffer_pool_shm_key\
|
||||
?((ulint) (ptr) / UNIV_PAGE_SIZE)\
|
||||
:((ulint) ((byte*)ptr - (byte*)(buf_pool->chunks->blocks->frame)) / UNIV_PAGE_SIZE))
|
||||
#define BUF_POOL_ZIP_FOLD_PTR(ptr) ((ulint) (ptr) / UNIV_PAGE_SIZE)
|
||||
#define BUF_POOL_ZIP_FOLD(b) BUF_POOL_ZIP_FOLD_PTR((b)->frame)
|
||||
#define BUF_POOL_ZIP_FOLD_BPAGE(b) BUF_POOL_ZIP_FOLD((buf_block_t*) (b))
|
||||
/* @} */
|
||||
|
@ -49,28 +49,6 @@ hash_table_t*
|
||||
hash_create(
|
||||
/*========*/
|
||||
ulint n); /*!< in: number of array cells */
|
||||
|
||||
/*************************************************************//**
|
||||
*/
|
||||
UNIV_INTERN
|
||||
ulint
|
||||
hash_create_needed(
|
||||
/*===============*/
|
||||
ulint n);
|
||||
|
||||
UNIV_INTERN
|
||||
void
|
||||
hash_create_init(
|
||||
/*=============*/
|
||||
hash_table_t* table,
|
||||
ulint n);
|
||||
|
||||
UNIV_INTERN
|
||||
void
|
||||
hash_create_reuse(
|
||||
/*==============*/
|
||||
hash_table_t* table);
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
/*************************************************************//**
|
||||
Creates a mutex array to protect a hash table. */
|
||||
@ -350,33 +328,6 @@ do {\
|
||||
}\
|
||||
} while (0)
|
||||
|
||||
/********************************************************************//**
|
||||
Align nodes with moving location.*/
|
||||
#define HASH_OFFSET(TABLE, NODE_TYPE, PTR_NAME, FADDR, FOFFSET, BOFFSET) \
|
||||
do {\
|
||||
ulint i2222;\
|
||||
ulint cell_count2222;\
|
||||
\
|
||||
cell_count2222 = hash_get_n_cells(TABLE);\
|
||||
\
|
||||
for (i2222 = 0; i2222 < cell_count2222; i2222++) {\
|
||||
NODE_TYPE* node2222;\
|
||||
\
|
||||
if ((TABLE)->array[i2222].node) \
|
||||
(TABLE)->array[i2222].node = (void*)((byte*)(TABLE)->array[i2222].node \
|
||||
+ (((TABLE)->array[i2222].node > (void*)FADDR)?FOFFSET:BOFFSET));\
|
||||
node2222 = HASH_GET_FIRST((TABLE), i2222);\
|
||||
\
|
||||
while (node2222) {\
|
||||
if (node2222->PTR_NAME) \
|
||||
node2222->PTR_NAME = (void*)((byte*)(node2222->PTR_NAME) \
|
||||
+ ((((void*)node2222->PTR_NAME) > (void*)FADDR)?FOFFSET:BOFFSET));\
|
||||
\
|
||||
node2222 = node2222->PTR_NAME;\
|
||||
}\
|
||||
}\
|
||||
} while (0)
|
||||
|
||||
/************************************************************//**
|
||||
Gets the mutex index for a fold value in a hash table.
|
||||
@return mutex number */
|
||||
|
@ -32,11 +32,6 @@ Created 9/30/1995 Heikki Tuuri
|
||||
#ifdef UNIV_LINUX
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#else
|
||||
# if defined HAVE_SYS_IPC_H && HAVE_SYS_SHM_H
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef void* os_process_t;
|
||||
@ -75,29 +70,6 @@ os_mem_free_large(
|
||||
ulint size); /*!< in: size returned by
|
||||
os_mem_alloc_large() */
|
||||
|
||||
|
||||
/****************************************************************//**
|
||||
Allocates or attaches and reuses shared memory segment.
|
||||
The content is not cleared automatically.
|
||||
@return allocated memory */
|
||||
UNIV_INTERN
|
||||
void*
|
||||
os_shm_alloc(
|
||||
/*=========*/
|
||||
ulint* n, /*!< in/out: number of bytes */
|
||||
uint key,
|
||||
ibool* is_new);
|
||||
|
||||
/****************************************************************//**
|
||||
Detach shared memory segment. */
|
||||
UNIV_INTERN
|
||||
void
|
||||
os_shm_free(
|
||||
/*========*/
|
||||
void *ptr, /*!< in: pointer returned by
|
||||
os_shm_alloc() */
|
||||
ulint size); /*!< in: size returned by
|
||||
os_shm_alloc() */
|
||||
#ifndef UNIV_NONINL
|
||||
#include "os0proc.ic"
|
||||
#endif
|
||||
|
@ -330,7 +330,7 @@ amount of increment. */
|
||||
Returns the old value of *ptr, atomically sets *ptr to new_val */
|
||||
|
||||
# define os_atomic_test_and_set_byte(ptr, new_val) \
|
||||
__sync_lock_test_and_set(ptr, new_val)
|
||||
__sync_lock_test_and_set(ptr, (byte) new_val)
|
||||
|
||||
#elif defined(HAVE_IB_SOLARIS_ATOMICS)
|
||||
|
||||
|
@ -159,10 +159,6 @@ extern ulint srv_buf_pool_curr_size; /*!< current size in bytes */
|
||||
extern ulint srv_mem_pool_size;
|
||||
extern ulint srv_lock_table_size;
|
||||
|
||||
extern uint srv_buffer_pool_shm_key;
|
||||
extern ibool srv_buffer_pool_shm_is_reused;
|
||||
extern ibool srv_buffer_pool_shm_checksum;
|
||||
|
||||
extern ibool srv_thread_concurrency_timer_based;
|
||||
|
||||
extern ulint srv_n_file_io_threads;
|
||||
|
@ -46,8 +46,8 @@ Created 1/20/1994 Heikki Tuuri
|
||||
|
||||
#define INNODB_VERSION_MAJOR 1
|
||||
#define INNODB_VERSION_MINOR 0
|
||||
#define INNODB_VERSION_BUGFIX 12
|
||||
#define PERCONA_INNODB_VERSION 12.1
|
||||
#define INNODB_VERSION_BUGFIX 13
|
||||
#define PERCONA_INNODB_VERSION 11.6
|
||||
|
||||
/* The following is the InnoDB version as shown in
|
||||
SELECT plugin_version FROM information_schema.plugins;
|
||||
|
@ -257,48 +257,5 @@ do { \
|
||||
ut_a(ut_list_node_313 == NULL); \
|
||||
} while (0)
|
||||
|
||||
/********************************************************************//**
|
||||
Align nodes with moving location.
|
||||
@param NAME the name of the list
|
||||
@param TYPE node type
|
||||
@param BASE base node (not a pointer to it)
|
||||
@param OFFSET offset moved */
|
||||
#define UT_LIST_OFFSET(NAME, TYPE, BASE, FADDR, FOFFSET, BOFFSET) \
|
||||
do { \
|
||||
ulint ut_list_i_313; \
|
||||
TYPE* ut_list_node_313; \
|
||||
\
|
||||
if ((BASE).start) \
|
||||
(BASE).start = (void*)((byte*)((BASE).start) \
|
||||
+ (((void*)((BASE).start) > (void*)FADDR)?FOFFSET:BOFFSET));\
|
||||
if ((BASE).end) \
|
||||
(BASE).end = (void*)((byte*)((BASE).end) \
|
||||
+ (((void*)((BASE).end) > (void*)FADDR)?FOFFSET:BOFFSET));\
|
||||
\
|
||||
ut_list_node_313 = (BASE).start; \
|
||||
\
|
||||
for (ut_list_i_313 = (BASE).count; ut_list_i_313--; ) { \
|
||||
ut_a(ut_list_node_313); \
|
||||
if ((ut_list_node_313->NAME).prev) \
|
||||
(ut_list_node_313->NAME).prev = (void*)((byte*)((ut_list_node_313->NAME).prev)\
|
||||
+ (((void*)((ut_list_node_313->NAME).prev) > (void*)FADDR)?FOFFSET:BOFFSET));\
|
||||
if ((ut_list_node_313->NAME).next) \
|
||||
(ut_list_node_313->NAME).next = (void*)((byte*)((ut_list_node_313->NAME).next)\
|
||||
+ (((void*)((ut_list_node_313->NAME).next)> (void*)FADDR)?FOFFSET:BOFFSET));\
|
||||
ut_list_node_313 = (ut_list_node_313->NAME).next; \
|
||||
} \
|
||||
\
|
||||
ut_a(ut_list_node_313 == NULL); \
|
||||
\
|
||||
ut_list_node_313 = (BASE).end; \
|
||||
\
|
||||
for (ut_list_i_313 = (BASE).count; ut_list_i_313--; ) { \
|
||||
ut_a(ut_list_node_313); \
|
||||
ut_list_node_313 = (ut_list_node_313->NAME).prev; \
|
||||
} \
|
||||
\
|
||||
ut_a(ut_list_node_313 == NULL); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -85,9 +85,6 @@ ut_rnd_gen_ulint(void)
|
||||
/*==================*/
|
||||
{
|
||||
ulint rnd;
|
||||
ulint n_bits;
|
||||
|
||||
n_bits = 8 * sizeof(ulint);
|
||||
|
||||
ut_rnd_ulint_counter = UT_RND1 * ut_rnd_ulint_counter + UT_RND2;
|
||||
|
||||
|
@ -567,10 +567,8 @@ recv_synchronize_groups(
|
||||
ib_uint64_t start_lsn;
|
||||
ib_uint64_t end_lsn;
|
||||
ib_uint64_t recovered_lsn;
|
||||
ib_uint64_t limit_lsn;
|
||||
|
||||
recovered_lsn = recv_sys->recovered_lsn;
|
||||
limit_lsn = recv_sys->limit_lsn;
|
||||
|
||||
/* Read the last recovered log block to the recovery system buffer:
|
||||
the block is always incomplete */
|
||||
@ -2901,7 +2899,6 @@ recv_init_crash_recovery(void)
|
||||
/*==========================*/
|
||||
{
|
||||
ut_a(!recv_needed_recovery);
|
||||
ut_a(!srv_buffer_pool_shm_is_reused);
|
||||
|
||||
recv_needed_recovery = TRUE;
|
||||
|
||||
@ -2964,7 +2961,9 @@ recv_recovery_from_checkpoint_start_func(
|
||||
ib_uint64_t old_scanned_lsn;
|
||||
ib_uint64_t group_scanned_lsn;
|
||||
ib_uint64_t contiguous_lsn;
|
||||
#ifdef UNIV_LOG_ARCHIVE
|
||||
ib_uint64_t archived_lsn;
|
||||
#endif /* UNIV_LOG_ARCHIVE */
|
||||
byte* buf;
|
||||
byte* log_hdr_buf;
|
||||
byte log_hdr_buf_base[LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE];
|
||||
@ -3022,7 +3021,9 @@ recv_recovery_from_checkpoint_start_func(
|
||||
|
||||
checkpoint_lsn = mach_read_ull(buf + LOG_CHECKPOINT_LSN);
|
||||
checkpoint_no = mach_read_ull(buf + LOG_CHECKPOINT_NO);
|
||||
#ifdef UNIV_LOG_ARCHIVE
|
||||
archived_lsn = mach_read_ull(buf + LOG_CHECKPOINT_ARCHIVED_LSN);
|
||||
#endif /* UNIV_LOG_ARCHIVE */
|
||||
|
||||
/* Read the first log file header to print a note if this is
|
||||
a recovery from a restored InnoDB Hot Backup */
|
||||
|
@ -1407,8 +1407,6 @@ try_again:
|
||||
int create_flag;
|
||||
ibool retry;
|
||||
const char* mode_str = NULL;
|
||||
const char* type_str = NULL;
|
||||
const char* purpose_str = NULL;
|
||||
|
||||
try_again:
|
||||
ut_a(name);
|
||||
@ -1428,26 +1426,9 @@ try_again:
|
||||
ut_error;
|
||||
}
|
||||
|
||||
if (type == OS_LOG_FILE) {
|
||||
type_str = "LOG";
|
||||
} else if (type == OS_DATA_FILE) {
|
||||
type_str = "DATA";
|
||||
} else {
|
||||
ut_error;
|
||||
}
|
||||
ut_a(type == OS_LOG_FILE || type == OS_DATA_FILE);
|
||||
ut_a(purpose == OS_FILE_AIO || purpose == OS_FILE_NORMAL);
|
||||
|
||||
if (purpose == OS_FILE_AIO) {
|
||||
purpose_str = "AIO";
|
||||
} else if (purpose == OS_FILE_NORMAL) {
|
||||
purpose_str = "NORMAL";
|
||||
} else {
|
||||
ut_error;
|
||||
}
|
||||
|
||||
#if 0
|
||||
fprintf(stderr, "Opening file %s, mode %s, type %s, purpose %s\n",
|
||||
name, mode_str, type_str, purpose_str);
|
||||
#endif
|
||||
#ifdef O_SYNC
|
||||
/* We let O_SYNC only affect log files; note that we map O_DSYNC to
|
||||
O_SYNC because the datasync options seemed to corrupt files in 2001
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user