1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

fixed improper read of log name from master.info which broke slave server restart

fixed sync bugs in three test cases
added offset argument to sync_with_master to mysqltest to be able to fix sync bugs
added a test case for slave startup with existing master.info
expanded mysql-test-run.sh to be able to run pre-start shell script initializations


client/mysqltest.c:
  added offset argument to sync_with_master
mysql-test/mysql-test-run.sh:
  added option to run master or slave initialization shell script
mysql-test/r/rpl000016.result:
  fixed bug in test case
mysql-test/t/rpl000012.test:
  fixed syncronization bug
mysql-test/t/rpl000013.test:
  fixed sync bug
mysql-test/t/rpl000016.test:
  fixed ambiguous show slave status.
sql/slave.cc:
  fixed bug that broke slave server start with existing master.info,
  Monty's optimization was not chopping off newline from logname.
This commit is contained in:
unknown
2001-01-24 12:47:09 -07:00
parent 0ee9e34a72
commit b302ee39bc
11 changed files with 83 additions and 16 deletions

View File

@ -72,6 +72,7 @@ cd ..
BASEDIR=`pwd`
cd $CWD
MYSQL_TEST_DIR=$BASEDIR/mysql-test
export MYSQL_TEST_DIR
STD_DATA=$MYSQL_TEST_DIR/std_data
hostname=`hostname` # Installed in the mysql privilege table
@ -336,6 +337,11 @@ gcov_collect () {
start_master()
{
[ x$MASTER_RUNNING = 1 ] && return
#run master initialization shell script if one exists
if [ -f "$master_init_script" ] ;
then
/bin/sh $master_init_script
fi
cd $BASEDIR # for gcov
# Remove old berkeley db log files that can confuse the server
$RM -f $MASTER_MYDDIR/log.*
@ -375,6 +381,13 @@ start_slave()
{
[ x$SKIP_SLAVE = x1 ] && return
[ x$SLAVE_RUNNING = 1 ] && return
#run slave initialization shell script if one exists
if [ -f "$slave_init_script" ] ;
then
/bin/sh $slave_init_script
fi
if [ -z "$SLAVE_MASTER_INFO" ] ; then
master_info="--master-user=root \
--master-connect-retry=1 \
@ -502,6 +515,8 @@ run_testcase ()
tname=`$BASENAME $tf .test`
master_opt_file=$TESTDIR/$tname-master.opt
slave_opt_file=$TESTDIR/$tname-slave.opt
master_init_script=$TESTDIR/$tname-master.sh
slave_init_script=$TESTDIR/$tname-slave.sh
slave_master_info_file=$TESTDIR/$tname-slave-master-info.opt
SKIP_SLAVE=`$EXPR \( $tname : rpl \) = 0`