1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
This commit is contained in:
Sergei Golubchik
2014-05-07 10:04:30 +02:00
parent 7226287c06
commit 04bce7b569
208 changed files with 3026 additions and 1138 deletions

View File

@ -3,6 +3,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source include/have_QC_Disabled.inc
--echo "General cleanup"

View File

@ -9,6 +9,3 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
hostcache_ipv4_max_con : BUG#14627287 27th Sept, 2012 Mayank
hostcache_ipv6_max_con : BUG#14627287 27th Sept, 2012 Mayank

View File

@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
--source include/have_QC_Disabled.inc

View File

@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
--source include/have_QC_Disabled.inc

View File

@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
--source include/have_QC_Disabled.inc

View File

@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
--source include/have_QC_Disabled.inc

View File

@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
--source include/have_QC_Disabled.inc

View File

@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
--source include/have_QC_Disabled.inc

View File

@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
--source include/have_QC_Disabled.inc

View File

@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
--source include/have_QC_Disabled.inc

View File

@ -16,6 +16,7 @@ update performance_schema.threads SET instrumented = 'YES'
WHERE PROCESSLIST_ID=connection_id();
# reset lost counters
truncate table performance_schema.events_statements_summary_by_digest;
flush status;
--disable_warnings

View File

@ -14,6 +14,7 @@ WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
# reset lost counters
truncate table performance_schema.events_statements_summary_by_digest;
flush status;
# Make sure objects are instrumented

View File

