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 ('%', '%', '%');
This diff is collapsed.
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
This diff is collapsed.
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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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
This diff is collapsed.
!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