MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:John H. Embretsen Date:September 18 2009 12:44pm
Subject:bzr commit into mysql-6.0-falcon-team branch (john.embretsen:2790) Bug#40930
WL#4085
View as plain text  
#At file:///export/home/tmp/je159969/mysql-dev/bzr-repos/build-falcon-team-gcc/ based on revid:john.embretsen@stripped

 2790 John H. Embretsen	2009-09-18
      Bug#40930 - rpl.rpl_extraCol_falcon fails doing STOP SLAVE
      Apply the real fix for 40796 (the culprit bug) - the previously applied fix was "placebo" (hinted by Vlad V.).
      Ported to 6.0-falcon-team by leaving out (unused) changes for instance manager (which was removed in 6.0, wl#4085).
      Original patch: http://lists.mysql.com/commits/80781

    modified:
      sql-common/client.c
      sql/client_settings.h
      sql/slave.cc
=== modified file 'sql-common/client.c'
--- a/sql-common/client.c	2009-04-21 09:27:46 +0000
+++ b/sql-common/client.c	2009-09-18 12:43:56 +0000
@@ -1029,6 +1029,9 @@ void end_server(MYSQL *mysql)
   {
     init_sigpipe_variables
     DBUG_PRINT("info",("Net: %s", vio_description(mysql->net.vio)));
+#ifdef MYSQL_SERVER
+    slave_io_thread_detach_vio();
+#endif
     set_sigpipe(mysql);
     vio_delete(mysql->net.vio);
     reset_sigpipe(mysql);

=== modified file 'sql/client_settings.h'
--- a/sql/client_settings.h	2006-12-31 00:02:27 +0000
+++ b/sql/client_settings.h	2009-09-18 12:43:56 +0000
@@ -33,3 +33,11 @@
 
 #define mysql_server_init(a,b,c) 0
 
+#ifdef HAVE_REPLICATION
+C_MODE_START
+void slave_io_thread_detach_vio();
+C_MODE_END
+#else
+#define slave_io_thread_detach_vio()
+#endif
+

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2009-05-13 16:04:01 +0000
+++ b/sql/slave.cc	2009-09-18 12:43:56 +0000
@@ -4402,6 +4402,31 @@ err:
   DBUG_RETURN(0);
 }
 
+
+/**
+  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
+}
+
+
 /*
   Rotate a relay log (this is used only by FLUSH LOGS; the automatic rotation
   because of size is simpler because when we do it we already have all relevant


Attachment: [text/bzr-bundle] bzr/john.embretsen@sun.com-20090918124356-hs4840ngbh6wecvv.bundle
Thread
bzr commit into mysql-6.0-falcon-team branch (john.embretsen:2790) Bug#40930WL#4085John H. Embretsen18 Sep