summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2000-12-14 20:17:18 -0700
committerunknown <sasha@mysql.sashanet.com>2000-12-14 20:17:18 -0700
commit6aac994eb02eace8e14e5d9911af977c99521737 (patch)
tree6ce66573de32684888564f6510cde5213520f2f3 /sql/sql_repl.cc
parent230acc45197b7b7eda5dcf33dbad7ed879116e59 (diff)
downloadmariadb-git-6aac994eb02eace8e14e5d9911af977c99521737.tar.gz
client/mysqltest.c
fixed bug that created empty result files in no-record mode mysql-test/t/rpl000007.test testing non-replication of load data infile when the table is excluded from replication mysql-test/t/rpl000016.test test purge master logs sql/slave.cc fix memory leaks found by purge master logs test sql/sql_repl.cc fixed race condition and delete before close bug in reset_slave() Overall comments - coverage testing is a very good thing! client/mysqltest.c: fixed bug that created empty result files in no-record mode mysql-test/t/rpl000007.test: testing non-replication of load data infile when the table is excluded from replication mysql-test/t/rpl000016.test: test purge master logs sql/slave.cc: fix memory leaks found by purge master logs test sql/sql_repl.cc: fixed race condition and delete before close bug in reset_slave()
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index e27a77422ad..0aaaf027ea3 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -577,16 +577,22 @@ void reset_slave()
{
MY_STAT stat_area;
char fname[FN_REFLEN];
- bool slave_was_running = slave_running;
-
- if(slave_running)
- stop_slave(0,0);
+ bool slave_was_running ;
+ pthread_mutex_lock(&LOCK_slave);
+ if((slave_was_running = slave_running))
+ {
+ pthread_mutex_unlock(&LOCK_slave);
+ stop_slave(0,0);
+ }
+ else
+ pthread_mutex_unlock(&LOCK_slave);
+
+ end_master_info(&glob_mi);
fn_format(fname, master_info_file, mysql_data_home, "", 4+16+32);
if(my_stat(fname, &stat_area, MYF(0)))
if(my_delete(fname, MYF(MY_WME)))
return;
- end_master_info(&glob_mi);
if(slave_was_running)
start_slave(0,0);
}