summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2003-03-03 14:57:02 +0100
committerunknown <guilhem@mysql.com>2003-03-03 14:57:02 +0100
commit285541505844c01546c37a46fcad92685e99cd3c (patch)
treefd83eff12d93aed16d4c3a046b54c1a9d345eb69 /sql/sql_repl.cc
parent5387425aeb951b87121765610212de621f702c5f (diff)
downloadmariadb-git-285541505844c01546c37a46fcad92685e99cd3c.tar.gz
Replication: small bug fixes in mysql-test-run.sh and in replication code (more reinitializations)
+ fix for #70 + test result fix for LOAD DATA LOCAL bug #82 client/mysqltest.c: Removed wrong comment and useless sleep mysql-test/mysql-test-run.sh: Fix $slave_datadir variable because this if [ -n "$1" ] ; slave_datadir="var/$slave_ident-data/" else slave_datadir=$SLAVE_MYDDIR was not coherent and led to problems of master.info not being deleted. Delete relay-log.info too. mysql-test/r/rpl000001.result: SUM is 1022 (1021 was when we had the LOAD DATA LOCAL bug #82). It's logical to have an even number as we load the same file twice. sql/slave.cc: When we RESET SLAVE, clear rli->master_log_* to give a good display in SHOW SLAVE STATUS ; seeing the old values may confuse the user. When we START SLAVE, clear rli->master_log_name, not only rli->master_log_pos. sql/sql_repl.cc: When we RESET SLAVE, clear mi->master_log_* to give a good display in SHOW SLAVE STATUS (bug #70)
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 6a14a7c5d16..5e90bbf1b0f 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -734,12 +734,18 @@ int reset_slave(THD *thd, MASTER_INFO* mi)
error=1;
goto err;
}
+ //delete relay logs, clear relay log coordinates
if ((error= purge_relay_logs(&mi->rli, thd,
1 /* just reset */,
&errmsg)))
goto err;
+ //Clear master's log coordinates (only for good display of SHOW SLAVE STATUS)
+ mi->master_log_name[0]= 0;
+ mi->master_log_pos= BIN_LOG_HEADER_SIZE;
+ //close master_info_file, relay_log_info_file, set mi->inited=rli->inited=0
end_master_info(mi);
+ //and delete these two files
fn_format(fname, master_info_file, mysql_data_home, "", 4+32);
if (my_stat(fname, &stat_area, MYF(0)) && my_delete(fname, MYF(MY_WME)))
{