Skip to content

Commit 27828ba

Browse files
author
Luis Soares
committed
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.
1 parent 9c820e6 commit 27828ba

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

mysql-test/suite/rpl/t/rpl_sync.test

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,15 @@ stop slave IO_THREAD;
6464
source include/wait_for_slave_io_to_stop.inc;
6565

6666
let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1);
67-
--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
68-
--exec echo "failure" > $MYSQLD_SLAVE_DATADIR/$file
67+
68+
--let FILE_TO_CORRUPT= $MYSQLD_SLAVE_DATADIR/$file
69+
perl;
70+
$file= $ENV{'FILE_TO_CORRUPT'};
71+
open(FILE, ">$file") || die "Unable to open $file.";
72+
truncate(FILE,0);
73+
print FILE "failure";
74+
close ($file);
75+
EOF
6976

7077
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
7178
SET SESSION debug="d,crash_before_rotate_relaylog";
@@ -102,9 +109,6 @@ insert into t1(a) values(8);
102109
insert into t1(a) values(9);
103110

104111
connection slave;
105-
--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
106-
--exec cat $MYSQLD_SLAVE_DATADIR/master.backup > $MYSQLD_SLAVE_DATADIR/master.info
107-
108112
let MYSQLD_SLAVE_DATADIR=`select @@datadir`;
109113

110114
--perl

0 commit comments

Comments
 (0)