From 081a3726dd5e44f97abd0018cdb076f82adc9b61 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 20 Jan 2010 18:39:29 +0000 Subject: [PATCH] BUG#50473: rpl_sync fails on windows debug enabled binaries The test case was failing because it contained instructions to close/reopen files, when they were in use. This raises problems in windows. Example of such instruction: ---exec echo "failure" > $MYSQLD_SLAVE_DATADIR/$file The test also contains commands that are not platform agnostic. Example: --exec cat $MYSQLD_SLAVE_DATADIR/master.backup > \ $MYSQLD_SLAVE_DATADIR/master.info We fix this by just truncating the necessary file and write "failure" into it (ie, without closing the file). The platform specific instruction is removed from the test case as it seems redundant. --- mysql-test/suite/rpl/t/rpl_sync.test | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/rpl/t/rpl_sync.test b/mysql-test/suite/rpl/t/rpl_sync.test index 80b6a144187..48c8dc02efb 100644 --- a/mysql-test/suite/rpl/t/rpl_sync.test +++ b/mysql-test/suite/rpl/t/rpl_sync.test @@ -64,8 +64,15 @@ stop slave IO_THREAD; source include/wait_for_slave_io_to_stop.inc; let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1); ---replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR ---exec echo "failure" > $MYSQLD_SLAVE_DATADIR/$file + +--let FILE_TO_CORRUPT= $MYSQLD_SLAVE_DATADIR/$file +perl; +$file= $ENV{'FILE_TO_CORRUPT'}; +open(FILE, ">$file") || die "Unable to open $file."; +truncate(FILE,0); +print FILE "failure"; +close ($file); +EOF --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect SET SESSION debug="d,crash_before_rotate_relaylog"; @@ -102,9 +109,6 @@ insert into t1(a) values(8); insert into t1(a) values(9); connection slave; ---replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR ---exec cat $MYSQLD_SLAVE_DATADIR/master.backup > $MYSQLD_SLAVE_DATADIR/master.info - let MYSQLD_SLAVE_DATADIR=`select @@datadir`; --perl