1# ==== Purpose ==== 2# 3# Verify cross-version replication from an old master to the up-to-date slave 4# 5# ==== Implementation ==== 6# 7# Feed to the slave server a binlog recorded on an old version master 8# via setting up slave-to-slave replication. The latter is done by means of 9# the opt file and include/setup_fake_relay_log.inc. 10# The master's binlog is treated as a relay log that the SQL thread executes. 11# 12 13--source include/master-slave.inc 14 15# 16# Bug#31240 load data infile replication between (4.0 or 4.1) and 5.1 fails 17# 18 19--echo ==== Initialize ==== 20--connection slave 21 22--disable_query_log 23# The binlog contains the function RAND which is unsafe. 24CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); 25--enable_query_log 26 27--source include/stop_slave.inc 28RESET SLAVE; 29 30# the relay log contains create t1, t3 tables and load data infile 31--let $fake_relay_log = $MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001 32--source include/setup_fake_relay_log.inc 33 34--echo ==== Test ==== 35start slave sql_thread; 36--let $slave_param = Exec_Master_Log_Pos 37# end_log_pos of the last event of the relay log 38--let $slave_param_value = 149436 39--source include/wait_for_slave_param.inc 40--echo ==== a prove that the fake has been processed successfully ==== 41SELECT COUNT(*) - 17920 as zero FROM t3; 42 43--echo ==== Clean up ==== 44--source include/stop_slave_sql.inc 45--source include/cleanup_fake_relay_log.inc 46drop table t1, t3; 47--let $rpl_only_running_threads= 1 48--source include/rpl_end.inc 49