Commit 06d874ba authored by Sergei Golubchik's avatar Sergei Golubchik

perfschema 5.6.10 initial commit.

5.6 files
parent d7441439
# Test replication, when using special non-replicated tables.
#
# This test involve special statements that use non-replicated tables.
# Changes affecting non replicated tables are never written to the binlog.
# Executing these statements may or may not work, as the statements involved
# are edge cases.
# In MIXED or ROW binlog format, execution should succeed,
# and only partial data (the rows affecting replicated tables only)
# should be written to the binlog.
# In STATEMENT binlog format, execution should
# raise a warning (ER_BINLOG_UNSAFE_STATEMENT) if a non replicated table is
# only read from, or fail with an error (ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES)
# if a non replicated table is written to.
#
# SHOW ERRORS will print in the
# test .result file the exact outcome.
RESET MASTER;
--disable_warnings
drop database if exists my_replicated_db;
--enable_warnings
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create database my_replicated_db;
create table my_replicated_db.my_tx_table(a bigint) engine = innodb;
create table my_replicated_db.my_non_tx_table(a bigint) engine = myisam;
create table my_replicated_db.my_bh_table(a bigint) engine = blackhole;
use test;
drop table if exists marker_start;
use my_replicated_db;
insert into my_tx_table(a)
values (1000), (2000), (3000);
insert into my_non_tx_table(a)
values (1000), (2000), (3000);
insert into my_bh_table(a)
values (1000), (2000), (3000);
use test;
drop table if exists marker_insert_select;
use my_replicated_db;
# Note:
# The queries used here do not make any sense (no semantic).
# What this test is interrested in, is check the behavior
# when replicating queries that mix both:
# - non replicated tables
# - replicated tables
insert into my_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_non_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_bh_table(a)
select thread_id from performance_schema.threads;
# For the information_schema,
# no error is enforced yet.
# Documenting the current behavior
insert into my_tx_table(a)
select id from information_schema.processlist;
insert into my_non_tx_table(a)
select id from information_schema.processlist;
insert into my_bh_table(a)
select id from information_schema.processlist;
insert into my_tx_table(a)
select thread_id from mysql.general_log;
insert into my_non_tx_table(a)
select thread_id from mysql.general_log;
insert into my_bh_table(a)
select thread_id from mysql.general_log;
insert into my_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_non_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_bh_table(a)
select thread_id from mysql.slow_log;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_bh_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_non_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_bh_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
insert into my_bh_table(a)
select Relay_log_pos from mysql.slave_worker_info;
use test;
drop table if exists marker_multi_update;
use my_replicated_db;
--error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES
update my_tx_table, performance_schema.setup_instruments
set my_tx_table.a = my_tx_table.a + 1,
performance_schema.setup_instruments.timed= 'NO';
--error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES
update my_non_tx_table, performance_schema.setup_instruments
set my_non_tx_table.a = my_non_tx_table.a + 1,
performance_schema.setup_instruments.timed= 'NO';
--error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES
update my_bh_table, performance_schema.setup_instruments
set my_bh_table.a = my_bh_table.a + 1,
performance_schema.setup_instruments.timed= 'NO';
use test;
drop table if exists marker_multi_delete;
use my_replicated_db;
insert into performance_schema.setup_actors
values ('FOO', 'FOO', 'FOO');
--error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES
delete my_tx_table.*, performance_schema.setup_actors.*
from my_tx_table, performance_schema.setup_actors
where my_tx_table.a != 1000
or performance_schema.setup_actors.role='FOO';
insert into performance_schema.setup_actors
values ('BAR', 'BAR', 'BAR');
--error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES
delete my_non_tx_table.*, performance_schema.setup_actors.*
from my_non_tx_table, performance_schema.setup_actors
where my_non_tx_table.a != 1000
or performance_schema.setup_actors.role='BAR';
insert into performance_schema.setup_actors
values ('BAZ', 'BAZ', 'BAZ');
--error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES
delete my_bh_table.*, performance_schema.setup_actors.*
from my_bh_table, performance_schema.setup_actors
where my_bh_table.a != 1000
or performance_schema.setup_actors.role='BAZ';
use test;
drop table if exists marker_end;
drop database my_replicated_db;
--source include/show_binlog_events.inc
# Restore performance_schema.setup_actors, damaged by this script
truncate table performance_schema.setup_actors;
insert into performance_schema.setup_actors values ('%', '%', '%');
# Test replication, when using special non-replicated tables.
#
# This test involve special statements that use non-replicated tables.
# Changes affecting non replicated tables are never written to the binlog.
# Executing these statements should work nicely with replication in all cases:
# - STATEMENT binlog format
# - MIXED binlog format
# - ROW binlog format.
RESET MASTER;
--disable_warnings
drop database if exists my_local_db;
--enable_warnings
create database my_local_db;
create table my_local_db.my_tx_table(a bigint) engine = innodb;
create table my_local_db.my_non_tx_table(a bigint) engine = myisam;
use test;
drop table if exists marker_start;
# --binlog-ignore-db only works with the current database.
use my_local_db;
insert into my_tx_table(a)
values (1000), (2000), (3000);
insert into my_non_tx_table(a)
values (1000), (2000), (3000);
use test;
drop table if exists marker_truncate;
use performance_schema;
truncate table events_waits_history;
truncate table events_waits_history_long;
use test;
truncate table performance_schema.events_statements_history_long;
truncate table performance_schema.host_cache;
use test;
drop table if exists marker_update;
use performance_schema;
update setup_instruments set enabled='NO';
update setup_instruments set timed='NO';
use test;
update performance_schema.setup_instruments set enabled='YES', timed='YES';
update performance_schema.threads set instrumented='YES';
use test;
drop table if exists marker_insert;
insert into performance_schema.setup_actors(`user`, `host`, `role`)
values ('XXX', 'XXX', 'XXX'),
('YYY', 'YYY', 'YYY'),
('ZZZ', 'ZZZ', 'ZZZ');
select * from performance_schema.setup_actors
where user in ('XXX', 'YYY', 'ZZZ') order by user;
insert into performance_schema.setup_objects
(object_type, object_schema, object_name, enabled, timed)
values ('TABLE', 'DB1', 'AAA', 'YES', 'YES'),
('TABLE', 'DB1', 'BBB', 'NO', 'NO'),
('TABLE', 'DB2', 'CCC', 'YES', 'NO'),
('TABLE', 'DB2', 'DDD', 'NO', 'YES');
select * from performance_schema.setup_objects
where object_schema like 'DB%' order by object_name;
use test;
drop table if exists marker_insert_select;
# Note:
# The queries used here do not make any sense (no semantic).
# What this test is interrested in, is check the behavior
# when replicating queries that mix both:
# - non replicated tables
# - replicated tables
use my_local_db;
insert into my_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_non_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_tx_table(a)
select id from information_schema.processlist;
insert into my_non_tx_table(a)
select id from information_schema.processlist;
insert into my_tx_table(a)
select thread_id from mysql.general_log;
insert into my_non_tx_table(a)
select thread_id from mysql.general_log;
insert into my_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_non_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_non_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
use test;
drop table if exists marker_delete;
delete from performance_schema.setup_actors
where user in ('XXX', 'YYY', 'ZZZ');
delete from performance_schema.setup_objects
where object_schema like 'DB%';
use test;
drop table if exists marker_end;
drop database my_local_db;
# The content of the binlog dumped in the result file
# should not contain any references to non-replicated tables.
--source include/show_binlog_events.inc
# The performance schema internal structures are compiled with PFS_ALIGN,
# and the sizeof() structures is platform dependent.
#
# For tests sensitive to the internal sizes (show engine performance_schema
# status), make sure we use a platform with aligned memory.
--disable_query_log
let $aligned = `SELECT count(*) from performance_schema.session_connect_attrs where PROCESSLIST_ID = connection_id() and ATTR_NAME = '_os' and ATTR_VALUE in ('Linux', 'Windows')`;
if (!$aligned)
{
skip Need a platform with aligned memory;
}
--enable_query_log
set binlog_format=mixed;
RESET MASTER;
drop database if exists my_replicated_db;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create database my_replicated_db;
create table my_replicated_db.my_tx_table(a bigint) engine = innodb;
create table my_replicated_db.my_non_tx_table(a bigint) engine = myisam;
create table my_replicated_db.my_bh_table(a bigint) engine = blackhole;
use test;
drop table if exists marker_start;
Warnings:
Note 1051 Unknown table 'test.marker_start'
use my_replicated_db;
insert into my_tx_table(a)
values (1000), (2000), (3000);
insert into my_non_tx_table(a)
values (1000), (2000), (3000);
insert into my_bh_table(a)
values (1000), (2000), (3000);
use test;
drop table if exists marker_insert_select;
Warnings:
Note 1051 Unknown table 'test.marker_insert_select'
use my_replicated_db;
insert into my_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_non_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_bh_table(a)
select thread_id from performance_schema.threads;
insert into my_tx_table(a)
select id from information_schema.processlist;
insert into my_non_tx_table(a)
select id from information_schema.processlist;
insert into my_bh_table(a)
select id from information_schema.processlist;
insert into my_tx_table(a)
select thread_id from mysql.general_log;
insert into my_non_tx_table(a)
select thread_id from mysql.general_log;
insert into my_bh_table(a)
select thread_id from mysql.general_log;
insert into my_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_non_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_bh_table(a)
select thread_id from mysql.slow_log;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_bh_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_non_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_bh_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
insert into my_bh_table(a)
select Relay_log_pos from mysql.slave_worker_info;
use test;
drop table if exists marker_multi_update;
Warnings:
Note 1051 Unknown table 'test.marker_multi_update'
use my_replicated_db;
update my_tx_table, performance_schema.setup_instruments
set my_tx_table.a = my_tx_table.a + 1,
performance_schema.setup_instruments.timed= 'NO';
update my_non_tx_table, performance_schema.setup_instruments
set my_non_tx_table.a = my_non_tx_table.a + 1,
performance_schema.setup_instruments.timed= 'NO';
update my_bh_table, performance_schema.setup_instruments
set my_bh_table.a = my_bh_table.a + 1,
performance_schema.setup_instruments.timed= 'NO';
use test;
drop table if exists marker_multi_delete;
Warnings:
Note 1051 Unknown table 'test.marker_multi_delete'
use my_replicated_db;
insert into performance_schema.setup_actors
values ('FOO', 'FOO', 'FOO');
delete my_tx_table.*, performance_schema.setup_actors.*
from my_tx_table, performance_schema.setup_actors
where my_tx_table.a != 1000
or performance_schema.setup_actors.role='FOO';
insert into performance_schema.setup_actors
values ('BAR', 'BAR', 'BAR');
delete my_non_tx_table.*, performance_schema.setup_actors.*
from my_non_tx_table, performance_schema.setup_actors
where my_non_tx_table.a != 1000
or performance_schema.setup_actors.role='BAR';
insert into performance_schema.setup_actors
values ('BAZ', 'BAZ', 'BAZ');
delete my_bh_table.*, performance_schema.setup_actors.*
from my_bh_table, performance_schema.setup_actors
where my_bh_table.a != 1000
or performance_schema.setup_actors.role='BAZ';
use test;
drop table if exists marker_end;
Warnings:
Note 1051 Unknown table 'test.marker_end'
drop database my_replicated_db;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # drop database if exists my_replicated_db
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT' COLLATE 'latin1_swedish_ci'))
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # create database my_replicated_db
master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_tx_table(a bigint) engine = innodb
master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_non_tx_table(a bigint) engine = myisam
master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_bh_table(a bigint) engine = blackhole
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_start` /* generated by server */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a)
values (1000), (2000), (3000)
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a)
values (1000), (2000), (3000)
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a)
values (1000), (2000), (3000)
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_insert_select` /* generated by server */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_tx_table)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_non_tx_table)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_bh_table)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a)
select id from information_schema.processlist
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a)
select id from information_schema.processlist
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a)
select id from information_schema.processlist
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_multi_update` /* generated by server */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_tx_table)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_non_tx_table)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_multi_delete` /* generated by server */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_tx_table)
master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_non_tx_table)
master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_end` /* generated by server */
master-bin.000001 # Query # # drop database my_replicated_db
truncate table performance_schema.setup_actors;
insert into performance_schema.setup_actors values ('%', '%', '%');
set binlog_format=row;
RESET MASTER;
drop database if exists my_replicated_db;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create database my_replicated_db;
create table my_replicated_db.my_tx_table(a bigint) engine = innodb;
create table my_replicated_db.my_non_tx_table(a bigint) engine = myisam;
create table my_replicated_db.my_bh_table(a bigint) engine = blackhole;
use test;
drop table if exists marker_start;
Warnings:
Note 1051 Unknown table 'test.marker_start'
use my_replicated_db;
insert into my_tx_table(a)
values (1000), (2000), (3000);
insert into my_non_tx_table(a)
values (1000), (2000), (3000);
insert into my_bh_table(a)
values (1000), (2000), (3000);
use test;
drop table if exists marker_insert_select;
Warnings:
Note 1051 Unknown table 'test.marker_insert_select'
use my_replicated_db;
insert into my_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_non_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_bh_table(a)
select thread_id from performance_schema.threads;
insert into my_tx_table(a)
select id from information_schema.processlist;
insert into my_non_tx_table(a)
select id from information_schema.processlist;
insert into my_bh_table(a)
select id from information_schema.processlist;
insert into my_tx_table(a)
select thread_id from mysql.general_log;
insert into my_non_tx_table(a)
select thread_id from mysql.general_log;
insert into my_bh_table(a)
select thread_id from mysql.general_log;
insert into my_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_non_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_bh_table(a)
select thread_id from mysql.slow_log;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_bh_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_non_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_bh_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
insert into my_bh_table(a)
select Relay_log_pos from mysql.slave_worker_info;
use test;
drop table if exists marker_multi_update;
Warnings:
Note 1051 Unknown table 'test.marker_multi_update'
use my_replicated_db;
update my_tx_table, performance_schema.setup_instruments
set my_tx_table.a = my_tx_table.a + 1,
performance_schema.setup_instruments.timed= 'NO';
update my_non_tx_table, performance_schema.setup_instruments
set my_non_tx_table.a = my_non_tx_table.a + 1,
performance_schema.setup_instruments.timed= 'NO';
update my_bh_table, performance_schema.setup_instruments
set my_bh_table.a = my_bh_table.a + 1,
performance_schema.setup_instruments.timed= 'NO';
use test;
drop table if exists marker_multi_delete;
Warnings:
Note 1051 Unknown table 'test.marker_multi_delete'
use my_replicated_db;
insert into performance_schema.setup_actors
values ('FOO', 'FOO', 'FOO');
delete my_tx_table.*, performance_schema.setup_actors.*
from my_tx_table, performance_schema.setup_actors
where my_tx_table.a != 1000
or performance_schema.setup_actors.role='FOO';
insert into performance_schema.setup_actors
values ('BAR', 'BAR', 'BAR');
delete my_non_tx_table.*, performance_schema.setup_actors.*
from my_non_tx_table, performance_schema.setup_actors
where my_non_tx_table.a != 1000
or performance_schema.setup_actors.role='BAR';
insert into performance_schema.setup_actors
values ('BAZ', 'BAZ', 'BAZ');
delete my_bh_table.*, performance_schema.setup_actors.*
from my_bh_table, performance_schema.setup_actors
where my_bh_table.a != 1000
or performance_schema.setup_actors.role='BAZ';
use test;
drop table if exists marker_end;
Warnings:
Note 1051 Unknown table 'test.marker_end'
drop database my_replicated_db;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # drop database if exists my_replicated_db
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (mtr.test_suppressions)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # create database my_replicated_db
master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_tx_table(a bigint) engine = innodb
master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_non_tx_table(a bigint) engine = myisam
master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_bh_table(a bigint) engine = blackhole
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_start` /* generated by server */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_tx_table)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_non_tx_table)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_bh_table)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_insert_select` /* generated by server */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_tx_table)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_non_tx_table)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_bh_table)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_tx_table)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_non_tx_table)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_bh_table)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_multi_update` /* generated by server */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_tx_table)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_non_tx_table)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_multi_delete` /* generated by server */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_tx_table)
master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (my_replicated_db.my_non_tx_table)
master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_end` /* generated by server */
master-bin.000001 # Query # # drop database my_replicated_db
truncate table performance_schema.setup_actors;
insert into performance_schema.setup_actors values ('%', '%', '%');
set binlog_format=statement;
RESET MASTER;
drop database if exists my_replicated_db;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create database my_replicated_db;
create table my_replicated_db.my_tx_table(a bigint) engine = innodb;
create table my_replicated_db.my_non_tx_table(a bigint) engine = myisam;
create table my_replicated_db.my_bh_table(a bigint) engine = blackhole;
use test;
drop table if exists marker_start;
Warnings:
Note 1051 Unknown table 'test.marker_start'
use my_replicated_db;
insert into my_tx_table(a)
values (1000), (2000), (3000);
insert into my_non_tx_table(a)
values (1000), (2000), (3000);
insert into my_bh_table(a)
values (1000), (2000), (3000);
use test;
drop table if exists marker_insert_select;
Warnings:
Note 1051 Unknown table 'test.marker_insert_select'
use my_replicated_db;
insert into my_tx_table(a)
select thread_id from performance_schema.threads;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_non_tx_table(a)
select thread_id from performance_schema.threads;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_bh_table(a)
select thread_id from performance_schema.threads;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_tx_table(a)
select id from information_schema.processlist;
insert into my_non_tx_table(a)
select id from information_schema.processlist;
insert into my_bh_table(a)
select id from information_schema.processlist;
insert into my_tx_table(a)
select thread_id from mysql.general_log;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_non_tx_table(a)
select thread_id from mysql.general_log;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_bh_table(a)
select thread_id from mysql.general_log;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_tx_table(a)
select thread_id from mysql.slow_log;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_non_tx_table(a)
select thread_id from mysql.slow_log;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_bh_table(a)
select thread_id from mysql.slow_log;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_bh_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_non_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_bh_table(a)
select Master_log_pos from mysql.slave_master_info;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into my_bh_table(a)
select Relay_log_pos from mysql.slave_worker_info;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
use test;
drop table if exists marker_multi_update;
Warnings:
Note 1051 Unknown table 'test.marker_multi_update'
use my_replicated_db;
update my_tx_table, performance_schema.setup_instruments
set my_tx_table.a = my_tx_table.a + 1,
performance_schema.setup_instruments.timed= 'NO';
update my_non_tx_table, performance_schema.setup_instruments
set my_non_tx_table.a = my_non_tx_table.a + 1,
performance_schema.setup_instruments.timed= 'NO';
update my_bh_table, performance_schema.setup_instruments
set my_bh_table.a = my_bh_table.a + 1,
performance_schema.setup_instruments.timed= 'NO';
use test;
drop table if exists marker_multi_delete;
Warnings:
Note 1051 Unknown table 'test.marker_multi_delete'
use my_replicated_db;
insert into performance_schema.setup_actors
values ('FOO', 'FOO', 'FOO');
delete my_tx_table.*, performance_schema.setup_actors.*
from my_tx_table, performance_schema.setup_actors
where my_tx_table.a != 1000
or performance_schema.setup_actors.role='FOO';
insert into performance_schema.setup_actors
values ('BAR', 'BAR', 'BAR');
delete my_non_tx_table.*, performance_schema.setup_actors.*
from my_non_tx_table, performance_schema.setup_actors
where my_non_tx_table.a != 1000
or performance_schema.setup_actors.role='BAR';
insert into performance_schema.setup_actors
values ('BAZ', 'BAZ', 'BAZ');
delete my_bh_table.*, performance_schema.setup_actors.*
from my_bh_table, performance_schema.setup_actors
where my_bh_table.a != 1000
or performance_schema.setup_actors.role='BAZ';
use test;
drop table if exists marker_end;
Warnings:
Note 1051 Unknown table 'test.marker_end'
drop database my_replicated_db;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # drop database if exists my_replicated_db
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT' COLLATE 'latin1_swedish_ci'))
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # create database my_replicated_db
master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_tx_table(a bigint) engine = innodb
master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_non_tx_table(a bigint) engine = myisam
master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_bh_table(a bigint) engine = blackhole
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_start` /* generated by server */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a)
values (1000), (2000), (3000)
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a)
values (1000), (2000), (3000)
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a)
values (1000), (2000), (3000)
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_insert_select` /* generated by server */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a)
select thread_id from performance_schema.threads
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a)
select thread_id from performance_schema.threads
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a)
select thread_id from performance_schema.threads
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a)
select id from information_schema.processlist
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a)
select id from information_schema.processlist
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a)
select id from information_schema.processlist
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a)
select thread_id from mysql.general_log
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a)
select thread_id from mysql.general_log
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a)
select thread_id from mysql.general_log
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a)
select thread_id from mysql.slow_log
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a)
select thread_id from mysql.slow_log
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a)
select thread_id from mysql.slow_log
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a)
select Relay_log_pos from mysql.slave_relay_log_info
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a)
select Master_log_pos from mysql.slave_master_info
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a)
select Master_log_pos from mysql.slave_master_info
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a)
select Master_log_pos from mysql.slave_master_info
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a)
select Relay_log_pos from mysql.slave_worker_info
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_multi_update` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_multi_delete` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_end` /* generated by server */
master-bin.000001 # Query # # drop database my_replicated_db
truncate table performance_schema.setup_actors;
insert into performance_schema.setup_actors values ('%', '%', '%');
set binlog_format=mixed;
RESET MASTER;
drop database if exists my_local_db;
create database my_local_db;
create table my_local_db.my_tx_table(a bigint) engine = innodb;
create table my_local_db.my_non_tx_table(a bigint) engine = myisam;
use test;
drop table if exists marker_start;
Warnings:
Note 1051 Unknown table 'test.marker_start'
use my_local_db;
insert into my_tx_table(a)
values (1000), (2000), (3000);
insert into my_non_tx_table(a)
values (1000), (2000), (3000);
use test;
drop table if exists marker_truncate;
Warnings:
Note 1051 Unknown table 'test.marker_truncate'
use performance_schema;
truncate table events_waits_history;
truncate table events_waits_history_long;
use test;
truncate table performance_schema.events_statements_history_long;
truncate table performance_schema.host_cache;
use test;
drop table if exists marker_update;
Warnings:
Note 1051 Unknown table 'test.marker_update'
use performance_schema;
update setup_instruments set enabled='NO';
update setup_instruments set timed='NO';
use test;
update performance_schema.setup_instruments set enabled='YES', timed='YES';
update performance_schema.threads set instrumented='YES';
use test;
drop table if exists marker_insert;
Warnings:
Note 1051 Unknown table 'test.marker_insert'
insert into performance_schema.setup_actors(`user`, `host`, `role`)
values ('XXX', 'XXX', 'XXX'),
('YYY', 'YYY', 'YYY'),
('ZZZ', 'ZZZ', 'ZZZ');
select * from performance_schema.setup_actors
where user in ('XXX', 'YYY', 'ZZZ') order by user;
HOST USER ROLE
XXX XXX XXX
YYY YYY YYY
ZZZ ZZZ ZZZ
insert into performance_schema.setup_objects
(object_type, object_schema, object_name, enabled, timed)
values ('TABLE', 'DB1', 'AAA', 'YES', 'YES'),
('TABLE', 'DB1', 'BBB', 'NO', 'NO'),
('TABLE', 'DB2', 'CCC', 'YES', 'NO'),
('TABLE', 'DB2', 'DDD', 'NO', 'YES');
select * from performance_schema.setup_objects
where object_schema like 'DB%' order by object_name;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
TABLE DB1 AAA YES YES
TABLE DB1 BBB NO NO
TABLE DB2 CCC YES NO
TABLE DB2 DDD NO YES
use test;
drop table if exists marker_insert_select;
Warnings:
Note 1051 Unknown table 'test.marker_insert_select'
use my_local_db;
insert into my_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_non_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_tx_table(a)
select id from information_schema.processlist;
insert into my_non_tx_table(a)
select id from information_schema.processlist;
insert into my_tx_table(a)
select thread_id from mysql.general_log;
insert into my_non_tx_table(a)
select thread_id from mysql.general_log;
insert into my_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_non_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_non_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
use test;
drop table if exists marker_delete;
Warnings:
Note 1051 Unknown table 'test.marker_delete'
delete from performance_schema.setup_actors
where user in ('XXX', 'YYY', 'ZZZ');
delete from performance_schema.setup_objects
where object_schema like 'DB%';
use test;
drop table if exists marker_end;
Warnings:
Note 1051 Unknown table 'test.marker_end'
drop database my_local_db;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; create table my_local_db.my_tx_table(a bigint) engine = innodb
master-bin.000001 # Query # # use `test`; create table my_local_db.my_non_tx_table(a bigint) engine = myisam
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_start` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_truncate` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_update` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_insert` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_insert_select` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_delete` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_end` /* generated by server */
set binlog_format=row;
RESET MASTER;
drop database if exists my_local_db;
create database my_local_db;
create table my_local_db.my_tx_table(a bigint) engine = innodb;
create table my_local_db.my_non_tx_table(a bigint) engine = myisam;
use test;
drop table if exists marker_start;
Warnings:
Note 1051 Unknown table 'test.marker_start'
use my_local_db;
insert into my_tx_table(a)
values (1000), (2000), (3000);
insert into my_non_tx_table(a)
values (1000), (2000), (3000);
use test;
drop table if exists marker_truncate;
Warnings:
Note 1051 Unknown table 'test.marker_truncate'
use performance_schema;
truncate table events_waits_history;
truncate table events_waits_history_long;
use test;
truncate table performance_schema.events_statements_history_long;
truncate table performance_schema.host_cache;
use test;
drop table if exists marker_update;
Warnings:
Note 1051 Unknown table 'test.marker_update'
use performance_schema;
update setup_instruments set enabled='NO';
update setup_instruments set timed='NO';
use test;
update performance_schema.setup_instruments set enabled='YES', timed='YES';
update performance_schema.threads set instrumented='YES';
use test;
drop table if exists marker_insert;
Warnings:
Note 1051 Unknown table 'test.marker_insert'
insert into performance_schema.setup_actors(`user`, `host`, `role`)
values ('XXX', 'XXX', 'XXX'),
('YYY', 'YYY', 'YYY'),
('ZZZ', 'ZZZ', 'ZZZ');
select * from performance_schema.setup_actors
where user in ('XXX', 'YYY', 'ZZZ') order by user;
HOST USER ROLE
XXX XXX XXX
YYY YYY YYY
ZZZ ZZZ ZZZ
insert into performance_schema.setup_objects
(object_type, object_schema, object_name, enabled, timed)
values ('TABLE', 'DB1', 'AAA', 'YES', 'YES'),
('TABLE', 'DB1', 'BBB', 'NO', 'NO'),
('TABLE', 'DB2', 'CCC', 'YES', 'NO'),
('TABLE', 'DB2', 'DDD', 'NO', 'YES');
select * from performance_schema.setup_objects
where object_schema like 'DB%' order by object_name;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
TABLE DB1 AAA YES YES
TABLE DB1 BBB NO NO
TABLE DB2 CCC YES NO
TABLE DB2 DDD NO YES
use test;
drop table if exists marker_insert_select;
Warnings:
Note 1051 Unknown table 'test.marker_insert_select'
use my_local_db;
insert into my_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_non_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_tx_table(a)
select id from information_schema.processlist;
insert into my_non_tx_table(a)
select id from information_schema.processlist;
insert into my_tx_table(a)
select thread_id from mysql.general_log;
insert into my_non_tx_table(a)
select thread_id from mysql.general_log;
insert into my_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_non_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_non_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
use test;
drop table if exists marker_delete;
Warnings:
Note 1051 Unknown table 'test.marker_delete'
delete from performance_schema.setup_actors
where user in ('XXX', 'YYY', 'ZZZ');
delete from performance_schema.setup_objects
where object_schema like 'DB%';
use test;
drop table if exists marker_end;
Warnings:
Note 1051 Unknown table 'test.marker_end'
drop database my_local_db;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; create table my_local_db.my_tx_table(a bigint) engine = innodb
master-bin.000001 # Query # # use `test`; create table my_local_db.my_non_tx_table(a bigint) engine = myisam
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_start` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_truncate` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_update` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_insert` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_insert_select` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_delete` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_end` /* generated by server */
set binlog_format=statement;
RESET MASTER;
drop database if exists my_local_db;
create database my_local_db;
create table my_local_db.my_tx_table(a bigint) engine = innodb;
create table my_local_db.my_non_tx_table(a bigint) engine = myisam;
use test;
drop table if exists marker_start;
Warnings:
Note 1051 Unknown table 'test.marker_start'
use my_local_db;
insert into my_tx_table(a)
values (1000), (2000), (3000);
insert into my_non_tx_table(a)
values (1000), (2000), (3000);
use test;
drop table if exists marker_truncate;
Warnings:
Note 1051 Unknown table 'test.marker_truncate'
use performance_schema;
truncate table events_waits_history;
truncate table events_waits_history_long;
use test;
truncate table performance_schema.events_statements_history_long;
truncate table performance_schema.host_cache;
use test;
drop table if exists marker_update;
Warnings:
Note 1051 Unknown table 'test.marker_update'
use performance_schema;
update setup_instruments set enabled='NO';
update setup_instruments set timed='NO';
use test;
update performance_schema.setup_instruments set enabled='YES', timed='YES';
update performance_schema.threads set instrumented='YES';
use test;
drop table if exists marker_insert;
Warnings:
Note 1051 Unknown table 'test.marker_insert'
insert into performance_schema.setup_actors(`user`, `host`, `role`)
values ('XXX', 'XXX', 'XXX'),
('YYY', 'YYY', 'YYY'),
('ZZZ', 'ZZZ', 'ZZZ');
select * from performance_schema.setup_actors
where user in ('XXX', 'YYY', 'ZZZ') order by user;
HOST USER ROLE
XXX XXX XXX
YYY YYY YYY
ZZZ ZZZ ZZZ
insert into performance_schema.setup_objects
(object_type, object_schema, object_name, enabled, timed)
values ('TABLE', 'DB1', 'AAA', 'YES', 'YES'),
('TABLE', 'DB1', 'BBB', 'NO', 'NO'),
('TABLE', 'DB2', 'CCC', 'YES', 'NO'),
('TABLE', 'DB2', 'DDD', 'NO', 'YES');
select * from performance_schema.setup_objects
where object_schema like 'DB%' order by object_name;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
TABLE DB1 AAA YES YES
TABLE DB1 BBB NO NO
TABLE DB2 CCC YES NO
TABLE DB2 DDD NO YES
use test;
drop table if exists marker_insert_select;
Warnings:
Note 1051 Unknown table 'test.marker_insert_select'
use my_local_db;
insert into my_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_non_tx_table(a)
select thread_id from performance_schema.threads;
insert into my_tx_table(a)
select id from information_schema.processlist;
insert into my_non_tx_table(a)
select id from information_schema.processlist;
insert into my_tx_table(a)
select thread_id from mysql.general_log;
insert into my_non_tx_table(a)
select thread_id from mysql.general_log;
insert into my_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_non_tx_table(a)
select thread_id from mysql.slow_log;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_relay_log_info;
insert into my_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_non_tx_table(a)
select Master_log_pos from mysql.slave_master_info;
insert into my_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
insert into my_non_tx_table(a)
select Relay_log_pos from mysql.slave_worker_info;
use test;
drop table if exists marker_delete;
Warnings:
Note 1051 Unknown table 'test.marker_delete'
delete from performance_schema.setup_actors
where user in ('XXX', 'YYY', 'ZZZ');
delete from performance_schema.setup_objects
where object_schema like 'DB%';
use test;
drop table if exists marker_end;
Warnings:
Note 1051 Unknown table 'test.marker_end'
drop database my_local_db;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; create table my_local_db.my_tx_table(a bigint) engine = innodb
master-bin.000001 # Query # # use `test`; create table my_local_db.my_non_tx_table(a bigint) engine = myisam
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_start` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_truncate` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_update` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_insert` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_insert_select` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_delete` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_end` /* generated by server */
include/master-slave.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MySQL Manual for more about this issue and possible alternatives.
[connection master]
**** On Master ****
drop table if exists test.marker;
create table test.marker(a int) engine=innodb;
insert into test.marker values (1);
select * from test.marker;
a
1
truncate table performance_schema.events_waits_history_long;
truncate table performance_schema.events_statements_summary_by_digest;
update performance_schema.setup_instruments
set enabled='YES', timed='YES';
**** On Slave ****
truncate table performance_schema.events_waits_history_long;
truncate table performance_schema.events_statements_summary_by_digest;
update performance_schema.setup_instruments
set enabled='YES', timed='NO';
**** On Master ****
select * from performance_schema.setup_instruments
where timed='NO';
NAME ENABLED TIMED
select "This better be in the master" as in_master_digest;
in_master_digest
This better be in the master
insert into performance_schema.setup_objects
values ('TABLE', 'master', 'foo', 'YES', 'YES');
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
TABLE % % YES YES
TABLE information_schema % NO NO
TABLE master foo YES YES
TABLE mysql % NO NO
TABLE performance_schema % NO NO
select digest, digest_text, count_star
from performance_schema.events_statements_summary_by_digest
where digest_text like "%in_%_digest%";
digest digest_text count_star
8d588d616712c7d8dfabf22ce262662b SELECT ? AS in_master_digest 1
insert into test.marker values (2);
**** On Slave ****
select * from test.marker;
a
1
2
select * from performance_schema.setup_instruments
where timed='YES';
NAME ENABLED TIMED
select "This better be in the slave" as in_slave_digest;
in_slave_digest
This better be in the slave
insert into performance_schema.setup_objects
values ('TABLE', 'slave', 'foo', 'YES', 'YES');
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
TABLE % % YES YES
TABLE information_schema % NO NO
TABLE mysql % NO NO
TABLE performance_schema % NO NO
TABLE slave foo YES YES
select digest, digest_text, count_star
from performance_schema.events_statements_summary_by_digest
where digest_text like "%in_%_digest%";
digest digest_text count_star
02e25175edc3b2834b9b41d58f5a8a6a SELECT ? AS in_slave_digest 1
**** On Master ****
delete from performance_schema.setup_objects
where object_schema='master';
**** On Slave ****
delete from performance_schema.setup_objects
where object_schema='slave';
select * from performance_schema.setup_objects;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
TABLE mysql % NO NO
TABLE performance_schema % NO NO
TABLE information_schema % NO NO
TABLE % % YES YES
include/rpl_end.inc
show variables like "table_definition_cache";
Variable_name Value
table_definition_cache 400
show variables like "table_open_cache";
Variable_name Value
table_open_cache 400
show variables like "max_connections";
Variable_name Value
max_connections 151
show variables like "%performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 10
performance_schema_digests_size 1000
performance_schema_events_stages_history_long_size 100
performance_schema_events_stages_history_size 5
performance_schema_events_statements_history_long_size 100
performance_schema_events_statements_history_size 5
performance_schema_events_waits_history_long_size 100
performance_schema_events_waits_history_size 5
performance_schema_hosts_size 20
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 836
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 1556
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 3282
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 1724
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 179
performance_schema_max_stage_classes 150
performance_schema_max_statement_classes 167
performance_schema_max_table_handles 445
performance_schema_max_table_instances 445
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 224
performance_schema_session_connect_attrs_size 512
performance_schema_setup_actors_size 100
performance_schema_setup_objects_size 100
performance_schema_users_size 5
show status like "%performance_schema%";
Variable_name Value
Performance_schema_accounts_lost 0
Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
Performance_schema_stage_classes_lost 0
Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
show engine performance_schema status;
Type Name Status
performance_schema events_waits_current.row_size 184
performance_schema events_waits_current.row_count 1344
performance_schema events_waits_history.row_size 184
performance_schema events_waits_history.row_count 1120
performance_schema events_waits_history.memory 206080
performance_schema events_waits_history_long.row_size 184
performance_schema events_waits_history_long.row_count 100
performance_schema events_waits_history_long.memory 18400
performance_schema (pfs_mutex_class).row_size 256
performance_schema (pfs_mutex_class).row_count 200
performance_schema (pfs_mutex_class).memory 51200
performance_schema (pfs_rwlock_class).row_size 320
performance_schema (pfs_rwlock_class).row_count 30
performance_schema (pfs_rwlock_class).memory 9600
performance_schema (pfs_cond_class).row_size 256
performance_schema (pfs_cond_class).row_count 80
performance_schema (pfs_cond_class).memory 20480
performance_schema (pfs_thread_class).row_size 192
performance_schema (pfs_thread_class).row_count 50
performance_schema (pfs_thread_class).memory 9600
performance_schema (pfs_file_class).row_size 320
performance_schema (pfs_file_class).row_count 50
performance_schema (pfs_file_class).memory 16000
performance_schema mutex_instances.row_size 128
performance_schema mutex_instances.row_count 3282
performance_schema mutex_instances.memory 420096
performance_schema rwlock_instances.row_size 192
performance_schema rwlock_instances.row_count 1724
performance_schema rwlock_instances.memory 331008
performance_schema cond_instances.row_size 128
performance_schema cond_instances.row_count 836
performance_schema cond_instances.memory 107008
performance_schema threads.row_size 1856
performance_schema threads.row_count 224
performance_schema threads.memory 415744
performance_schema file_instances.row_size 704
performance_schema file_instances.row_count 1556
performance_schema file_instances.memory 1095424
performance_schema (pfs_file_handle).row_size 8
performance_schema (pfs_file_handle).row_count 32768
performance_schema (pfs_file_handle).memory 262144
performance_schema events_waits_summary_by_thread_by_event_name.row_size 32
performance_schema events_waits_summary_by_thread_by_event_name.row_count 83552
performance_schema events_waits_summary_by_thread_by_event_name.memory 2673664
performance_schema (pfs_table_share).row_size 22208
performance_schema (pfs_table_share).row_count 445
performance_schema (pfs_table_share).memory 9882560
performance_schema (pfs_table).row_size 9280
performance_schema (pfs_table).row_count 445
performance_schema (pfs_table).memory 4129600
performance_schema setup_actors.row_size 256
performance_schema setup_actors.row_count 100
performance_schema setup_actors.memory 25600
performance_schema setup_objects.row_size 448
performance_schema setup_objects.row_count 100
performance_schema setup_objects.memory 44800
performance_schema (pfs_account).row_size 256
performance_schema (pfs_account).row_count 10
performance_schema (pfs_account).memory 2560
performance_schema events_waits_summary_by_account_by_event_name.row_size 32
performance_schema events_waits_summary_by_account_by_event_name.row_count 3730
performance_schema events_waits_summary_by_account_by_event_name.memory 119360
performance_schema events_waits_summary_by_user_by_event_name.row_size 32
performance_schema events_waits_summary_by_user_by_event_name.row_count 1865
performance_schema events_waits_summary_by_user_by_event_name.memory 59680
performance_schema events_waits_summary_by_host_by_event_name.row_size 32
performance_schema events_waits_summary_by_host_by_event_name.row_count 7460
performance_schema events_waits_summary_by_host_by_event_name.memory 238720
performance_schema (pfs_user).row_size 128
performance_schema (pfs_user).row_count 5
performance_schema (pfs_user).memory 640
performance_schema (pfs_host).row_size 128
performance_schema (pfs_host).row_count 20
performance_schema (pfs_host).memory 2560
performance_schema (pfs_stage_class).row_size 192
performance_schema (pfs_stage_class).row_count 150
performance_schema (pfs_stage_class).memory 28800
performance_schema events_stages_history.row_size 88
performance_schema events_stages_history.row_count 1120
performance_schema events_stages_history.memory 98560
performance_schema events_stages_history_long.row_size 88
performance_schema events_stages_history_long.row_count 100
performance_schema events_stages_history_long.memory 8800
performance_schema events_stages_summary_by_thread_by_event_name.row_size 32
performance_schema events_stages_summary_by_thread_by_event_name.row_count 33600
performance_schema events_stages_summary_by_thread_by_event_name.memory 1075200
performance_schema events_stages_summary_global_by_event_name.row_size 32
performance_schema events_stages_summary_global_by_event_name.row_count 150
performance_schema events_stages_summary_global_by_event_name.memory 4800
performance_schema events_stages_summary_by_account_by_event_name.row_size 32
performance_schema events_stages_summary_by_account_by_event_name.row_count 1500
performance_schema events_stages_summary_by_account_by_event_name.memory 48000
performance_schema events_stages_summary_by_user_by_event_name.row_size 32
performance_schema events_stages_summary_by_user_by_event_name.row_count 750
performance_schema events_stages_summary_by_user_by_event_name.memory 24000
performance_schema events_stages_summary_by_host_by_event_name.row_size 32
performance_schema events_stages_summary_by_host_by_event_name.row_count 3000
performance_schema events_stages_summary_by_host_by_event_name.memory 96000
performance_schema (pfs_statement_class).row_size 192
performance_schema (pfs_statement_class).row_count 167
performance_schema (pfs_statement_class).memory 32064
performance_schema events_statements_history.row_size 3024
performance_schema events_statements_history.row_count 1120
performance_schema events_statements_history.memory 3386880
performance_schema events_statements_history_long.row_size 3024
performance_schema events_statements_history_long.row_count 100
performance_schema events_statements_history_long.memory 302400
performance_schema events_statements_summary_by_thread_by_event_name.row_size 184
performance_schema events_statements_summary_by_thread_by_event_name.row_count 37408
performance_schema events_statements_summary_by_thread_by_event_name.memory 6883072
performance_schema events_statements_summary_global_by_event_name.row_size 184
performance_schema events_statements_summary_global_by_event_name.row_count 167
performance_schema events_statements_summary_global_by_event_name.memory 30728
performance_schema events_statements_summary_by_account_by_event_name.row_size 184
performance_schema events_statements_summary_by_account_by_event_name.row_count 1670
performance_schema events_statements_summary_by_account_by_event_name.memory 307280
performance_schema events_statements_summary_by_user_by_event_name.row_size 184
performance_schema events_statements_summary_by_user_by_event_name.row_count 835
performance_schema events_statements_summary_by_user_by_event_name.memory 153640
performance_schema events_statements_summary_by_host_by_event_name.row_size 184
performance_schema events_statements_summary_by_host_by_event_name.row_count 3340
performance_schema events_statements_summary_by_host_by_event_name.memory 614560
performance_schema events_statements_current.row_size 3024
performance_schema events_statements_current.row_count 224
performance_schema events_statements_current.memory 677376
performance_schema (pfs_socket_class).row_size 320
performance_schema (pfs_socket_class).row_count 10
performance_schema (pfs_socket_class).memory 3200
performance_schema socket_instances.row_size 320
performance_schema socket_instances.row_count 179
performance_schema socket_instances.memory 57280
performance_schema events_statements_summary_by_digest.row_size 1472
performance_schema events_statements_summary_by_digest.row_count 1000
performance_schema events_statements_summary_by_digest.memory 1472000
performance_schema session_connect_attrs.row_size 224
performance_schema session_connect_attrs.row_count 512
performance_schema session_connect_attrs.memory 114688
performance_schema (account_hash).count 2
performance_schema (account_hash).size 10
performance_schema (digest_hash).count 0
performance_schema (digest_hash).size 1000
performance_schema (filename_hash).count 0
performance_schema (filename_hash).size 1556
performance_schema (host_hash).count 2
performance_schema (host_hash).size 20
performance_schema (setup_actor_hash).count 1
performance_schema (setup_actor_hash).size 100
performance_schema (setup_object_hash).count 4
performance_schema (setup_object_hash).size 100
performance_schema (table_share_hash).count 82
performance_schema (table_share_hash).size 445
performance_schema (user_hash).count 2
performance_schema (user_hash).size 5
performance_schema host_cache.size 336
performance_schema performance_schema.memory 35561856
flush status;
flush tables;
select * from performance_schema.mutex_instances;
select * from performance_schema.rwlock_instances;
select * from performance_schema.cond_instances;
select * from performance_schema.file_instances;
select count(*) from performance_schema.mutex_instances
into @v0_mutex_instances;
select count(*) from performance_schema.rwlock_instances
into @v0_rwlock_instances;
select count(*) from performance_schema.cond_instances
into @v0_cond_instances;
select count(*) from performance_schema.file_instances
into @v0_file_instances;
select count(*) from performance_schema.mutex_instances
into @v1_mutex_instances;
select count(*) from performance_schema.rwlock_instances
into @v1_rwlock_instances;
select count(*) from performance_schema.cond_instances
into @v1_cond_instances;
select count(*) from performance_schema.file_instances
into @v1_file_instances;
select count(name), name from performance_schema.mutex_instances
group by name;
select count(name), name from performance_schema.rwlock_instances
group by name;
select count(name), name from performance_schema.cond_instances
group by name;
select count(event_name), event_name from performance_schema.file_instances
group by event_name;
begin;
create table test.t1(a int) engine = innodb;
create table test.t2(a int) engine = innodb;
create table test.t3(a int) engine = innodb;
create table test.t4(a int) engine = innodb;
create table test.t5(a int) engine = innodb;
create table test.t6(a int) engine = innodb;
create table test.t7(a int) engine = innodb;
create table test.t8(a int) engine = innodb;
create table test.t9(a int) engine = innodb;
create table test.t10(a int) engine = innodb;
select * from test.t1;
select * from test.t2;
select * from test.t3;
select * from test.t4;
select * from test.t5;
select * from test.t6;
select * from test.t7;
select * from test.t8;
select * from test.t9;
select * from test.t10;
commit;
select count(*) from performance_schema.mutex_instances
into @v2_mutex_instances;
select count(*) from performance_schema.rwlock_instances
into @v2_rwlock_instances;
select count(*) from performance_schema.cond_instances
into @v2_cond_instances;
select count(*) from performance_schema.file_instances
into @v2_file_instances;
select count(name), name from performance_schema.mutex_instances
group by name;
select count(name), name from performance_schema.rwlock_instances
group by name;
select count(name), name from performance_schema.cond_instances
group by name;
select count(event_name), event_name from performance_schema.file_instances
group by event_name;
select @v2_mutex_instances, @v1_mutex_instances, @v0_mutex_instances;
select @v2_rwlock_instances, @v1_rwlock_instances, @v0_rwlock_instances;
select @v2_cond_instances, @v1_cond_instances, @v0_cond_instances;
select @v2_file_instances, @v1_file_instances, @v0_file_instances;
select round((@v2_mutex_instances - @v1_mutex_instances) / 10)
into @mutex_per_share;
select round((@v2_rwlock_instances - @v1_rwlock_instances) / 10)
into @rwlock_per_share;
select round((@v2_cond_instances - @v1_cond_instances) / 10)
into @cond_per_share;
select round((@v2_file_instances - @v1_file_instances) / 10)
into @file_per_share;
select "con1 connected";
select "con2 connected";
select "con3 connected";
select "con4 connected";
select "con5 connected";
select "con6 connected";
select "con7 connected";
select "con8 connected";
select "con9 connected";
select "con10 connected";
select count(*) from performance_schema.mutex_instances
into @v3_mutex_instances;
select count(*) from performance_schema.rwlock_instances
into @v3_rwlock_instances;
select count(*) from performance_schema.cond_instances
into @v3_cond_instances;
select count(*) from performance_schema.file_instances
into @v3_file_instances;
select count(name), name from performance_schema.mutex_instances
group by name;
select count(name), name from performance_schema.rwlock_instances
group by name;
select count(name), name from performance_schema.cond_instances
group by name;
select count(event_name), event_name from performance_schema.file_instances
group by event_name;
select @v3_mutex_instances, @v2_mutex_instances;
select @v3_rwlock_instances, @v2_rwlock_instances;
select @v3_cond_instances, @v2_cond_instances;
select @v3_file_instances, @v2_file_instances;
select round((@v3_mutex_instances - @v2_mutex_instances) / 10)
into @mutex_per_con;
select round((@v3_rwlock_instances - @v2_rwlock_instances) / 10)
into @rwlock_per_con;
select round((@v3_cond_instances - @v2_cond_instances) / 10)
into @cond_per_con;
select round((@v3_file_instances - @v2_file_instances) / 10)
into @file_per_con;
lock table test.t1 write, test.t2 write, test.t3 write, test.t4 write,
test.t5 write, test.t6 write, test.t7 write, test.t8 write, test.t9 write,
test.t10 write;
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
select count(*) from performance_schema.mutex_instances
into @v4_mutex_instances;
select count(*) from performance_schema.rwlock_instances
into @v4_rwlock_instances;
select count(*) from performance_schema.cond_instances
into @v4_cond_instances;
select count(*) from performance_schema.file_instances
into @v4_file_instances;
select count(name), name from performance_schema.mutex_instances
group by name;
select count(name), name from performance_schema.rwlock_instances
group by name;
select count(name), name from performance_schema.cond_instances
group by name;
select count(event_name), event_name from performance_schema.file_instances
group by event_name;
select @v4_mutex_instances, @v3_mutex_instances;
select @v4_rwlock_instances, @v3_rwlock_instances;
select @v4_cond_instances, @v3_cond_instances;
select @v4_file_instances, @v3_file_instances;
select round((@v4_mutex_instances - @v3_mutex_instances) / 10)
into @mutex_per_handle;
select round((@v4_rwlock_instances - @v3_rwlock_instances) / 10)
into @rwlock_per_handle;
select round((@v4_cond_instances - @v3_cond_instances) / 10)
into @cond_per_handle;
select round((@v4_file_instances - @v3_file_instances) / 10)
into @file_per_handle;
unlock tables;
drop table test.t1;
drop table test.t2;
drop table test.t3;
drop table test.t4;
drop table test.t5;
drop table test.t6;
drop table test.t7;
drop table test.t8;
drop table test.t9;
drop table test.t10;
show status like "performance_schema%";
Variable_name Value
Performance_schema_accounts_lost 0
Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
Performance_schema_stage_classes_lost 0
Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
select @rwlock_per_share <= 3;
@rwlock_per_share <= 3
1
select @cond_per_share;
@cond_per_share
0
select @file_per_share <= 3;
@file_per_share <= 3
1
select @mutex_per_con;
@mutex_per_con
3
select @rwlock_per_con;
@rwlock_per_con
1
select @cond_per_con;
@cond_per_con
2
select @file_per_con;
@file_per_con
0
select @mutex_per_handle;
@mutex_per_handle
0
select @rwlock_per_handle;
@rwlock_per_handle
0
select @cond_per_handle;
@cond_per_handle
0
select @file_per_handle;
@file_per_handle
0
select if(
(@rwlock_per_share <= 3)
AND (@cond_per_share = 0)
AND (@file_per_share <= 3)
AND (@mutex_per_con = 3)
AND (@rwlock_per_con = 1)
AND (@cond_per_con = 2)
AND (@file_per_con = 0)
AND (@mutex_per_handle = 0)
AND (@rwlock_per_handle = 0)
AND (@cond_per_handle = 0)
AND (@file_per_handle = 0),
"OK: heuristics are up to date",
"FAILED: heuristics need to be updated")
as status;
status
OK: heuristics are up to date
show variables like "table_definition_cache";
Variable_name Value
table_definition_cache 5000
show variables like "table_open_cache";
Variable_name Value
table_open_cache 400
show variables like "max_connections";
Variable_name Value
max_connections 200
show variables like "%performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
performance_schema_digests_size 10000
performance_schema_events_stages_history_long_size 10000
performance_schema_events_stages_history_size 10
performance_schema_events_statements_history_long_size 10000
performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_hosts_size 100
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 10900
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 23385
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 52200
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 30800
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 420
performance_schema_max_stage_classes 150
performance_schema_max_statement_classes 167
performance_schema_max_table_handles 800
performance_schema_max_table_instances 12500
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 500
performance_schema_session_connect_attrs_size 512
performance_schema_setup_actors_size 100
performance_schema_setup_objects_size 100
performance_schema_users_size 100
show status like "%performance_schema%";
Variable_name Value
Performance_schema_accounts_lost 0
Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
Performance_schema_stage_classes_lost 0
Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
show engine performance_schema status;
Type Name Status
performance_schema events_waits_current.row_size 184
performance_schema events_waits_current.row_count 3000
performance_schema events_waits_history.row_size 184
performance_schema events_waits_history.row_count 5000
performance_schema events_waits_history.memory 920000
performance_schema events_waits_history_long.row_size 184
performance_schema events_waits_history_long.row_count 10000
performance_schema events_waits_history_long.memory 1840000
performance_schema (pfs_mutex_class).row_size 256
performance_schema (pfs_mutex_class).row_count 200
performance_schema (pfs_mutex_class).memory 51200
performance_schema (pfs_rwlock_class).row_size 320
performance_schema (pfs_rwlock_class).row_count 30
performance_schema (pfs_rwlock_class).memory 9600
performance_schema (pfs_cond_class).row_size 256
performance_schema (pfs_cond_class).row_count 80
performance_schema (pfs_cond_class).memory 20480
performance_schema (pfs_thread_class).row_size 192
performance_schema (pfs_thread_class).row_count 50
performance_schema (pfs_thread_class).memory 9600
performance_schema (pfs_file_class).row_size 320
performance_schema (pfs_file_class).row_count 50
performance_schema (pfs_file_class).memory 16000
performance_schema mutex_instances.row_size 128
performance_schema mutex_instances.row_count 52200
performance_schema mutex_instances.memory 6681600
performance_schema rwlock_instances.row_size 192
performance_schema rwlock_instances.row_count 30800
performance_schema rwlock_instances.memory 5913600
performance_schema cond_instances.row_size 128
performance_schema cond_instances.row_count 10900
performance_schema cond_instances.memory 1395200
performance_schema threads.row_size 1856
performance_schema threads.row_count 500
performance_schema threads.memory 928000
performance_schema file_instances.row_size 704
performance_schema file_instances.row_count 23385
performance_schema file_instances.memory 16463040
performance_schema (pfs_file_handle).row_size 8
performance_schema (pfs_file_handle).row_count 32768
performance_schema (pfs_file_handle).memory 262144
performance_schema events_waits_summary_by_thread_by_event_name.row_size 32
performance_schema events_waits_summary_by_thread_by_event_name.row_count 186500
performance_schema events_waits_summary_by_thread_by_event_name.memory 5968000
performance_schema (pfs_table_share).row_size 22208
performance_schema (pfs_table_share).row_count 12500
performance_schema (pfs_table_share).memory 277600000
performance_schema (pfs_table).row_size 9280
performance_schema (pfs_table).row_count 800
performance_schema (pfs_table).memory 7424000
performance_schema setup_actors.row_size 256
performance_schema setup_actors.row_count 100
performance_schema setup_actors.memory 25600
performance_schema setup_objects.row_size 448
performance_schema setup_objects.row_count 100
performance_schema setup_objects.memory 44800
performance_schema (pfs_account).row_size 256
performance_schema (pfs_account).row_count 100
performance_schema (pfs_account).memory 25600
performance_schema events_waits_summary_by_account_by_event_name.row_size 32
performance_schema events_waits_summary_by_account_by_event_name.row_count 37300
performance_schema events_waits_summary_by_account_by_event_name.memory 1193600
performance_schema events_waits_summary_by_user_by_event_name.row_size 32
performance_schema events_waits_summary_by_user_by_event_name.row_count 37300
performance_schema events_waits_summary_by_user_by_event_name.memory 1193600
performance_schema events_waits_summary_by_host_by_event_name.row_size 32
performance_schema events_waits_summary_by_host_by_event_name.row_count 37300
performance_schema events_waits_summary_by_host_by_event_name.memory 1193600
performance_schema (pfs_user).row_size 128
performance_schema (pfs_user).row_count 100
performance_schema (pfs_user).memory 12800
performance_schema (pfs_host).row_size 128
performance_schema (pfs_host).row_count 100
performance_schema (pfs_host).memory 12800
performance_schema (pfs_stage_class).row_size 192
performance_schema (pfs_stage_class).row_count 150
performance_schema (pfs_stage_class).memory 28800
performance_schema events_stages_history.row_size 88
performance_schema events_stages_history.row_count 5000
performance_schema events_stages_history.memory 440000
performance_schema events_stages_history_long.row_size 88
performance_schema events_stages_history_long.row_count 10000
performance_schema events_stages_history_long.memory 880000
performance_schema events_stages_summary_by_thread_by_event_name.row_size 32
performance_schema events_stages_summary_by_thread_by_event_name.row_count 75000
performance_schema events_stages_summary_by_thread_by_event_name.memory 2400000
performance_schema events_stages_summary_global_by_event_name.row_size 32
performance_schema events_stages_summary_global_by_event_name.row_count 150
performance_schema events_stages_summary_global_by_event_name.memory 4800
performance_schema events_stages_summary_by_account_by_event_name.row_size 32
performance_schema events_stages_summary_by_account_by_event_name.row_count 15000
performance_schema events_stages_summary_by_account_by_event_name.memory 480000
performance_schema events_stages_summary_by_user_by_event_name.row_size 32
performance_schema events_stages_summary_by_user_by_event_name.row_count 15000
performance_schema events_stages_summary_by_user_by_event_name.memory 480000
performance_schema events_stages_summary_by_host_by_event_name.row_size 32
performance_schema events_stages_summary_by_host_by_event_name.row_count 15000
performance_schema events_stages_summary_by_host_by_event_name.memory 480000
performance_schema (pfs_statement_class).row_size 192
performance_schema (pfs_statement_class).row_count 167
performance_schema (pfs_statement_class).memory 32064
performance_schema events_statements_history.row_size 3024
performance_schema events_statements_history.row_count 5000
performance_schema events_statements_history.memory 15120000
performance_schema events_statements_history_long.row_size 3024
performance_schema events_statements_history_long.row_count 10000
performance_schema events_statements_history_long.memory 30240000
performance_schema events_statements_summary_by_thread_by_event_name.row_size 184
performance_schema events_statements_summary_by_thread_by_event_name.row_count 83500
performance_schema events_statements_summary_by_thread_by_event_name.memory 15364000
performance_schema events_statements_summary_global_by_event_name.row_size 184
performance_schema events_statements_summary_global_by_event_name.row_count 167
performance_schema events_statements_summary_global_by_event_name.memory 30728
performance_schema events_statements_summary_by_account_by_event_name.row_size 184
performance_schema events_statements_summary_by_account_by_event_name.row_count 16700
performance_schema events_statements_summary_by_account_by_event_name.memory 3072800
performance_schema events_statements_summary_by_user_by_event_name.row_size 184
performance_schema events_statements_summary_by_user_by_event_name.row_count 16700
performance_schema events_statements_summary_by_user_by_event_name.memory 3072800
performance_schema events_statements_summary_by_host_by_event_name.row_size 184
performance_schema events_statements_summary_by_host_by_event_name.row_count 16700
performance_schema events_statements_summary_by_host_by_event_name.memory 3072800
performance_schema events_statements_current.row_size 3024
performance_schema events_statements_current.row_count 500
performance_schema events_statements_current.memory 1512000
performance_schema (pfs_socket_class).row_size 320
performance_schema (pfs_socket_class).row_count 10
performance_schema (pfs_socket_class).memory 3200
performance_schema socket_instances.row_size 320
performance_schema socket_instances.row_count 420
performance_schema socket_instances.memory 134400
performance_schema events_statements_summary_by_digest.row_size 1472
performance_schema events_statements_summary_by_digest.row_count 10000
performance_schema events_statements_summary_by_digest.memory 14720000
performance_schema session_connect_attrs.row_size 500
performance_schema session_connect_attrs.row_count 512
performance_schema session_connect_attrs.memory 256000
performance_schema (account_hash).count 2
performance_schema (account_hash).size 100
performance_schema (digest_hash).count 0
performance_schema (digest_hash).size 10000
performance_schema (filename_hash).count 0
performance_schema (filename_hash).size 23385
performance_schema (host_hash).count 2
performance_schema (host_hash).size 100
performance_schema (setup_actor_hash).count 1
performance_schema (setup_actor_hash).size 100
performance_schema (setup_object_hash).count 4
performance_schema (setup_object_hash).size 100
performance_schema (table_share_hash).count 82
performance_schema (table_share_hash).size 12500
performance_schema (user_hash).count 2
performance_schema (user_hash).size 100
performance_schema host_cache.size 336
performance_schema performance_schema.memory 421029256
show variables like "table_definition_cache";
Variable_name Value
table_definition_cache 400
show variables like "table_open_cache";
Variable_name Value
table_open_cache 100
show variables like "max_connections";
Variable_name Value
max_connections 50
show variables like "%performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 10
performance_schema_digests_size 1000
performance_schema_events_stages_history_long_size 100
performance_schema_events_stages_history_size 5
performance_schema_events_statements_history_long_size 100
performance_schema_events_statements_history_size 5
performance_schema_events_waits_history_long_size 100
performance_schema_events_waits_history_size 5
performance_schema_hosts_size 20
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 612
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 1556
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 2945
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 1612
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 67
performance_schema_max_stage_classes 150
performance_schema_max_statement_classes 167
performance_schema_max_table_handles 112
performance_schema_max_table_instances 445
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 112
performance_schema_session_connect_attrs_size 512
performance_schema_setup_actors_size 100
performance_schema_setup_objects_size 100
performance_schema_users_size 5
show status like "%performance_schema%";
Variable_name Value
Performance_schema_accounts_lost 0
Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
Performance_schema_stage_classes_lost 0
Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
show engine performance_schema status;
Type Name Status
performance_schema events_waits_current.row_size 184
performance_schema events_waits_current.row_count 672
performance_schema events_waits_history.row_size 184
performance_schema events_waits_history.row_count 560
performance_schema events_waits_history.memory 103040
performance_schema events_waits_history_long.row_size 184
performance_schema events_waits_history_long.row_count 100
performance_schema events_waits_history_long.memory 18400
performance_schema (pfs_mutex_class).row_size 256
performance_schema (pfs_mutex_class).row_count 200
performance_schema (pfs_mutex_class).memory 51200
performance_schema (pfs_rwlock_class).row_size 320
performance_schema (pfs_rwlock_class).row_count 30
performance_schema (pfs_rwlock_class).memory 9600
performance_schema (pfs_cond_class).row_size 256
performance_schema (pfs_cond_class).row_count 80
performance_schema (pfs_cond_class).memory 20480
performance_schema (pfs_thread_class).row_size 192
performance_schema (pfs_thread_class).row_count 50
performance_schema (pfs_thread_class).memory 9600
performance_schema (pfs_file_class).row_size 320
performance_schema (pfs_file_class).row_count 50
performance_schema (pfs_file_class).memory 16000
performance_schema mutex_instances.row_size 128
performance_schema mutex_instances.row_count 2945
performance_schema mutex_instances.memory 376960
performance_schema rwlock_instances.row_size 192
performance_schema rwlock_instances.row_count 1612
performance_schema rwlock_instances.memory 309504
performance_schema cond_instances.row_size 128
performance_schema cond_instances.row_count 612
performance_schema cond_instances.memory 78336
performance_schema threads.row_size 1856
performance_schema threads.row_count 112
performance_schema threads.memory 207872
performance_schema file_instances.row_size 704
performance_schema file_instances.row_count 1556
performance_schema file_instances.memory 1095424
performance_schema (pfs_file_handle).row_size 8
performance_schema (pfs_file_handle).row_count 32768
performance_schema (pfs_file_handle).memory 262144
performance_schema events_waits_summary_by_thread_by_event_name.row_size 32
performance_schema events_waits_summary_by_thread_by_event_name.row_count 41776
performance_schema events_waits_summary_by_thread_by_event_name.memory 1336832
performance_schema (pfs_table_share).row_size 22208
performance_schema (pfs_table_share).row_count 445
performance_schema (pfs_table_share).memory 9882560
performance_schema (pfs_table).row_size 9280
performance_schema (pfs_table).row_count 112
performance_schema (pfs_table).memory 1039360
performance_schema setup_actors.row_size 256
performance_schema setup_actors.row_count 100
performance_schema setup_actors.memory 25600
performance_schema setup_objects.row_size 448
performance_schema setup_objects.row_count 100
performance_schema setup_objects.memory 44800
performance_schema (pfs_account).row_size 256
performance_schema (pfs_account).row_count 10
performance_schema (pfs_account).memory 2560
performance_schema events_waits_summary_by_account_by_event_name.row_size 32
performance_schema events_waits_summary_by_account_by_event_name.row_count 3730
performance_schema events_waits_summary_by_account_by_event_name.memory 119360
performance_schema events_waits_summary_by_user_by_event_name.row_size 32
performance_schema events_waits_summary_by_user_by_event_name.row_count 1865
performance_schema events_waits_summary_by_user_by_event_name.memory 59680
performance_schema events_waits_summary_by_host_by_event_name.row_size 32
performance_schema events_waits_summary_by_host_by_event_name.row_count 7460
performance_schema events_waits_summary_by_host_by_event_name.memory 238720
performance_schema (pfs_user).row_size 128
performance_schema (pfs_user).row_count 5
performance_schema (pfs_user).memory 640
performance_schema (pfs_host).row_size 128
performance_schema (pfs_host).row_count 20
performance_schema (pfs_host).memory 2560
performance_schema (pfs_stage_class).row_size 192
performance_schema (pfs_stage_class).row_count 150
performance_schema (pfs_stage_class).memory 28800
performance_schema events_stages_history.row_size 88
performance_schema events_stages_history.row_count 560
performance_schema events_stages_history.memory 49280
performance_schema events_stages_history_long.row_size 88
performance_schema events_stages_history_long.row_count 100
performance_schema events_stages_history_long.memory 8800
performance_schema events_stages_summary_by_thread_by_event_name.row_size 32
performance_schema events_stages_summary_by_thread_by_event_name.row_count 16800
performance_schema events_stages_summary_by_thread_by_event_name.memory 537600
performance_schema events_stages_summary_global_by_event_name.row_size 32
performance_schema events_stages_summary_global_by_event_name.row_count 150
performance_schema events_stages_summary_global_by_event_name.memory 4800
performance_schema events_stages_summary_by_account_by_event_name.row_size 32
performance_schema events_stages_summary_by_account_by_event_name.row_count 1500
performance_schema events_stages_summary_by_account_by_event_name.memory 48000
performance_schema events_stages_summary_by_user_by_event_name.row_size 32
performance_schema events_stages_summary_by_user_by_event_name.row_count 750
performance_schema events_stages_summary_by_user_by_event_name.memory 24000
performance_schema events_stages_summary_by_host_by_event_name.row_size 32
performance_schema events_stages_summary_by_host_by_event_name.row_count 3000
performance_schema events_stages_summary_by_host_by_event_name.memory 96000
performance_schema (pfs_statement_class).row_size 192
performance_schema (pfs_statement_class).row_count 167
performance_schema (pfs_statement_class).memory 32064
performance_schema events_statements_history.row_size 3024
performance_schema events_statements_history.row_count 560
performance_schema events_statements_history.memory 1693440
performance_schema events_statements_history_long.row_size 3024
performance_schema events_statements_history_long.row_count 100
performance_schema events_statements_history_long.memory 302400
performance_schema events_statements_summary_by_thread_by_event_name.row_size 184
performance_schema events_statements_summary_by_thread_by_event_name.row_count 18704
performance_schema events_statements_summary_by_thread_by_event_name.memory 3441536
performance_schema events_statements_summary_global_by_event_name.row_size 184
performance_schema events_statements_summary_global_by_event_name.row_count 167
performance_schema events_statements_summary_global_by_event_name.memory 30728
performance_schema events_statements_summary_by_account_by_event_name.row_size 184
performance_schema events_statements_summary_by_account_by_event_name.row_count 1670
performance_schema events_statements_summary_by_account_by_event_name.memory 307280
performance_schema events_statements_summary_by_user_by_event_name.row_size 184
performance_schema events_statements_summary_by_user_by_event_name.row_count 835
performance_schema events_statements_summary_by_user_by_event_name.memory 153640
performance_schema events_statements_summary_by_host_by_event_name.row_size 184
performance_schema events_statements_summary_by_host_by_event_name.row_count 3340
performance_schema events_statements_summary_by_host_by_event_name.memory 614560
performance_schema events_statements_current.row_size 3024
performance_schema events_statements_current.row_count 112
performance_schema events_statements_current.memory 338688
performance_schema (pfs_socket_class).row_size 320
performance_schema (pfs_socket_class).row_count 10
performance_schema (pfs_socket_class).memory 3200
performance_schema socket_instances.row_size 320
performance_schema socket_instances.row_count 67
performance_schema socket_instances.memory 21440
performance_schema events_statements_summary_by_digest.row_size 1472
performance_schema events_statements_summary_by_digest.row_count 1000
performance_schema events_statements_summary_by_digest.memory 1472000
performance_schema session_connect_attrs.row_size 112
performance_schema session_connect_attrs.row_count 512
performance_schema session_connect_attrs.memory 57344
performance_schema (account_hash).count 2
performance_schema (account_hash).size 10
performance_schema (digest_hash).count 0
performance_schema (digest_hash).size 1000
performance_schema (filename_hash).count 0
performance_schema (filename_hash).size 1556
performance_schema (host_hash).count 2
performance_schema (host_hash).size 20
performance_schema (setup_actor_hash).count 1
performance_schema (setup_actor_hash).size 100
performance_schema (setup_object_hash).count 4
performance_schema (setup_object_hash).size 100
performance_schema (table_share_hash).count 82
performance_schema (table_share_hash).size 445
performance_schema (user_hash).count 2
performance_schema (user_hash).size 5
performance_schema host_cache.size 336
performance_schema performance_schema.memory 24576832
show variables like "table_definition_cache";
Variable_name Value
table_definition_cache 401
show variables like "table_open_cache";
Variable_name Value
table_open_cache 401
show variables like "max_connections";
Variable_name Value
max_connections 152
show variables like "%performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
performance_schema_digests_size 5000
performance_schema_events_stages_history_long_size 1000
performance_schema_events_stages_history_size 10
performance_schema_events_statements_history_long_size 1000
performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 1000
performance_schema_events_waits_history_size 10
performance_schema_hosts_size 100
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1079
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 1754
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 4230
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 2222
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 232
performance_schema_max_stage_classes 150
performance_schema_max_statement_classes 167
performance_schema_max_table_handles 573
performance_schema_max_table_instances 556
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 289
performance_schema_session_connect_attrs_size 512
performance_schema_setup_actors_size 100
performance_schema_setup_objects_size 100
performance_schema_users_size 100
show status like "%performance_schema%";
Variable_name Value
Performance_schema_accounts_lost 0
Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
Performance_schema_stage_classes_lost 0
Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
show engine performance_schema status;
Type Name Status
performance_schema events_waits_current.row_size 184
performance_schema events_waits_current.row_count 1734
performance_schema events_waits_history.row_size 184
performance_schema events_waits_history.row_count 2890
performance_schema events_waits_history.memory 531760
performance_schema events_waits_history_long.row_size 184
performance_schema events_waits_history_long.row_count 1000
performance_schema events_waits_history_long.memory 184000
performance_schema (pfs_mutex_class).row_size 256
performance_schema (pfs_mutex_class).row_count 200
performance_schema (pfs_mutex_class).memory 51200
performance_schema (pfs_rwlock_class).row_size 320
performance_schema (pfs_rwlock_class).row_count 30
performance_schema (pfs_rwlock_class).memory 9600
performance_schema (pfs_cond_class).row_size 256
performance_schema (pfs_cond_class).row_count 80
performance_schema (pfs_cond_class).memory 20480
performance_schema (pfs_thread_class).row_size 192
performance_schema (pfs_thread_class).row_count 50
performance_schema (pfs_thread_class).memory 9600
performance_schema (pfs_file_class).row_size 320
performance_schema (pfs_file_class).row_count 50
performance_schema (pfs_file_class).memory 16000
performance_schema mutex_instances.row_size 128
performance_schema mutex_instances.row_count 4230
performance_schema mutex_instances.memory 541440
performance_schema rwlock_instances.row_size 192
performance_schema rwlock_instances.row_count 2222
performance_schema rwlock_instances.memory 426624
performance_schema cond_instances.row_size 128
performance_schema cond_instances.row_count 1079
performance_schema cond_instances.memory 138112
performance_schema threads.row_size 1856
performance_schema threads.row_count 289
performance_schema threads.memory 536384
performance_schema file_instances.row_size 704
performance_schema file_instances.row_count 1754
performance_schema file_instances.memory 1234816
performance_schema (pfs_file_handle).row_size 8
performance_schema (pfs_file_handle).row_count 32768
performance_schema (pfs_file_handle).memory 262144
performance_schema events_waits_summary_by_thread_by_event_name.row_size 32
performance_schema events_waits_summary_by_thread_by_event_name.row_count 107797
performance_schema events_waits_summary_by_thread_by_event_name.memory 3449504
performance_schema (pfs_table_share).row_size 22208
performance_schema (pfs_table_share).row_count 556
performance_schema (pfs_table_share).memory 12347648
performance_schema (pfs_table).row_size 9280
performance_schema (pfs_table).row_count 573
performance_schema (pfs_table).memory 5317440
performance_schema setup_actors.row_size 256
performance_schema setup_actors.row_count 100
performance_schema setup_actors.memory 25600
performance_schema setup_objects.row_size 448
performance_schema setup_objects.row_count 100
performance_schema setup_objects.memory 44800
performance_schema (pfs_account).row_size 256
performance_schema (pfs_account).row_count 100
performance_schema (pfs_account).memory 25600
performance_schema events_waits_summary_by_account_by_event_name.row_size 32
performance_schema events_waits_summary_by_account_by_event_name.row_count 37300
performance_schema events_waits_summary_by_account_by_event_name.memory 1193600
performance_schema events_waits_summary_by_user_by_event_name.row_size 32
performance_schema events_waits_summary_by_user_by_event_name.row_count 37300
performance_schema events_waits_summary_by_user_by_event_name.memory 1193600
performance_schema events_waits_summary_by_host_by_event_name.row_size 32
performance_schema events_waits_summary_by_host_by_event_name.row_count 37300
performance_schema events_waits_summary_by_host_by_event_name.memory 1193600
performance_schema (pfs_user).row_size 128
performance_schema (pfs_user).row_count 100
performance_schema (pfs_user).memory 12800
performance_schema (pfs_host).row_size 128
performance_schema (pfs_host).row_count 100
performance_schema (pfs_host).memory 12800
performance_schema (pfs_stage_class).row_size 192
performance_schema (pfs_stage_class).row_count 150
performance_schema (pfs_stage_class).memory 28800
performance_schema events_stages_history.row_size 88
performance_schema events_stages_history.row_count 2890
performance_schema events_stages_history.memory 254320
performance_schema events_stages_history_long.row_size 88
performance_schema events_stages_history_long.row_count 1000
performance_schema events_stages_history_long.memory 88000
performance_schema events_stages_summary_by_thread_by_event_name.row_size 32
performance_schema events_stages_summary_by_thread_by_event_name.row_count 43350
performance_schema events_stages_summary_by_thread_by_event_name.memory 1387200
performance_schema events_stages_summary_global_by_event_name.row_size 32
performance_schema events_stages_summary_global_by_event_name.row_count 150
performance_schema events_stages_summary_global_by_event_name.memory 4800
performance_schema events_stages_summary_by_account_by_event_name.row_size 32
performance_schema events_stages_summary_by_account_by_event_name.row_count 15000
performance_schema events_stages_summary_by_account_by_event_name.memory 480000
performance_schema events_stages_summary_by_user_by_event_name.row_size 32
performance_schema events_stages_summary_by_user_by_event_name.row_count 15000
performance_schema events_stages_summary_by_user_by_event_name.memory 480000
performance_schema events_stages_summary_by_host_by_event_name.row_size 32
performance_schema events_stages_summary_by_host_by_event_name.row_count 15000
performance_schema events_stages_summary_by_host_by_event_name.memory 480000
performance_schema (pfs_statement_class).row_size 192
performance_schema (pfs_statement_class).row_count 167
performance_schema (pfs_statement_class).memory 32064
performance_schema events_statements_history.row_size 3024
performance_schema events_statements_history.row_count 2890
performance_schema events_statements_history.memory 8739360
performance_schema events_statements_history_long.row_size 3024
performance_schema events_statements_history_long.row_count 1000
performance_schema events_statements_history_long.memory 3024000
performance_schema events_statements_summary_by_thread_by_event_name.row_size 184
performance_schema events_statements_summary_by_thread_by_event_name.row_count 48263
performance_schema events_statements_summary_by_thread_by_event_name.memory 8880392
performance_schema events_statements_summary_global_by_event_name.row_size 184
performance_schema events_statements_summary_global_by_event_name.row_count 167
performance_schema events_statements_summary_global_by_event_name.memory 30728
performance_schema events_statements_summary_by_account_by_event_name.row_size 184
performance_schema events_statements_summary_by_account_by_event_name.row_count 16700
performance_schema events_statements_summary_by_account_by_event_name.memory 3072800
performance_schema events_statements_summary_by_user_by_event_name.row_size 184
performance_schema events_statements_summary_by_user_by_event_name.row_count 16700
performance_schema events_statements_summary_by_user_by_event_name.memory 3072800
performance_schema events_statements_summary_by_host_by_event_name.row_size 184
performance_schema events_statements_summary_by_host_by_event_name.row_count 16700
performance_schema events_statements_summary_by_host_by_event_name.memory 3072800
performance_schema events_statements_current.row_size 3024
performance_schema events_statements_current.row_count 289
performance_schema events_statements_current.memory 873936
performance_schema (pfs_socket_class).row_size 320
performance_schema (pfs_socket_class).row_count 10
performance_schema (pfs_socket_class).memory 3200
performance_schema socket_instances.row_size 320
performance_schema socket_instances.row_count 232
performance_schema socket_instances.memory 74240
performance_schema events_statements_summary_by_digest.row_size 1472
performance_schema events_statements_summary_by_digest.row_count 5000
performance_schema events_statements_summary_by_digest.memory 7360000
performance_schema session_connect_attrs.row_size 289
performance_schema session_connect_attrs.row_count 512
performance_schema session_connect_attrs.memory 147968
performance_schema (account_hash).count 2
performance_schema (account_hash).size 100
performance_schema (digest_hash).count 0
performance_schema (digest_hash).size 5000
performance_schema (filename_hash).count 0
performance_schema (filename_hash).size 1754
performance_schema (host_hash).count 2
performance_schema (host_hash).size 100
performance_schema (setup_actor_hash).count 1
performance_schema (setup_actor_hash).size 100
performance_schema (setup_object_hash).count 4
performance_schema (setup_object_hash).size 100
performance_schema (table_share_hash).count 82
performance_schema (table_share_hash).size 556
performance_schema (user_hash).count 2
performance_schema (user_hash).size 100
performance_schema host_cache.size 336
performance_schema performance_schema.memory 70366560
show variables like "performance_schema%";
Variable_name Value
performance_schema OFF
performance_schema_accounts_size -1
performance_schema_digests_size -1
performance_schema_events_stages_history_long_size -1
performance_schema_events_stages_history_size -1
performance_schema_events_statements_history_long_size -1
performance_schema_events_statements_history_size -1
performance_schema_events_waits_history_long_size -1
performance_schema_events_waits_history_size -1
performance_schema_hosts_size -1
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances -1
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances -1
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances -1
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances -1
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances -1
performance_schema_max_stage_classes 150
performance_schema_max_statement_classes 167
performance_schema_max_table_handles -1
performance_schema_max_table_instances -1
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances -1
performance_schema_session_connect_attrs_size -1
performance_schema_setup_actors_size 100
performance_schema_setup_objects_size 100
performance_schema_users_size -1
show status like "performance_schema%";
Variable_name Value
Performance_schema_accounts_lost 0
Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
Performance_schema_stage_classes_lost 0
Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
DROP DATABASE IF EXISTS pfs_charset_test;
CREATE DATABASE pfs_charset_test;
USE pfs_charset_test;
SET NAMES cp1251;
TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
CREATE TABLE __1251a (s1 INT);
CREATE TABLE __1251b (s1 INT, s2 INT);
SET NAMES utf8;
CREATE TABLE ДОЛЕН_регистър_утф8 (s1 INT);
SET NAMES latin1;
SELECT * FROM performance_schema.events_statements_summary_by_digest
WHERE digest_text LIKE 'XXXYYY%' LIMIT 1;
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED FIRST_SEEN LAST_SEEN
DROP DATABASE pfs_charset_test;
--log-bin
--binlog-ignore-db=my_local_db
# Tests for PERFORMANCE_SCHEMA
--source include/have_log_bin.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
set binlog_format=mixed;
--source ../include/binlog_edge_common.inc
--log-bin
--binlog-ignore-db=my_local_db
# Tests for PERFORMANCE_SCHEMA
--source include/have_log_bin.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
set binlog_format=row;
--source ../include/binlog_edge_common.inc
--log-bin
--binlog-ignore-db=my_local_db
# Tests for PERFORMANCE_SCHEMA
--source include/have_log_bin.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
set binlog_format=statement;
--source ../include/binlog_edge_common.inc
--log-bin
--binlog-ignore-db=my_local_db
# Tests for PERFORMANCE_SCHEMA
--source include/have_log_bin.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
set binlog_format=mixed;
--source ../include/binlog_ok_common.inc
--log-bin
--binlog-ignore-db=my_local_db
# Tests for PERFORMANCE_SCHEMA
--source include/have_log_bin.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
set binlog_format=row;
--source ../include/binlog_ok_common.inc
--log-bin
--binlog-ignore-db=my_local_db
# Tests for PERFORMANCE_SCHEMA
--source include/have_log_bin.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
set binlog_format=statement;
--source ../include/binlog_ok_common.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source ../include/no_protocol.inc
-- source include/master-slave.inc
connection master;
--echo **** On Master ****
--disable_warnings
drop table if exists test.marker;
--enable_warnings
create table test.marker(a int) engine=innodb;
insert into test.marker values (1);
select * from test.marker;
truncate table performance_schema.events_waits_history_long;
truncate table performance_schema.events_statements_summary_by_digest;
update performance_schema.setup_instruments
set enabled='YES', timed='YES';
sync_slave_with_master;
--echo **** On Slave ****
truncate table performance_schema.events_waits_history_long;
truncate table performance_schema.events_statements_summary_by_digest;
update performance_schema.setup_instruments
set enabled='YES', timed='NO';
connection master;
--echo **** On Master ****
select * from performance_schema.setup_instruments
where timed='NO';
select "This better be in the master" as in_master_digest;
insert into performance_schema.setup_objects
values ('TABLE', 'master', 'foo', 'YES', 'YES');
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
select digest, digest_text, count_star
from performance_schema.events_statements_summary_by_digest
where digest_text like "%in_%_digest%";
insert into test.marker values (2);
sync_slave_with_master;
--echo **** On Slave ****
select * from test.marker;
select * from performance_schema.setup_instruments
where timed='YES';
select "This better be in the slave" as in_slave_digest;
insert into performance_schema.setup_objects
values ('TABLE', 'slave', 'foo', 'YES', 'YES');
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
select digest, digest_text, count_star
from performance_schema.events_statements_summary_by_digest
where digest_text like "%in_%_digest%";
connection master;
--echo **** On Master ****
delete from performance_schema.setup_objects
where object_schema='master';
sync_slave_with_master;
--echo **** On Slave ****
delete from performance_schema.setup_objects
where object_schema='slave';
select * from performance_schema.setup_objects;
--disable_query_log
--disable_warnings
connection master;
drop table test.marker;
sync_slave_with_master;
--enable_warnings
--enable_query_log
--source include/rpl_end.inc
!include include/default_mysqld_autosize.cnf
[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
# Automated sizing for everything
loose-performance-schema-accounts-size=-1
loose-performance-schema-digests-size=-1
loose-performance-schema-hosts-size=-1
loose-performance-schema-users-size=-1
loose-performance-schema-events-waits-history-size=-1
loose-performance-schema-events-waits-history-long-size=-1
loose-performance-schema-events-stages-history-size=-1
loose-performance-schema-events-stages-history-long-size=-1
loose-performance-schema-events-statements-history-size=-1
loose-performance-schema-events-statements-history-long-size=-1
loose-performance-schema-max-mutex-instances=-1
loose-performance-schema-max-rwlock-instances=-1
loose-performance-schema-max-cond-instances=-1
loose-performance-schema-max-file-instances=-1
loose-performance-schema-max-socket-instances=-1
loose-performance-schema-max-thread-instances=-1
loose-performance-schema-max-table-instances=-1
loose-performance-schema-max-table-handles=-1
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source include/have_64bit.inc
--source include/not_valgrind.inc
--source ../include/have_aligned_memory.inc
--source ../include/sizing_auto.inc
--force-restart
--innodb_file_per_table=1
# Tests for PERFORMANCE_SCHEMA
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Important note:
# this test is extremely sensitive to how threads are running inside the server,
# so it has it's own -master.opt file, to enforce it runs alone in mysqld
#
# Setup
flush status;
flush tables;
# Remove to debug
--disable_result_log
# Make sure the internal server caches are all full
select * from performance_schema.mutex_instances;
select * from performance_schema.rwlock_instances;
select * from performance_schema.cond_instances;
select * from performance_schema.file_instances;
select count(*) from performance_schema.mutex_instances
into @v0_mutex_instances;
select count(*) from performance_schema.rwlock_instances
into @v0_rwlock_instances;
select count(*) from performance_schema.cond_instances
into @v0_cond_instances;
select count(*) from performance_schema.file_instances
into @v0_file_instances;
select count(*) from performance_schema.mutex_instances
into @v1_mutex_instances;
select count(*) from performance_schema.rwlock_instances
into @v1_rwlock_instances;
select count(*) from performance_schema.cond_instances
into @v1_cond_instances;
select count(*) from performance_schema.file_instances
into @v1_file_instances;
select count(name), name from performance_schema.mutex_instances
group by name;
select count(name), name from performance_schema.rwlock_instances
group by name;
select count(name), name from performance_schema.cond_instances
group by name;
select count(event_name), event_name from performance_schema.file_instances
group by event_name;
begin;
create table test.t1(a int) engine = innodb;
create table test.t2(a int) engine = innodb;
create table test.t3(a int) engine = innodb;
create table test.t4(a int) engine = innodb;
create table test.t5(a int) engine = innodb;
create table test.t6(a int) engine = innodb;
create table test.t7(a int) engine = innodb;
create table test.t8(a int) engine = innodb;
create table test.t9(a int) engine = innodb;
create table test.t10(a int) engine = innodb;
# Make sure there is at least 1 table handle,
# to fully initialize the storage engine share if needed.
select * from test.t1;
select * from test.t2;
select * from test.t3;
select * from test.t4;
select * from test.t5;
select * from test.t6;
select * from test.t7;
select * from test.t8;
select * from test.t9;
select * from test.t10;
commit;
select count(*) from performance_schema.mutex_instances
into @v2_mutex_instances;
select count(*) from performance_schema.rwlock_instances
into @v2_rwlock_instances;
select count(*) from performance_schema.cond_instances
into @v2_cond_instances;
select count(*) from performance_schema.file_instances
into @v2_file_instances;
select count(name), name from performance_schema.mutex_instances
group by name;
select count(name), name from performance_schema.rwlock_instances
group by name;
select count(name), name from performance_schema.cond_instances
group by name;
select count(event_name), event_name from performance_schema.file_instances
group by event_name;
select @v2_mutex_instances, @v1_mutex_instances, @v0_mutex_instances;
select @v2_rwlock_instances, @v1_rwlock_instances, @v0_rwlock_instances;
select @v2_cond_instances, @v1_cond_instances, @v0_cond_instances;
select @v2_file_instances, @v1_file_instances, @v0_file_instances;
select round((@v2_mutex_instances - @v1_mutex_instances) / 10)
into @mutex_per_share;
select round((@v2_rwlock_instances - @v1_rwlock_instances) / 10)
into @rwlock_per_share;
select round((@v2_cond_instances - @v1_cond_instances) / 10)
into @cond_per_share;
select round((@v2_file_instances - @v1_file_instances) / 10)
into @file_per_share;
connect (con1, localhost, root,,);
select "con1 connected";
connect (con2, localhost, root,,);
select "con2 connected";
connect (con3, localhost, root,,);
select "con3 connected";
connect (con4, localhost, root,,);
select "con4 connected";
connect (con5, localhost, root,,);
select "con5 connected";
connect (con6, localhost, root,,);
select "con6 connected";
connect (con7, localhost, root,,);
select "con7 connected";
connect (con8, localhost, root,,);
select "con8 connected";
connect (con9, localhost, root,,);
select "con9 connected";
connect (con10, localhost, root,,);
select "con10 connected";
connection default;
select count(*) from performance_schema.mutex_instances
into @v3_mutex_instances;
select count(*) from performance_schema.rwlock_instances
into @v3_rwlock_instances;
select count(*) from performance_schema.cond_instances
into @v3_cond_instances;
select count(*) from performance_schema.file_instances
into @v3_file_instances;
select count(name), name from performance_schema.mutex_instances
group by name;
select count(name), name from performance_schema.rwlock_instances
group by name;
select count(name), name from performance_schema.cond_instances
group by name;
select count(event_name), event_name from performance_schema.file_instances
group by event_name;
select @v3_mutex_instances, @v2_mutex_instances;
select @v3_rwlock_instances, @v2_rwlock_instances;
select @v3_cond_instances, @v2_cond_instances;
select @v3_file_instances, @v2_file_instances;
select round((@v3_mutex_instances - @v2_mutex_instances) / 10)
into @mutex_per_con;
select round((@v3_rwlock_instances - @v2_rwlock_instances) / 10)
into @rwlock_per_con;
select round((@v3_cond_instances - @v2_cond_instances) / 10)
into @cond_per_con;
select round((@v3_file_instances - @v2_file_instances) / 10)
into @file_per_con;
--connection con1
lock table test.t1 write, test.t2 write, test.t3 write, test.t4 write,
test.t5 write, test.t6 write, test.t7 write, test.t8 write, test.t9 write,
test.t10 write;
--send
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
--connection con2
--send
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
--connection con3
--send
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
--connection con4
--send
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
--connection con5
--send
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
--connection con6
--send
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
--connection con7
--send
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
--connection con8
--send
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
--connection con9
--send
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
--connection con10
--send
select t1.*, t2.*, t3.*, t4.*, t5.*, t6.*, t7.*, t8.*, t9.*, t10.*
from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
connection default;
select count(*) from performance_schema.mutex_instances
into @v4_mutex_instances;
select count(*) from performance_schema.rwlock_instances
into @v4_rwlock_instances;
select count(*) from performance_schema.cond_instances
into @v4_cond_instances;
select count(*) from performance_schema.file_instances
into @v4_file_instances;
select count(name), name from performance_schema.mutex_instances
group by name;
select count(name), name from performance_schema.rwlock_instances
group by name;
select count(name), name from performance_schema.cond_instances
group by name;
select count(event_name), event_name from performance_schema.file_instances
group by event_name;
select @v4_mutex_instances, @v3_mutex_instances;
select @v4_rwlock_instances, @v3_rwlock_instances;
select @v4_cond_instances, @v3_cond_instances;
select @v4_file_instances, @v3_file_instances;
select round((@v4_mutex_instances - @v3_mutex_instances) / 10)
into @mutex_per_handle;
select round((@v4_rwlock_instances - @v3_rwlock_instances) / 10)
into @rwlock_per_handle;
select round((@v4_cond_instances - @v3_cond_instances) / 10)
into @cond_per_handle;
select round((@v4_file_instances - @v3_file_instances) / 10)
into @file_per_handle;
--connection con1
--reap
unlock tables;
--connection con2
--reap
--connection con3
--reap
--connection con4
--reap
--connection con5
--reap
--connection con6
--reap
--connection con7
--reap
--connection con8
--reap
--connection con9
--reap
--connection con10
--reap
--disconnect con1
--disconnect con2
--disconnect con3
--disconnect con4
--disconnect con5
--disconnect con6
--disconnect con7
--disconnect con8
--disconnect con9
--disconnect con10
--connection default
drop table test.t1;
drop table test.t2;
drop table test.t3;
drop table test.t4;
drop table test.t5;
drop table test.t6;
drop table test.t7;
drop table test.t8;
drop table test.t9;
drop table test.t10;
--enable_result_log
#
# This test must have *_lost = 0,
# otherwise the measurement is just wrong.
#
show status like "performance_schema%";
#
# Expecting 2:
# - wait/synch/mutex/sql/MDL_wait::LOCK_wait_status
# - wait/synch/mutex/sql/TABLE_SHARE::LOCK_ha_data
# plus mutexes used inside the storage engine
# This is very storage engine dependent
# For innodb:
# - wait/synch/mutex/innodb/autoinc_mutex
# - wait/synch/mutex/innodb/os_mutex
# Note that depending on the platform,
# and the version of the compiler used,
# code in the server may use either native platform atomics
# or a mutex.
# Note also that in DEBUG builds, code uses more mutexes.
# Because of all these parameters,
# this test is disabled, as predicting an exact number is difficult.
#
# commented: select @mutex_per_share <= 5;
#
# Expecting 1:
# - wait/synch/rwlock/sql/MDL_lock::rwlock
# plus rwlocks used inside the storage engine
# This is very storage engine dependent
#
select @rwlock_per_share <= 3;
#
# Expecting 0:
#
select @cond_per_share;
#
# Expecting 1:
# - wait/io/file/sql/FRM
# plus files used inside the storage engine
# This is very storage engine dependent
#
select @file_per_share <= 3;
#
# Expecting 3:
# - wait/synch/mutex/mysys/my_thread_var::mutex
# - wait/synch/mutex/mysys/THR_LOCK::mutex
# - wait/synch/mutex/sql/THD::LOCK_thd_data
#
select @mutex_per_con;
#
# Expecting 1:
# - wait/synch/rwlock/sql/MDL_context::LOCK_waiting_for
#
select @rwlock_per_con;
#
# Expecting 2:
# - wait/synch/cond/mysys/my_thread_var::suspend
# - wait/synch/cond/sql/MDL_context::COND_wait_status
#
select @cond_per_con;
#
# Expecting 0:
#
select @file_per_con;
#
# Expecting 0:
#
select @mutex_per_handle;
#
# Expecting 0:
#
select @rwlock_per_handle;
#
# Expecting 0:
#
select @cond_per_handle;
#
# Expecting 0:
#
select @file_per_handle;
#
# IMPORTANT NOTE:
# when any measurement here changes, the heuristics
# in storage/perfschema/pfs_autosize.cc need to be updated.
# Note that this in turns will lead to different estimations for automated
# sizing, and imply to update the results for sizing_*.
#
# commented: (@mutex_per_share <= 5)
# Mutexes are not instrumented by default,
# not enforcing mutex estimates
select if(
(@rwlock_per_share <= 3)
AND (@cond_per_share = 0)
AND (@file_per_share <= 3)
AND (@mutex_per_con = 3)
AND (@rwlock_per_con = 1)
AND (@cond_per_con = 2)
AND (@file_per_con = 0)
AND (@mutex_per_handle = 0)
AND (@rwlock_per_handle = 0)
AND (@cond_per_handle = 0)
AND (@file_per_handle = 0),
"OK: heuristics are up to date",
"FAILED: heuristics need to be updated")
as status;
!include include/default_mysqld_autosize.cnf
[mysqld.1]
# WARNING about open_files_limit and ulimit -n
#
# mysqld checks how many files can be opened on the machine,
# and this is by definition very:
# - os dependent, see OS_FILE_LIMIT, HAVE_GETRLIMIT
# - configuration dependent, for each machine (ulimit -n), see
# my_set_max_open_files() in mysys/my_file.c,
# see getrlimit(RLIMIT_NOFILE)
#
# Based on the this, the server tunes _down_ max_connections and
# table_cache_size to match the open_files_limit found,
# which significantly interfere with this test.
#
# Solution: use a big table definition cache,
# but small values for max_connection and table_open_cache,
# to stay within open_files_limit of 1024.
#
# This is the best test we can do that has a chance to pass on all
# platforms, while still providing code coverage.
table_definition_cache=5000
table_open_cache=400
max_connections=200
open_files_limit=1024
# 10+max_connections+table_cache_size*2 = 10 + 200 + 400*2 = 1010
# max_connections*5 = 200*5 = 1000
# Automated sizing for everything
loose-performance-schema-accounts-size=-1
loose-performance-schema-digests-size=-1
loose-performance-schema-hosts-size=-1
loose-performance-schema-users-size=-1
loose-performance-schema-events-waits-history-size=-1
loose-performance-schema-events-waits-history-long-size=-1
loose-performance-schema-events-stages-history-size=-1
loose-performance-schema-events-stages-history-long-size=-1
loose-performance-schema-events-statements-history-size=-1
loose-performance-schema-events-statements-history-long-size=-1
loose-performance-schema-max-mutex-instances=-1
loose-performance-schema-max-rwlock-instances=-1
loose-performance-schema-max-cond-instances=-1
loose-performance-schema-max-file-instances=-1
loose-performance-schema-max-socket-instances=-1
loose-performance-schema-max-thread-instances=-1
loose-performance-schema-max-table-instances=-1
loose-performance-schema-max-table-handles=-1
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source include/have_64bit.inc
--source include/not_valgrind.inc
--source ../include/have_aligned_memory.inc
--source ../include/sizing_auto.inc
!include include/default_mysqld_autosize.cnf
[mysqld.1]
table_definition_cache=400
table_open_cache=100
max_connections=50
open_files_limit=1024
# Automated sizing for everything
loose-performance-schema-accounts-size=-1
loose-performance-schema-digests-size=-1
loose-performance-schema-hosts-size=-1
loose-performance-schema-users-size=-1
loose-performance-schema-events-waits-history-size=-1
loose-performance-schema-events-waits-history-long-size=-1
loose-performance-schema-events-stages-history-size=-1
loose-performance-schema-events-stages-history-long-size=-1
loose-performance-schema-events-statements-history-size=-1
loose-performance-schema-events-statements-history-long-size=-1
loose-performance-schema-max-mutex-instances=-1
loose-performance-schema-max-rwlock-instances=-1
loose-performance-schema-max-cond-instances=-1
loose-performance-schema-max-file-instances=-1
loose-performance-schema-max-socket-instances=-1
loose-performance-schema-max-thread-instances=-1
loose-performance-schema-max-table-instances=-1
loose-performance-schema-max-table-handles=-1
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source include/have_64bit.inc
--source include/not_valgrind.inc
--source ../include/have_aligned_memory.inc
--source ../include/sizing_auto.inc
!include include/default_mysqld_autosize.cnf
[mysqld.1]
table_definition_cache=401
table_open_cache=401
max_connections=152
open_files_limit=1024
# Automated sizing for everything
loose-performance-schema-accounts-size=-1
loose-performance-schema-digests-size=-1
loose-performance-schema-hosts-size=-1
loose-performance-schema-users-size=-1
loose-performance-schema-events-waits-history-size=-1
loose-performance-schema-events-waits-history-long-size=-1
loose-performance-schema-events-stages-history-size=-1
loose-performance-schema-events-stages-history-long-size=-1
loose-performance-schema-events-statements-history-size=-1
loose-performance-schema-events-statements-history-long-size=-1
loose-performance-schema-max-mutex-instances=-1
loose-performance-schema-max-rwlock-instances=-1
loose-performance-schema-max-cond-instances=-1
loose-performance-schema-max-file-instances=-1
loose-performance-schema-max-socket-instances=-1
loose-performance-schema-max-thread-instances=-1
loose-performance-schema-max-table-instances=-1
loose-performance-schema-max-table-handles=-1
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source include/have_64bit.inc
--source include/not_valgrind.inc
--source ../include/have_aligned_memory.inc
--source ../include/sizing_auto.inc
!include include/default_mysqld_autosize.cnf
[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
# Disable the performacne schema.
# Sizing does not occur then
loose-skip-performance-schema
# Automated sizing for everything
loose-performance-schema-accounts-size=-1
loose-performance-schema-digests-size=-1
loose-performance-schema-hosts-size=-1
loose-performance-schema-users-size=-1
loose-performance-schema-events-waits-history-size=-1
loose-performance-schema-events-waits-history-long-size=-1
loose-performance-schema-events-stages-history-size=-1
loose-performance-schema-events-stages-history-long-size=-1
loose-performance-schema-events-statements-history-size=-1
loose-performance-schema-events-statements-history-long-size=-1
loose-performance-schema-max-mutex-instances=-1
loose-performance-schema-max-rwlock-instances=-1
loose-performance-schema-max-cond-instances=-1
loose-performance-schema-max-file-instances=-1
loose-performance-schema-max-socket-instances=-1
loose-performance-schema-max-thread-instances=-1
loose-performance-schema-max-table-instances=-1
loose-performance-schema-max-table-handles=-1
--source include/not_embedded.inc
--source include/have_perfschema.inc
show variables like "performance_schema%";
show status like "performance_schema%";
# Test for PERFORMANCE_SCHEMA statement digests
#
# Test statements using different character sets.
# See Bug#13809293 - PERFSCHEMA.DML_ESMS_BY_DIGEST FAILS ON DAILY-TRUNK SPORADICALLY
#
--source include/not_embedded.inc
--source include/have_perfschema.inc
--disable_warnings
DROP DATABASE IF EXISTS pfs_charset_test;
--enable_warnings
CREATE DATABASE pfs_charset_test;
USE pfs_charset_test;
#
# CP1251 - 8 bits, max multibyte length = 1
#
SET NAMES cp1251;
TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
CREATE TABLE __1251a (s1 INT);
CREATE TABLE __1251b (s1 INT, s2 INT);
#
# UTF8 - 8 bits, max multibyte length = 4
#
SET NAMES utf8;
CREATE TABLE ДОЛЕН_регистър_утф8 (s1 INT);
#
# Incorrectly converted statement identifiers will result in a warning.
#
SET NAMES latin1;
SELECT * FROM performance_schema.events_statements_summary_by_digest
WHERE digest_text LIKE 'XXXYYY%' LIMIT 1;
DROP DATABASE pfs_charset_test;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment