From: Date: January 22 2009 3:55pm Subject: bzr commit into mysql-5.1-bugteam branch (aelkin:2749) Bug#31240 List-Archive: http://lists.mysql.com/commits/63815 X-Bug: 31240 Message-Id: <200901221455.n0MEtMam007630@mysql1000.dsl.inet.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT #At file:///home/andrei/MySQL/BZR/FIXES/bug31240-ldi_41_2_51/ based on revid:staale.smedseng@stripped 2749 Andrei Elkin 2009-01-22 Bug #31240 load data infile replication between (4.0 or 4.1) and 5.1 fails It's a regression issue. The reason of the bug appeared to be an error introduced into 5.1 source code. A piece of code in Create_file_log_event::do_apply_event() did not have test coverage which made make test and pb unaware. Fixed with inverting the old value of the return value from Create_file_log_event::do_apply_event(). The rpl test suite is extended with `rpl_cross_version' the file to hold regression cases similar to the current. added: mysql-test/suite/rpl/r/rpl_cross_version.result mysql-test/suite/rpl/t/rpl_cross_version-master.opt mysql-test/suite/rpl/t/rpl_cross_version.test modified: sql/log_event.cc per-file messages: mysql-test/suite/rpl/r/rpl_cross_version.result new results file mysql-test/suite/rpl/t/rpl_cross_version-master.opt options to the server to be able to start replication to itself mysql-test/suite/rpl/t/rpl_cross_version.test regression test for bug#31240. sql/log_event.cc Correcting the return value from Create_file_log_event::do_apply_event() === added file 'mysql-test/suite/rpl/r/rpl_cross_version.result' --- a/mysql-test/suite/rpl/r/rpl_cross_version.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/rpl/r/rpl_cross_version.result 2009-01-22 14:55:14 +0000 @@ -0,0 +1,12 @@ +==== Initialize ==== +Setting up fake replication from MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001 +==== Test ==== +start slave sql_thread; +==== a prove that the /home/andrei/MySQL/BZR/FIXES/bug31240-ldi_41_2_51/mysql-test/suite/binlog/std_data/binlog_old_version_4_1.000001 has been processed successfully ==== +SELECT COUNT(*) - 17920 as zero FROM t3; +zero +0 +==== Clean up ==== +stop slave sql_thread; +Cleaning up after setup_fake_relay_log.inc +drop table t1, t3; === added file 'mysql-test/suite/rpl/t/rpl_cross_version-master.opt' --- a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt 2009-01-22 14:55:14 +0000 @@ -0,0 +1 @@ +--replicate-same-server-id --relay-log=slave-relay-bin === added file 'mysql-test/suite/rpl/t/rpl_cross_version.test' --- a/mysql-test/suite/rpl/t/rpl_cross_version.test 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/rpl/t/rpl_cross_version.test 2009-01-22 14:55:14 +0000 @@ -0,0 +1,36 @@ +# ==== Purpose ==== +# +# Verify cross-version replication from an old master to the up-to-date slave +# +# ==== Implementation ==== +# +# Feed to the slave server a binlog recorded on an old version master +# via setting up slave-to-slave replication. The latter is done by means of +# the opt file and include/setup_fake_relay_log.inc. +# The master's binlog is treated as a relay log that the SQL thread executes. +# + +--source include/have_log_bin.inc + +# +# Bug#31240 load data infile replication between (4.0 or 4.1) and 5.1 fails +# + +--echo ==== Initialize ==== +# the relay log contains create t1, t3 tables and load data infile +--let $fake_relay_log = $MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001 +--source include/setup_fake_relay_log.inc + +--echo ==== Test ==== +start slave sql_thread; +--let $slave_param = Exec_Master_Log_Pos +# end_log_pos of the last event of the relay log +--let $slave_param_value = 149436 +--source include/wait_for_slave_param.inc +--echo ==== a prove that the $fake_relay_log has been processed successfully ==== +SELECT COUNT(*) - 17920 as zero FROM t3; + +--echo ==== Clean up ==== +stop slave sql_thread; +--source include/cleanup_fake_relay_log.inc +drop table t1, t3; === modified file 'sql/log_event.cc' --- a/sql/log_event.cc 2009-01-14 09:32:25 +0000 +++ b/sql/log_event.cc 2009-01-22 14:55:14 +0000 @@ -5945,8 +5945,15 @@ void Create_file_log_event::pack_info(Pr #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ -/* +/** Create_file_log_event::do_apply_event() + Constructor for Create_file_log_event to intantiate an event + from the relay log on the slave. + + @retval + 0 Success + @retval + 1 Failure */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) @@ -6015,7 +6022,7 @@ err: if (fd >= 0) my_close(fd, MYF(0)); thd_proc_info(thd, 0); - return error == 0; + return error != 0; } #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */