summaryrefslogtreecommitdiff
path: root/mysql-test/t/mysqlbinlog.test
diff options
context:
space:
mode:
authorSven Sandberg <sven.sandberg@oracle.com>2011-03-25 15:16:13 +0100
committerSven Sandberg <sven.sandberg@oracle.com>2011-03-25 15:16:13 +0100
commitf1b638d33cdf95b70fa925cce304864c96fdf7ee (patch)
tree2b5fa95c1dfd66757d984c5d237e2ff8432bd415 /mysql-test/t/mysqlbinlog.test
parent5af973582dcec824411f2d43bf41d38d8298abf3 (diff)
downloadmariadb-git-f1b638d33cdf95b70fa925cce304864c96fdf7ee.tar.gz
BUG#11766427, BUG#59539: Filter by server id in mysqlbinlog fails
Problem: mysqlbinlog --server-id may filter out Format_description_log_events. If mysqlbinlog does not process the Format_description_log_event, then mysqlbinlog cannot read the rest of the binary log correctly. This can have the effect that mysqlbinlog crashes, generates an error, or generates output that causes mysqld to crash, generate an error, or corrupt data. Fix: Never filter out Format_description_log_events. Also, never filter out Rotate_log_events. client/mysqlbinlog.cc: Process Format_description_log_events even when the server_id does not match the number given by --server-id. mysql-test/t/mysqlbinlog.test: Add test case.
Diffstat (limited to 'mysql-test/t/mysqlbinlog.test')
-rw-r--r--mysql-test/t/mysqlbinlog.test20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index d5dd3052269..98ee18b554e 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -501,3 +501,23 @@ exec $MYSQL_BINLOG $MYSQLD_DATADIR/$master_binlog | $MYSQL test 2>&1;
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
source include/show_binlog_events.inc;
+#
+# BUG#11766427 BUG#59530: Filter by server id in mysqlbinlog fails
+# This test checks that the format description log event is not
+# filtered out by the --server-id option.
+#
+RESET MASTER;
+USE test;
+CREATE TABLE t1 (a INT);
+--let $old_server_id= `SELECT @@GLOBAL.SERVER_ID`
+SET GLOBAL SERVER_ID = 2;
+DROP TABLE t1;
+--let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+FLUSH LOGS;
+# The following should only create t1, not drop it.
+--exec $MYSQL_BINLOG --server-id=1 $MYSQLD_DATADIR/$master_binlog | $MYSQL
+SHOW TABLES IN test;
+# The following should only drop t1, not create it.
+--exec $MYSQL_BINLOG --server-id=2 $MYSQLD_DATADIR/$master_binlog | $MYSQL
+SHOW TABLES IN test;
+eval SET GLOBAL SERVER_ID = $old_server_id;