diff options
author | unknown <rafal@quant.(none)> | 2007-03-01 10:03:42 +0100 |
---|---|---|
committer | unknown <rafal@quant.(none)> | 2007-03-01 10:03:42 +0100 |
commit | b3c7224c3b82a3cbe0661c59ceabb9b7343d0319 (patch) | |
tree | 2b62ffb4727b6b39cd0e6b2094a3e1c2fd02643f /sql/slave.cc | |
parent | 58e93b1f9fee89b589a4cfed4f45182015a083e4 (diff) | |
parent | 9c8637dc4cb97f97eec964f64aaefe906d65f614 (diff) | |
download | mariadb-git-b3c7224c3b82a3cbe0661c59ceabb9b7343d0319.tar.gz |
Merge quant.(none):/ext/mysql/bk/mysql-5.0-bug25306
into quant.(none):/ext/mysql/bkroot/mysql-5.1-new-rpl
sql/sql_repl.cc:
Auto merged
sql/slave.cc:
Manual merge of patch for BUG#25306 from 5.0-rpl tree
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index 3a9cde42059..bb2aa11626e 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2205,11 +2205,16 @@ err: THD_CHECK_SENTRY(thd); delete thd; pthread_mutex_unlock(&LOCK_thread_count); - mi->abort_slave = 0; - mi->slave_running = 0; - mi->io_thd = 0; - pthread_mutex_unlock(&mi->run_lock); + mi->abort_slave= 0; + mi->slave_running= 0; + mi->io_thd= 0; + /* + Note: the order of the two following calls (first broadcast, then unlock) + is important. Otherwise a killer_thread can execute between the calls and + delete the mi structure leading to a crash! (see BUG#25306 for details) + */ pthread_cond_broadcast(&mi->stop_cond); // tell the world we are done + pthread_mutex_unlock(&mi->run_lock); my_thread_end(); pthread_exit(0); DBUG_RETURN(0); // Can't return anything here @@ -2455,9 +2460,21 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ THD_CHECK_SENTRY(thd); delete thd; pthread_mutex_unlock(&LOCK_thread_count); +#ifndef DBUG_OFF + /* + Bug #19938 Valgrind error (race) in handle_slave_sql() + Read the value of rli->event_till_abort before releasing the mutex + */ + const int eta= rli->events_till_abort; +#endif + /* + Note: the order of the broadcast and unlock calls below (first broadcast, then unlock) + is important. Otherwise a killer_thread can execute between the calls and + delete the mi structure leading to a crash! (see BUG#25306 for details) + */ pthread_cond_broadcast(&rli->stop_cond); - // tell the world we are done - pthread_mutex_unlock(&rli->run_lock); + pthread_mutex_unlock(&rli->run_lock); // tell the world we are done + my_thread_end(); pthread_exit(0); DBUG_RETURN(0); // Can't return anything here |