@ -18,10 +18,13 @@
select @@global.max_connect_errors into @saved_max_connect_errors;
set global max_connect_errors = 2;
set global max_connect_errors = 3;
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
create user 'quota'@'santa.claus.ipv4.example.com';
grant select on test.* to 'quota'@'santa.claus.ipv4.example.com';
connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
select "Con1 is alive";
select current_user();
@ -31,7 +34,7 @@ disconnect con1;
set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4,native_password_bad_reply";
--disable_query_log
--error ER_ACCESS_DENIED_ERROR
--error ER_HANDSHAKE_ERROR
connect (con2a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
@ -39,7 +42,7 @@ connect (con2a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_ACCESS_DENIED_ERROR
--error ER_HANDSHAKE_ERROR
connect (con2b,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
@ -47,7 +50,7 @@ connect (con2b,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_ACCESS_DENIED_ERROR
--error ER_HANDSHAKE_ERROR
connect (con2c,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
@ -74,8 +77,71 @@ connect (con2e,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
flush hosts;
--disable_query_log
--error ER_ACCESS_DENIED_ERROR
connect (con2c,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--error ER_HANDSHAKE_ERROR
connect (con3a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_HANDSHAKE_ERROR
connect (con3b,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
--source ../include/hostcache_dump.inc
--connection default
set global debug= "-d,native_password_bad_reply";
--disable_query_log
connect (con4,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
select "Valid connection should reset SUM_CONNECT_ERROR counter" as message;
--disconnect con4
--enable_query_log
--connection default
set global debug= "+d,native_password_bad_reply";
--connection default
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_HANDSHAKE_ERROR
connect (con5a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_HANDSHAKE_ERROR
connect (con5b,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_HANDSHAKE_ERROR
connect (con5c,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_HOST_IS_BLOCKED
connect (con5d,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_HOST_IS_BLOCKED
connect (con5e,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
@ -84,6 +150,9 @@ connect (con2c,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
drop user 'root'@'santa.claus.ipv4.example.com';
revoke select on test.* from 'quota'@'santa.claus.ipv4.example.com';
drop user 'quota'@'santa.claus.ipv4.example.com';
set global max_connect_errors = @saved_max_connect_errors;
set global debug= default;

View File

@ -19,10 +19,13 @@
select @@global.max_connect_errors into @saved_max_connect_errors;
set global max_connect_errors = 2;
set global max_connect_errors = 3;
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
create user 'quota'@'santa.claus.ipv6.example.com';
grant select on test.* to 'quota'@'santa.claus.ipv6.example.com';
connect (con1,"::1",root,,test,$MASTER_MYPORT,);
select "Con1 is alive";
select current_user();
@ -32,7 +35,7 @@ disconnect con1;
set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6,native_password_bad_reply";
--disable_query_log
--error ER_ACCESS_DENIED_ERROR
--error ER_HANDSHAKE_ERROR
connect (con2a,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
@ -40,7 +43,7 @@ connect (con2a,"::1",quota,,test,$MASTER_MYPORT,);
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_ACCESS_DENIED_ERROR
--error ER_HANDSHAKE_ERROR
connect (con2b,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
@ -48,7 +51,7 @@ connect (con2b,"::1",quota,,test,$MASTER_MYPORT,);
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_ACCESS_DENIED_ERROR
--error ER_HANDSHAKE_ERROR
connect (con2c,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
@ -75,8 +78,71 @@ connect (con2e,"::1",quota,,test,$MASTER_MYPORT,);
flush hosts;
--disable_query_log
--error ER_ACCESS_DENIED_ERROR
connect (con2c,"::1",quota,,test,$MASTER_MYPORT,);
--error ER_HANDSHAKE_ERROR
connect (con3a,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_HANDSHAKE_ERROR
connect (con3b,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
--source ../include/hostcache_dump.inc
--connection default
set global debug= "-d,native_password_bad_reply";
--disable_query_log
connect (con4,"::1",quota,,test,$MASTER_MYPORT,);
select "Valid connection should reset SUM_CONNECT_ERROR counter" as message;
--disconnect con4
--enable_query_log
--connection default
set global debug= "+d,native_password_bad_reply";
--connection default
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_HANDSHAKE_ERROR
connect (con5a,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_HANDSHAKE_ERROR
connect (con5b,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_HANDSHAKE_ERROR
connect (con5c,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_HOST_IS_BLOCKED
connect (con5d,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
--source ../include/hostcache_dump.inc
--disable_query_log
--error ER_HOST_IS_BLOCKED
connect (con5e,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
@ -85,6 +151,9 @@ connect (con2c,"::1",quota,,test,$MASTER_MYPORT,);
revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
drop user 'root'@'santa.claus.ipv6.example.com';
revoke select on test.* from 'quota'@'santa.claus.ipv6.example.com';
drop user 'quota'@'santa.claus.ipv6.example.com';
set global max_connect_errors = @saved_max_connect_errors;
set global debug= default;

View File

@ -15,6 +15,7 @@ update performance_schema.setup_consumers
truncate table performance_schema.events_waits_history_long;
# Reset lost counters to a known state
truncate table performance_schema.events_statements_summary_by_digest;
flush status;
# Code to test

View File

@ -7,6 +7,7 @@
--source include/not_windows.inc
--source ../include/no_protocol.inc
--source ../include/wait_for_pfs_thread_count.inc
--source include/have_QC_Disabled.inc
--disable_query_log
@ -45,11 +46,12 @@ update performance_schema.setup_instruments set enabled='YES', timed='YES'
update performance_schema.setup_instruments set enabled='YES', timed='YES'
where name in ('statement/sql/select',
'statement/com/',
'statement/com/Query',
'statement/abstract/new_packet',
'statement/abstract/Query',
'statement/com/error');
# Start from a known clean state, to avoid noise from previous tests
truncate table performance_schema.events_statements_summary_by_digest;
flush tables;
flush status;

View File

@ -44,7 +44,8 @@ begin
select count(name)
from performance_schema.setup_instruments
where name like (concat(instr_name, "%"))
where (name like (concat(instr_name, "%")))
and (not name like "%/abstract/%")
into count_expected;
set cmd_1= "select count(*) from (select distinct event_name from performance_schema.";
@ -138,6 +139,7 @@ call check_instrument("wait/");
call check_instrument("stage/");
call check_instrument("statement/com/");
call check_instrument("statement/sql/");
call check_instrument("statement/abstract/");
call check_instrument("statement/");
call check_instrument("idle/io/socket");
call check_instrument("idle/");

View File

@ -0,0 +1 @@
--binlog-format=mixed

View File

@ -0,0 +1 @@
--binlog-format=mixed

View File

@ -0,0 +1,338 @@
#
# Check statement instrumentation of replicated statements
#
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source ../include/no_protocol.inc
--source include/have_binlog_format_mixed.inc
--source include/master-slave.inc
#==============================================================
# Execute a variety of dml and ddl statements on the master.
# Verify that the corresponding statement events are generated
# on the slave.
#
# 1. Setup test files on master
# 2. Replicate test files to slave
# 3. Perform dml and ddl statements on master
# 4. Copy statement events on master into a temporary table
# 4. Replicate to slave
# 5. Compare statement events on slave to those from the master
# 6. Disable statement/abstract/relay_log on slave
# 7. Update some tables on the master then replicate
# 8. Verify that the updates were replicated but no statement
# events were recorded
#==============================================================
#
# UTILITY QUERIES
#
let $get_thread_id=
select thread_id into @my_thread_id
from performance_schema.threads
where processlist_id = connection_id();
let $disable_instruments=
update performance_schema.setup_instruments
set enabled='no', timed='no'
where name like '%statement/%';
let $enable_instruments= ../include
update performance_schema.setup_instruments
set enabled='yes', timed='yes'
where name like '%statement/%';
let $column_list=
thread_id, event_id, rpad(event_name, 28, ' ') event_name, rpad(current_schema, 10, ' ') current_schema, rpad(digest_text, 72, ' ') digest_text, sql_text;
# Define instrument name for enable/disable instruments
let $pfs_instrument='%statement/%';
--echo
--echo #
--echo # STEP 1 - CREATE AND REPLICATE TEST TABLES
--echo #
connection master;
--echo
--echo **************
--echo *** MASTER ***
--echo **************
--echo
--echo *** Create test tables
--echo
show variables like '%binlog_format%';
--disable_warnings
drop table if exists test.marker;
--enable_warnings
eval $get_thread_id;
create table test.marker(s1 int) engine=innodb;
sync_slave_with_master;
--echo **************
--echo *** SLAVE ***
--echo **************
--echo
--echo *** Clear statement events
--source ../include/rpl_statements_truncate.inc
--echo
--echo #
--echo # STEP 2 - REPLICATE ONE ROW ON MASTER TO GET REPLICATION THREAD ID ON SLAVE
--echo #
connection master;
--echo **************
--echo *** MASTER ***
--echo **************
--echo
insert into test.marker values (0);
--echo
sync_slave_with_master;
--echo **************
--echo *** SLAVE ***
--echo **************
--echo
--echo *** Verify row, get replication thread id, clear statement events
--echo
# TODO: Get slave thread id from threads using thread/sql/slave_sql event name
select thread_id into @slave_thread_id from performance_schema.events_statements_history
where sql_text like '%marker%';
let $slave_thread_id= `select @slave_thread_id`;
--echo *** Verify row inserted on master was replicated
select count(*) = 1 as 'Expect 1' from test.marker;
--echo *** Clear statement events
--source ../include/rpl_statements_truncate.inc
--echo
--echo #
--echo # STEP 3 - PERFORM DML STATEMENTS ON MASTER
--echo #
connection master;
--echo **************
--echo *** MASTER ***
--echo **************
--echo
show variables like '%binlog_format%';
--echo *** Clear statement events
--source ../include/rpl_statements_truncate.inc
--echo
--echo *** Create/drop table, create/drop database
--echo
create database marker1_db;
create database marker2_db;
create table marker1_db.table1 (s1 int) engine=innodb;
create table marker2_db.table1 (s1 int) engine=innodb;
create table marker2_db.table2 (s1 int) engine=innodb;
--echo
--echo *** Transaction
start transaction;
insert into marker1_db.table1 values (1), (2), (3);
insert into marker2_db.table1 values (1), (2), (3);
commit;
--echo
--echo *** Alter
alter table marker1_db.table1 add column (s2 varchar(32));
--echo
--echo *** Insert, Update
start transaction;
insert into marker1_db.table1 values (4, 'four'), (5, 'five'), (6, 'six');
update marker1_db.table1 set s1 = s1 + 1;
commit;
--echo
--echo *** Rollback
start transaction;
insert into marker1_db.table1 values (7, 'seven'), (8, 'eight'), (9, 'nine');
rollback;
--echo
--echo *** Autocommit, Delete, Drop
delete from marker1_db.table1 where s1 > 4;
drop table marker2_db.table1;
drop database marker2_db;
--source ../include/disable_instruments.inc
--echo
--echo *** Examine statements events that will be compared on the slave
--echo
--replace_column 1 [THREAD_ID] 2 [EVENT_ID]
eval select $column_list from performance_schema.events_statements_history_long
where sql_text like '%marker%' order by event_id;
--echo
--echo #
--echo # STEP 4 - REPLICATE STATEMENT EVENTS ON MASTER TO SLAVE
--echo #
--echo
--echo *** Store statement events in holding table, then replicate
--echo
--source ../include/disable_instruments.inc
--echo #
--echo # Create table to hold statement events for later comparison on the slave
--echo #
create table test.master_events_statements_history_long as
(select thread_id, event_id, event_name, sql_text, digest, digest_text, current_schema, rows_affected
from performance_schema.events_statements_history_long
where (thread_id=@my_thread_id and digest_text like '%marker%'));
--source ../include/enable_instruments.inc
--echo
--echo #
--echo # STEP 5 - VERIFY DML AND DDL STATEMENT EVENTS ON SLAVE
--echo #
sync_slave_with_master;
--echo **************
--echo *** SLAVE ***
--echo **************
--source ../include/disable_instruments.inc
--echo
--echo *** List statement events from master
--echo
--replace_column 1 [THREAD_ID] 2 [EVENT_ID]
eval select $column_list from master_events_statements_history_long order by event_id;
--echo
--echo *** List statement events on slave
--echo
--replace_column 1 [THREAD_ID] 2 [EVENT_ID]
eval select $column_list from performance_schema.events_statements_history_long
where thread_id = @slave_thread_id and sql_text like '%marker%' order by event_id;
--echo
--echo *** Compare master and slave events
--echo
# Note: The statement digest provides a more robust comparison than the
# event name. However, in some cases, e.g. DROP TABLE, the server generates
# its own version of the statement which includes additional quotes and a
# comment. A digest comparison is therefore impractical for server-generated
# statements, so we use both methods to ensure coverage.
--echo
--echo *** Event name comparison - expect 0 mismatches
--echo
select thread_id, event_id, event_name, digest_text, sql_text from performance_schema.events_statements_history_long t1
where t1.thread_id = @slave_thread_id and
sql_text like '%marker%' and
not exists (select * from master_events_statements_history_long t2 where t2.event_name = t1.event_name);
--echo
--echo *** Statement digest comparison - expect 1 mismatch for DROP TABLE
--echo
--replace_column 1 [THREAD_ID] 2 [EVENT_ID] 4 [DIGEST]
select thread_id, event_id, event_name, digest, digest_text, sql_text from performance_schema.events_statements_history_long t1
where t1.thread_id = @slave_thread_id and
sql_text like '%marker%' and
not exists (select * from master_events_statements_history_long t2 where t2.digest = t1.digest);
--echo
--echo #
--echo # STEP 6 - DISABLE REPLICATED STATEMENT EVENTS ON SLAVE
--echo #
--source ../include/rpl_statements_truncate.inc
--source ../include/enable_instruments.inc
update performance_schema.setup_instruments set enabled='no', timed='no'
where name like '%statement/abstract/relay_log%';
select * from performance_schema.setup_instruments where name like '%statement/abstract/relay_log%';
--echo
--echo #
--echo # STEP 7 - UPDATE TABLES ON MASTER, REPLICATE
--echo #
connection master;
--echo **************
--echo *** MASTER ***
--echo **************
--echo
--echo *** Clear statement events
--source ../include/rpl_statements_truncate.inc
--echo *** Update some tables, then replicate
--echo
insert into marker1_db.table1 values (999, '999'), (998, '998'), (997, '997');
--echo
--echo #
--echo # STEP 8 - VERIFY TABLE UPDATES FROM MASTER, EXPECT NO STATEMENT EVENTS ON SLAVE
--echo #
sync_slave_with_master;
--echo **************
--echo *** SLAVE ***
--echo **************
--echo
--echo *** Confirm rows were replicated
--echo
select * from marker1_db.table1 where s1 > 900 order by s1;
--echo
--echo *** Confirm that are no statements events from the replication thread
--echo
select * from performance_schema.events_statements_history_long
where thread_id = @slave_thread_id;
--source ../include/enable_instruments.inc
--echo
--echo #
--echo # STEP 9 - CLEAN UP
--echo #
--echo
--disable_query_log
--disable_warnings
connection master;
drop table test.marker;
drop table test.master_events_statements_history_long;
drop database marker1_db;
sync_slave_with_master;
--enable_warnings
--enable_query_log
--source include/rpl_end.inc

View File

@ -1,21 +1,30 @@
--no-console
--log-error=0
--loose-performance-schema-instrument='%=ON'
--loose-performance-schema-instrument=''
--loose-performance-schema-instrument=' wait/synch/mutex/sql/% = OFF ''
--loose-performance-schema-instrument='//wait/synch/mutex/sql/% = 'OFF ''
--loose-performance-schema-instrument=' wait/synch/mutex/sql/% = OFF '
--loose-performance-schema-instrument='''''
--loose-performance-schema-instrument=' / '
--loose-performance-schema-instrument=' wait/synch/mutex/sql/% = OFF '
--loose-performance-schema-instrument='wait/synch/mutex/sql/% = OFF '
--loose-performance-schema-instrument='wait/synch/mutex/sql/LOCK% = ON'
--loose-performance-schema-instrument='wait/synch/mutex/sql/LOCK_thread_count = OFF'
--loose-performance-schema-instrument='wait/synch/mutex/sql/LOCK_thread_count=OFF'
--loose-performance-schema-instrument=' wait/synch/mutex/sql/LOCK_user_conn = COUNTED'
--loose-performance-schema-instrument='wait%/synch/mutex/sql/LOCK_uu%_genera%/ = COUNTED'
--loose-performance-schema-instrument='%%wait/synch/mutex/sql/LOCK_xid_cache = COUNTED'
--loose-performance-schema-instrument='wait%/synch/mutex/sql/LOCK_uu%_genera%/= COUNTED'
--loose-performance-schema-instrument='%%wait/synch/mutex/sql/LOCK_xid_cache=COUNTED'
--loose-performance-schema-instrument='%=FOO'
--loose-performance-schema-instrument='%=%'
--loose-performance-schema-instrument='%'
--loose-performance-schema-instrument=''
--loose-performance-schema-instrument=' unknown%instrument/event/name with blanks = YES'
--loose-performance-schema-instrument='unknown/instrument/event/name = TRUE'
--loose-performance-schema-instrument='stage/sql/creating table = COUNTED'
--loose-performance-schema-instrument='wait/synch/mutex/sql/LOG_INFO::lock = 1'
--loose-performance-schema-instrument='wait/synch/mutex/sql/Delayed_insert::mutex = 0'
--loose-performance-schema-instrument='wait/synch/mutex/sql/THD::LOCK_thd_data = TRUE'
--loose-performance-schema-instrument='wait/synch/mutex/sql/hash_filo::lock = FALSE'
--loose-performance-schema-instrument='unknown/instrument/event/name = TRUE'
--loose-performance-schema-instrument='stage/sql/creating table = COUNTED'
--loose-performance-schema-instrument='wait/synch/mutex/sql/LOG_INFO::lock = 1'
--loose-performance-schema-instrument='wait/synch/mutex/sql/THD::LOCK_thd_data= TRUE'
--loose-performance-schema-instrument='wait/synch/mutex/sql/hash_filo::lock =FALSE'
--loose-performance-schema-instrument='wait/synch/mutex/sql/TABLE_SHARE::LOCK_ha_data= NO'

View File

@ -4,14 +4,18 @@
--source include/have_perfschema.inc
# Verify that the configuration options were applied correctly to the
# setup_instruments table. These instruments that are known to persist across
# performance_schema.setup_instruments table. These instruments that are known to persist across
# platforms and the various compile options.
--echo #
--echo # Verify that the configuration file defaults were processed correctly
--echo #
SELECT * FROM performance_schema.setup_instruments
WHERE name IN (
'wait/synch/mutex/sql/LOCK_user_conn',
'wait/synch/mutex/sql/LOCK_uuid_generator',
'wait/synch/mutex/sql/LOCK_xid_cache'
'wait/synch/mutex/sql/LOCK_xid_cache',
'stage/sql/creating table')
AND enabled = 'yes' AND timed = 'no'
ORDER BY name;
@ -28,13 +32,52 @@ AND enabled = 'yes' AND timed = 'yes'
ORDER BY name;
SELECT * FROM performance_schema.setup_instruments
WHERE name IN (
'wait/synch/mutex/sql/Delayed_insert::mutex',
'wait/synch/mutex/sql/hash_filo::lock')
WHERE name = 'wait/synch/mutex/sql/hash_filo::lock'
AND enabled = 'no' AND timed = 'no'
ORDER BY name;
#
# Verify that the instrument startup settings are not not visible.
#
SHOW VARIABLES LIKE "%/wait/synch/mutex%";
--echo #
--echo # Verify that the instrument startup settings are not not visible.
--echo #
SHOW VARIABLES LIKE "%/wait/synch/mutex%";
--echo #
--echo # Verify command line options are processed correctly
--echo #
# The instrument wait/io/table/sql/handler should be enabled and timed. We will
# restart the server with the instrument disabled from the command line.
--echo #
--echo # Verify that wait/io/table/sql/handler is enabled and timed
--echo #
SELECT * FROM performance_schema.setup_instruments
WHERE name like "%wait/io/table/sql/handler%";
# Write file to make mysql-test-run.pl wait for the server to stop
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Restart the server
--echo #
--echo # Stop server
--send_shutdown
--echo # Restart server with wait/io/table/sql/handler disabled
--exec echo "restart:--loose-performance-schema-instrument='%wait/io/table/sql/%=off'" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Turn on reconnect
--echo # Enable reconnect
--enable_reconnect
# Wait for server to be back online again
--echo # Wait until connected again
--source include/wait_until_connected_again.inc
# Turn off reconnect again
--echo # Disable reconnect
--disable_reconnect
--echo #
--echo # Verify that wait/io/table is disabled
--echo #
SELECT * FROM performance_schema.setup_instruments
WHERE name like "%wait/io/table/sql/handler%";

View File

@ -4,10 +4,13 @@
[mysqld.1]
# Default values used in the server, out of the box
table_definition_cache=400
table_open_cache=400
max_connections=151
open_files_limit=1024
# open_files_limit can be scaled down based on the os configuration (ulimit -n),
# so to get a stable test output, make sure ulimit -n is big enough
#
# What is supposed to happen here by default:
# table_open_cache = 2000
# table_definition_cache = 400 + 2000/2 = 1400
# max_connections = 151
# Automated sizing for everything

View File

@ -5,5 +5,27 @@
--source include/not_valgrind.inc
--source ../include/have_aligned_memory.inc
# Skip test if not defaults is used.
let $max_open_files_limit= `SELECT @@open_files_limit < 5000`;
if ($max_open_files_limit)
{
skip Need open_files_limit to be at least 5000;
}
let $max_table_open_cache= `SELECT @@table_open_cache != 2000`;
if ($max_table_open_cache)
{
skip Need table_open_cache to be exactly 2000;
}
let $max_table_definition_cache= `SELECT @@table_definition_cache != 1400`;
if ($max_table_definition_cache)
{
skip Need table_definition_cache to be exactly 1400;
}
let $max_connections= `SELECT @@max_connections != 151`;
if ($max_connections)
{
skip Need max_connections to be exactly 151;
}
--source ../include/sizing_auto.inc

View File

@ -6,6 +6,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source ../include/table_io_setup_helper.inc
--source include/have_QC_Disabled.inc
let $engine_type= MyISAM;
let $table_item= test.v1;