Commit e0a12e89 authored by unknown's avatar unknown

Bug #4629 Crash after SLAVE STOP, if the IO thread is in special state.

client.c:
  Removed call to clear_slave_vio in end_server().  Removed header declaration of clear_slave_vio
slave.cc:
  Removed clear_slave_vio function and added calls to thd->clear_active_vio before each call to end_server()


sql/slave.cc:
  Removed clear_slave_vio function and added calls to thd->clear_active_vio before each call to end_server()
sql-common/client.c:
  Removed call to clear_slave_vio in end_server().  Removed header declaration of clear_slave_vio
parent 2eb954a2
...@@ -133,10 +133,6 @@ static void mysql_close_free(MYSQL *mysql); ...@@ -133,10 +133,6 @@ static void mysql_close_free(MYSQL *mysql);
static int wait_for_data(my_socket fd, uint timeout); static int wait_for_data(my_socket fd, uint timeout);
#endif #endif
#if defined(__WIN__) && defined(HAVE_REPLICATION) && defined(MYSQL_SERVER)
void clear_slave_vio( MYSQL* mysql );
#endif
/**************************************************************************** /****************************************************************************
A modified version of connect(). my_connect() allows you to specify A modified version of connect(). my_connect() allows you to specify
...@@ -823,12 +819,6 @@ void end_server(MYSQL *mysql) ...@@ -823,12 +819,6 @@ void end_server(MYSQL *mysql)
init_sigpipe_variables init_sigpipe_variables
DBUG_PRINT("info",("Net: %s", vio_description(mysql->net.vio))); DBUG_PRINT("info",("Net: %s", vio_description(mysql->net.vio)));
set_sigpipe(mysql); set_sigpipe(mysql);
#if defined(__WIN__) && defined(HAVE_REPLICATION) && defined(MYSQL_SERVER)
/* if this mysql is one of our connections to the master, then clear it */
clear_slave_vio( mysql );
#endif
vio_delete(mysql->net.vio); vio_delete(mysql->net.vio);
reset_sigpipe(mysql); reset_sigpipe(mysql);
mysql->net.vio= 0; /* Marker */ mysql->net.vio= 0; /* Marker */
......
...@@ -3056,6 +3056,9 @@ dump"); ...@@ -3056,6 +3056,9 @@ dump");
} }
thd->proc_info= "Waiting to reconnect after a failed binlog dump request"; thd->proc_info= "Waiting to reconnect after a failed binlog dump request";
#ifdef SIGNAL_WITH_VIO_CLOSE
thd->clear_active_vio();
#endif
end_server(mysql); end_server(mysql);
/* /*
First time retry immediately, assuming that we can recover First time retry immediately, assuming that we can recover
...@@ -3129,6 +3132,9 @@ max_allowed_packet", ...@@ -3129,6 +3132,9 @@ max_allowed_packet",
goto err; goto err;
} }
thd->proc_info = "Waiting to reconnect after a failed master event read"; thd->proc_info = "Waiting to reconnect after a failed master event read";
#ifdef SIGNAL_WITH_VIO_CLOSE
thd->clear_active_vio();
#endif
end_server(mysql); end_server(mysql);
if (retry_count++) if (retry_count++)
{ {
...@@ -4384,25 +4390,4 @@ template class I_List_iterator<i_string_pair>; ...@@ -4384,25 +4390,4 @@ template class I_List_iterator<i_string_pair>;
#endif #endif
#ifdef __WIN__
extern "C" void clear_slave_vio( MYSQL* mysql )
{
if (active_mi->mysql == mysql)
active_mi->io_thd->clear_active_vio();
/* TODO: use code like below when multi-master is in place */
/* LIST *cur = &master_list;
if (((MASTER_INFO*)cur->data)->mysql == mysql)
{
MASTER_INFO *mi = (MASTER_INFO*)cur->data;
mi->io_thd->clear_active_vio();
return;
}
else
cur = cur->next;*/
}
#endif
#endif /* HAVE_REPLICATION */ #endif /* HAVE_REPLICATION */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment