summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2002-03-15 18:44:44 -0700
committerunknown <sasha@mysql.sashanet.com>2002-03-15 18:44:44 -0700
commit9c435716a9773f78cd5db0a992bd4b89b83bc25a (patch)
treefd01da1dc4d0055ee7386fa88268c65589a33c64 /sql/slave.cc
parentb8a9ea66ba2663d10e2ef2ed138fa1576b15320e (diff)
downloadmariadb-git-9c435716a9773f78cd5db0a992bd4b89b83bc25a.tar.gz
replication updates and bugfixes. Still not perfect - there is some strange
memory corruption I can only repeat on one system. mysql-test/r/multi_update.result: extended test trying to find why the old one was failing mysql-test/r/rpl000015.result: result update mysql-test/t/multi_update.test: updated test to do more intermediate result checks mysql-test/t/rpl000014.test: cosmetic change mysql-test/t/rpl000015-slave-master-info.opt: reduce connect retry trying to simulate a bug mysql-test/t/rpl000015.test: cosmetic change sql/lex.h: added RELAY_LOG_FILE and RELAY_LOG_POS to CHANGE MASTER TO sql/log.cc: fixed replication bug sql/log_event.cc: properly ignore replication errors according to error mask sql/mysqld.cc: handle SIGFPE in the coredump handler sql/slave.cc: do not kick slave if it has already exited and freed the structures sql/sql_lex.cc: fixed initialization bug in CHANGE MASTER TO sql/sql_lex.h: CHANGE MASTER TO .. RELAY_LOG_FILE=,RELAY_LOG_POS= sql/sql_repl.cc: CHANGE MASTER TO .. RELAY_LOG_FILE=,RELAY_LOG_POS= sql/sql_yacc.yy: CHANGE MASTER TO .. RELAY_LOG_FILE=,RELAY_LOG_POS=
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 0ffc37eb975..1d701ce1f81 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -345,7 +345,13 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
}
}
DBUG_ASSERT(thd != 0);
- KICK_SLAVE(thd);
+ /* is is criticate to test if the slave is running. Otherwise, we might
+ be referening freed memory trying to kick it
+ */
+ if (*slave_running)
+ {
+ KICK_SLAVE(thd);
+ }
while (*slave_running)
{
/* there is a small chance that slave thread might miss the first
@@ -367,7 +373,9 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
DBUG_ASSERT_LOCK(cond_lock);
pthread_cond_timedwait(term_cond, cond_lock, &abstime);
if (*slave_running)
+ {
KICK_SLAVE(thd);
+ }
}
if (term_lock)
pthread_mutex_unlock(term_lock);