Bug #45407 Performance Schema: replication fails
Submitted: 9 Jun 2009 16:12 Modified: 5 Aug 2009 14:54
Reporter: Peter Gulutzan Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:mysql-6.0-perfschema OS:Linux (SUSE 10 / 64-bit)
Assigned to: Marc Alff CPU Architecture:Any

[9 Jun 2009 16:12] Peter Gulutzan
Description:
I'm using mysql-6.0-perfschema.
I start the server with mysqld --performance_schema=1 --log-bin=x5
I set binlog_format = MIXED.
I say INSERT ... SELECT FROM (performance_schema table).

(Selections from performance_schema tables are non-deterministic.
If I try this sort of thing with binlog_format = STATEMENT, I
correctly get the warning "1592 Statement is not safe to log in
statement format". But if I try this sort of thing with
binlog_format = MIXED, I expect MySQL to try to compensate
for my careless behaviour.)

I use mysqlbinlog to read the binlog.
I see this in the binlog output:
"ERROR: Error in Log_event::read_log_event():
'Found invalid event in binary log', data_len: 38, event_type: 23"

How to repeat:
Use mysql-6.0-perfschema.
Start the server thus (your mysqld location may vary):
libexec/mysqld --user=root --performance_schema=1 --log-bin=x5

Start the client. Say:
drop table if exists test.t;
create table test.t (timer_wait bigint);
set binlog_format='MIXED';
insert into test.t select timer_wait from performance_schema.EVENTS_WAITS_CURRENT;
quit

Look at the binlog thus (your datadir may vary):
su root
mysqlbinlog /data1/mysql-6.0-perfschema/var/x5.000001

The last lines of the result display will look like this:
"
SET @@session.sql_mode=0;
/*!\C latin1 */;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
drop table if exists test.t;
# at 193
#969 10:3:38 server id 1  end_log_pos 291       Query   thread_id=1     exec_time=0     error_code=0
SET TIMESTAMP=1244563418;
create table test.t (timer_wait bigint);
# at 291
#969 10:3:38 server id 1  end_log_pos 355       Query   thread_id=1     exec_time=0     error_code=0
SET TIMESTAMP=1244563418;
BEGIN;
# at 355
ERROR: Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 56, event_type: 23
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
"
[5 Aug 2009 14:54] Peter Gulutzan
Today I tried this again after pulling the latest mysql-azalea-perfschema.
Now it works, I do not see the error.