diff options
author | unknown <sanja@montyprogram.com> | 2013-09-12 21:36:58 +0300 |
---|---|---|
committer | unknown <sanja@montyprogram.com> | 2013-09-12 21:36:58 +0300 |
commit | 7a80c534ad0eb7d71e67999e27d1759d6a8fbf95 (patch) | |
tree | b99b7631d8ff53371c9d9d0852bf6732ba655a5d /mysql-test/t/mysqlbinlog.test | |
parent | ada15c7a0f7947073664451c3804ab03723c657e (diff) | |
download | mariadb-git-7a80c534ad0eb7d71e67999e27d1759d6a8fbf95.tar.gz |
MDEV-4645: Incorrect reads of frozen binlog events; FDE corrupted in relay log
Currently several places use description_event->common_header_len instead of
LOG_EVENT_MINIMAL_HEADER_LEN when parsing events with "frozen" headers (such
as Start_event_v3 and its subclasses such as Format_description_log_event, as
well as Rotate_event). This causes events with extra headers (which would otherwise
be valid and those headers ignored) to be corrupted due to over-reading or skipping
into the data portion of the log events.
It is rewritten in some details patch of Jeremy Cole (See MDEV):
- The virtual function returns length to avoid IFs (and only one call of the virtual function made)
- Printing function avoids printing strings
Diffstat (limited to 'mysql-test/t/mysqlbinlog.test')
-rw-r--r-- | mysql-test/t/mysqlbinlog.test | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 96b18be8c37..d492af92cb2 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -275,17 +275,16 @@ FLUSH LOGS; DROP TABLE t1; -# We create a table, patch, and load the output into it -# By using LINES STARTING BY '#' + SELECT WHERE a LIKE 'Query' -# We can easily see if a 'Query' line is missing the '#' character -# as described in the original bug +# We create a table named "patch", and load the output into it. +# By using LIKE, we can easily see if the output is missing the '#' +# character, as described in the bug. --disable_query_log CREATE TABLE patch (a BLOB); --exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000012 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_tmp.dat ### Starting master-bin.000014 eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_tmp.dat' - INTO TABLE patch FIELDS TERMINATED BY '' LINES STARTING BY '#'; + INTO TABLE patch FIELDS TERMINATED BY ''; --remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_tmp.dat --enable_query_log @@ -293,7 +292,7 @@ eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_tmp.dat' --echo The bug being tested was that 'Query' lines were not preceded by '#' --echo If the line is in the table, it had to have been preceded by a '#' --echo -SELECT COUNT(*) AS `BUG#28293_expect_2` FROM patch WHERE a LIKE '%Query%'; +SELECT COUNT(*) AS `BUG#28293_expect_2` FROM patch WHERE a LIKE '#%Query%'; DROP TABLE patch; # @@ -594,3 +593,12 @@ SHOW TABLES IN test; --exec $MYSQL_BINLOG --server-id=2 $MYSQLD_DATADIR/$master_binlog | $MYSQL SHOW TABLES IN test; eval SET GLOBAL SERVER_ID = $old_server_id; + +--echo # +--echo # MDEV-4645: Incorrect reads of frozen binlog events; +--echo # FDE corrupted in relay log +--echo # +--exec $MYSQL_BINLOG --hexdump std_data/mdev-4645-binlog_checksum.binlog +--exec $MYSQL_BINLOG --hexdump std_data/mdev-4645-binlog_group_id.binlog +--exec $MYSQL_BINLOG --hexdump std_data/mdev-4645-binlog_group_id_checksum.binlog +--exec $MYSQL_BINLOG --hexdump std_data/mdev-4645-binlog_none.binlog |