summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/r/rpl_checksum.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/rpl/r/rpl_checksum.result')
-rw-r--r--mysql-test/suite/rpl/r/rpl_checksum.result126
1 files changed, 126 insertions, 0 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result
new file mode 100644
index 00000000000..c28a863f024
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_checksum.result
@@ -0,0 +1,126 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log');
+call mtr.add_suppression('Replication event checksum verification failed');
+call mtr.add_suppression('Relay log write failure: could not queue event from master');
+call mtr.add_suppression('Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them');
+set @master_save_binlog_checksum= @@global.binlog_checksum;
+set @save_master_verify_checksum = @@global.master_verify_checksum;
+select @@global.binlog_checksum as 'must be CRC32 because of the command line option';
+must be CRC32 because of the command line option
+CRC32
+select @@session.binlog_checksum as 'no session var';
+ERROR HY000: Variable 'binlog_checksum' is a GLOBAL variable
+select @@global.master_verify_checksum as 'must be zero because of default';
+must be zero because of default
+0
+select @@session.master_verify_checksum as 'no session var';
+ERROR HY000: Variable 'master_verify_checksum' is a GLOBAL variable
+set @slave_save_binlog_checksum= @@global.binlog_checksum;
+set @save_slave_sql_verify_checksum = @@global.slave_sql_verify_checksum;
+select @@global.slave_sql_verify_checksum as 'must be one because of default';
+must be one because of default
+1
+select @@session.slave_sql_verify_checksum as 'no session var';
+ERROR HY000: Variable 'slave_sql_verify_checksum' is a GLOBAL variable
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+set @@global.binlog_checksum = NONE;
+*** must be rotations seen ***
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+set @@global.binlog_checksum = default;
+set @@global.binlog_checksum = CRC32;
+set @@global.binlog_checksum = CRC32;
+set @@global.master_verify_checksum = 0;
+set @@global.master_verify_checksum = default;
+set @@global.binlog_checksum = ADLER32;
+ERROR 42000: Variable 'checksum' can't be set to the value of 'ADLER32'
+set @@global.master_verify_checksum = 2;
+ERROR 42000: Variable 'master_verify_checksum' can't be set to the value of '2'
+set @@global.slave_sql_verify_checksum = 0;
+set @@global.slave_sql_verify_checksum = default;
+set @@global.slave_sql_verify_checksum = 2;
+ERROR 42000: Variable 'slave_sql_verify_checksum' can't be set to the value of '2'
+set @@global.binlog_checksum = NONE;
+create table t1 (a int);
+flush logs;
+flush logs;
+flush logs;
+flush logs;
+flush logs;
+flush logs;
+select count(*) as zero from t1;
+zero
+0
+include/stop_slave.inc
+set @@global.binlog_checksum = CRC32;
+insert into t1 values (1) /* will not be applied on slave due to simulation */;
+set @@global.debug='d,simulate_slave_unaware_checksum';
+start slave;
+include/wait_for_slave_io_to_stop.inc
+*** Got IO thread error code: 1236, text: Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log' ***
+select count(*) as zero from t1;
+zero
+0
+set @@global.debug='';
+include/start_slave.inc
+set @@global.master_verify_checksum = 1;
+set @@session.debug='d,simulate_checksum_test_failure';
+show binlog events;
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
+set @@session.debug='';
+set @@global.master_verify_checksum = default;
+include/stop_slave.inc
+create table t2 (a int);
+set @@global.debug='d,simulate_checksum_test_failure';
+start slave io_thread;
+include/wait_for_slave_io_to_stop.inc
+*** Got IO thread error code: 1595, text: Relay log write failure: could not queue event from master ***
+set @@global.debug='';
+start slave io_thread;
+include/wait_for_slave_param.inc [Read_Master_Log_Pos]
+set @@global.slave_sql_verify_checksum = 1;
+set @@global.debug='d,simulate_checksum_test_failure';
+start slave sql_thread;
+include/wait_for_slave_sql_to_stop.inc
+*** Got SQL thread error code: 1593, text: Error initializing relay log position: I/O error reading event at position 4 ***
+set @@global.debug='';
+include/start_slave.inc
+select count(*) as 'must be zero' from t2;
+must be zero
+0
+stop slave;
+reset slave;
+set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
+flush logs;
+set @@global.binlog_checksum= CRC32;
+reset master;
+flush logs;
+create table t3 (a int, b char(5));
+include/start_slave.inc
+select count(*) as 'must be zero' from t3;
+must be zero
+0
+include/stop_slave.inc
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
+flush logs;
+reset master;
+insert into t3 value (1, @@global.binlog_checksum);
+include/start_slave.inc
+flush logs;
+select count(*) as 'must be one' from t3;
+must be one
+1
+set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
+insert into t3 value (1, @@global.binlog_checksum);
+drop table t1, t2, t3;
+set @@global.binlog_checksum = @master_save_binlog_checksum;
+set @@global.master_verify_checksum = @save_master_verify_checksum;
+set @@global.binlog_checksum = @slave_save_binlog_checksum;
+set @@global.slave_sql_verify_checksum = @save_slave_sql_verify_checksum;
+End of tests
+include/rpl_end.inc