diff options
author | Sachin Setiya <sachin.setiya@mariadb.com> | 2019-09-26 15:05:55 +0530 |
---|---|---|
committer | Sachin Setiya <sachin.setiya@mariadb.com> | 2019-10-01 15:04:08 +0530 |
commit | b3b99239be4957c2494911fe6dd6e9f5f83854b7 (patch) | |
tree | b9b4ca19110ee8ebb7b8fd28e0ed7fbe06034fc0 /mysql-test/suite/binlog_encryption/mysqlbinlog.test | |
parent | 7e44c455f4de82081af5089e1f77378676aa45ff (diff) | |
download | mariadb-git-bb-10.3-20574.tar.gz |
MDEV-20574 Position of events reported by mysqlbinlog is wrong with encrypted binlogs, SHOW BINLOG EVENTS reports the correct one.bb-10.3-20574
Analysis
Mysqlbinlog output for encrypted binary log
#Q> insert into tab1 values (3,'row 003')
#190912 17:36:35 server id 10221 end_log_pos 980 CRC32 0x53bcb3d3 Table_map: `test`.`tab1` mapped to number 19
# at 940
#190912 17:36:35 server id 10221 end_log_pos 1026 CRC32 0xf2ae5136 Write_rows: table id 19 flags: STMT_END_F
Here we can see Table_map_log_event ends at 980 but Next event starts at 940.
And the reason for that is we do not send START_ENCRYPTION_EVENT to the slave
Solution:-
Send Start_encryption_log_event as Ignorable_log_event to slave(mysqlbinlog),
So that mysqlbinlog can update its log_pos.
Since Slave can request multiple FORMAT_DESCRIPTION_EVENT while master does not
have so We only update slave master pos when master actually have the
FORMAT_DESCRIPTION_EVENT. Similar logic should be applied for START_ENCRYPTION_EVENT.
Also added the test case when new server reads the data from old server which
does not send START_ENCRYPTION_EVENT to slave.
Diffstat (limited to 'mysql-test/suite/binlog_encryption/mysqlbinlog.test')
-rw-r--r-- | mysql-test/suite/binlog_encryption/mysqlbinlog.test | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mysql-test/suite/binlog_encryption/mysqlbinlog.test b/mysql-test/suite/binlog_encryption/mysqlbinlog.test index b80388aaa45..108dbd8782f 100644 --- a/mysql-test/suite/binlog_encryption/mysqlbinlog.test +++ b/mysql-test/suite/binlog_encryption/mysqlbinlog.test @@ -17,5 +17,8 @@ let outfile=$MYSQLTEST_VARDIR/tmp/binlog_enc.sql; exec $MYSQL_BINLOG $local > $outfile; exec $MYSQL_BINLOG $local --force-read >> $outfile; exec $MYSQL_BINLOG $remote >> $outfile; +--let SEARCH_FILE= $outfile +--let SEARCH_PATTERN= Ignorable event type 164.* +--source include/search_pattern_in_file.inc remove_file $outfile; |