summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2009-10-15 23:38:29 +0200
committerunknown <knielsen@knielsen-hq.org>2009-10-15 23:38:29 +0200
commit6aad537a6aa1381b73e87e53a5a17eda4ef1d452 (patch)
tree9366ff2dea102dc28d90ffad1cf8dff3039650e0 /sql/slave.cc
parent8ea19fa73e86a3c27917a92affd6a9e43763c7ce (diff)
parentc7d32876f345785580a7cf286542ccf390b4e1fa (diff)
downloadmariadb-git-6aad537a6aa1381b73e87e53a5a17eda4ef1d452.tar.gz
Merge MySQL 5.1.39 into MariaDB 5.1.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc28
1 files changed, 25 insertions, 3 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 926db30be15..314c12313f6 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1961,9 +1961,6 @@ static int has_temporary_error(THD *thd)
{
DBUG_ENTER("has_temporary_error");
- if (thd->is_fatal_error)
- DBUG_RETURN(0);
-
DBUG_EXECUTE_IF("all_errors_are_temporary_errors",
if (thd->main_da.is_error())
{
@@ -3689,6 +3686,31 @@ void end_relay_log_info(Relay_log_info* rli)
DBUG_VOID_RETURN;
}
+
+/**
+ Hook to detach the active VIO before closing a connection handle.
+
+ The client API might close the connection (and associated data)
+ in case it encounters a unrecoverable (network) error. This hook
+ is called from the client code before the VIO handle is deleted
+ allows the thread to detach the active vio so it does not point
+ to freed memory.
+
+ Other calls to THD::clear_active_vio throughout this module are
+ redundant due to the hook but are left in place for illustrative
+ purposes.
+*/
+
+extern "C" void slave_io_thread_detach_vio()
+{
+#ifdef SIGNAL_WITH_VIO_CLOSE
+ THD *thd= current_thd;
+ if (thd->slave_thread)
+ thd->clear_active_vio();
+#endif
+}
+
+
/*
Try to connect until successful or slave killed