Commit b3c7224c authored by unknown's avatar unknown
Browse files

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
parents 58e93b1f 9c8637dc
Loading
Loading
Loading
Loading
+23 −6
Original line number Diff line number Diff line
@@ -2208,8 +2208,13 @@ log space");
  mi->abort_slave= 0;
  mi->slave_running= 0;
  mi->io_thd= 0;
  pthread_mutex_unlock(&mi->run_lock);
  /*
    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
+5 −3
Original line number Diff line number Diff line
@@ -886,12 +886,14 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)

int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report )
{
  DBUG_ENTER("stop_slave");
  
  int slave_errno;
  if (!thd)
    thd = current_thd;

  if (check_access(thd, SUPER_ACL, any_db,0,0,0,0))
    return 1;
    DBUG_RETURN(1);
  thd->proc_info = "Killing slave";
  int thread_mask;
  lock_slave_threads(mi);
@@ -925,12 +927,12 @@ int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report )
  {
    if (net_report)
      my_message(slave_errno, ER(slave_errno), MYF(0));
    return 1;
    DBUG_RETURN(1);
  }
  else if (net_report)
    send_ok(thd);

  return 0;
  DBUG_RETURN(0);
}