Commit 05943ddd authored by unknown's avatar unknown

Fix for perfschema.binlog_stmt failure:

        
Problem: The test case failed because: (i) warning text in 
         result file differed from the warning output by the 
         server, and (ii) binlog contents in result file did
         not show the statements logged wrapped in BEGIN/COMMIT
         as it is the case after WL 2687.
      
Solution: We update the result file, but first we change the
          unsafe warning text to also refer to performance_schema
          table(s). This required changing the result files for
          existing test cases that provide output for warnings 
          related to ER_BINLOG_UNSAFE_SYSTEM_TABLE. "Grepping" in
          result files, shows that only binlog_unsafe contained
          reference to such a warning.
      
          We also update the result file with the missing 
          BEGIN/COMMIT statements.
parent a5d956b0
set binlog_format=statement;
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
RESET MASTER;
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
......@@ -6,7 +7,7 @@ count(*) > 0
update performance_schema.SETUP_INSTRUMENTS set enabled='NO'
where name like "wait/synch/rwlock/%";
Warnings:
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave.
select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT;
count(*) > 0
1
......@@ -17,32 +18,40 @@ create table test.t2 (name varchar(128));
insert into test.t1
select thread_id from performance_schema.EVENTS_WAITS_CURRENT;
Warnings:
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave.
insert into test.t2
select name from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/rwlock/%";
Warnings:
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave.
drop table test.t1;
drop table test.t2;
update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
where name like "wait/synch/rwlock/%";
Warnings:
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave.
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; update performance_schema.SETUP_INSTRUMENTS set enabled='NO'
where name like "wait/synch/rwlock/%"
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; drop table if exists test.t1
master-bin.000001 # Query # # use `test`; drop table if exists test.t2
master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer)
master-bin.000001 # Query # # use `test`; create table test.t2 (name varchar(128))
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; insert into test.t1
select thread_id from performance_schema.EVENTS_WAITS_CURRENT
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; insert into test.t2
select name from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/rwlock/%"
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; drop table test.t1
master-bin.000001 # Query # # use `test`; drop table test.t2
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
where name like "wait/synch/rwlock/%"
master-bin.000001 # Query # # COMMIT
......@@ -20,6 +20,7 @@
--source include/have_perfschema.inc
set binlog_format=statement;
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
--source ../include/binlog_common.inc
......@@ -6279,7 +6279,7 @@ ER_BINLOG_UNSAFE_LIMIT
ER_BINLOG_UNSAFE_INSERT_DELAYED
eng "Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted."
ER_BINLOG_UNSAFE_SYSTEM_TABLE
eng "Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave."
eng "Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave."
ER_BINLOG_UNSAFE_TWO_AUTOINC_COLUMNS
eng "Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave."
ER_BINLOG_UNSAFE_UDF
......
......@@ -6220,7 +6220,7 @@ ER_BINLOG_UNSAFE_LIMIT
ER_BINLOG_UNSAFE_INSERT_DELAYED
eng "Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted."
ER_BINLOG_UNSAFE_SYSTEM_TABLE
eng "Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave."
eng "Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave."
ER_BINLOG_UNSAFE_TWO_AUTOINC_COLUMNS
eng "Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave."
ER_BINLOG_UNSAFE_UDF
......
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