List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:July 30 2012 1:02pm
Subject:bzr push into mysql-trunk branch (tor.didriksen:4140 to 4141)
View as plain text  
 4141 Tor Didriksen	2012-07-30 [merge]
      merge 5.6 => trunk

    modified:
      sql/mysqld.cc
      sql/sql_class.cc
 4140 Hemant Kumar	2012-07-30 [merge]
      Merging the default.weekly collection changes from mysql-5.6.

    modified:
      mysql-test/collections/default.weekly
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2012-07-26 10:56:48 +0000
+++ b/sql/mysqld.cc	2012-07-30 13:01:55 +0000
@@ -1355,7 +1355,8 @@ static void close_connections(void)
     statements and inform their clients that the server is about to die.
   */
 
-  sql_print_information("Giving client threads a chance to die gracefully");
+  sql_print_information("Giving %d client threads a chance to die gracefully",
+                        static_cast<int>(get_thread_count()));
 
   mysql_mutex_lock(&LOCK_thread_count);
 
@@ -1400,7 +1401,8 @@ static void close_connections(void)
     client on a blocking read call are aborted.
   */
 
-  sql_print_information("Forcefully disconnecting remaining clients");
+  sql_print_information("Forcefully disconnecting %d remaining clients",
+                        static_cast<int>(get_thread_count()));
 
 #ifndef __bsdi__ // Bug in BSDI kernel
   DBUG_PRINT("quit", ("Locking LOCK_thread_count"));

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2012-07-26 11:34:35 +0000
+++ b/sql/sql_class.cc	2012-07-30 13:01:55 +0000
@@ -1530,22 +1530,24 @@ void THD::release_resources()
   mysql_mutex_assert_not_owner(&LOCK_thread_count);
   DBUG_ASSERT(m_release_resources_done == false);
 
-  /* Ensure that no one is using THD */
-  mysql_mutex_lock(&LOCK_thd_data);
-  mysql_mutex_unlock(&LOCK_thd_data);
-
   mysql_rwlock_wrlock(&LOCK_status);
   add_to_status(&global_status_var, &status_var);
   mysql_rwlock_unlock(&LOCK_status);
 
+  /* Ensure that no one is using THD */
+  mysql_mutex_lock(&LOCK_thd_data);
+
   /* Close connection */
 #ifndef EMBEDDED_LIBRARY
   if (net.vio)
   {
     vio_delete(net.vio);
     net_end(&net);
+    net.vio= NULL;
   }
 #endif
+  mysql_mutex_unlock(&LOCK_thd_data);
+
   stmt_map.reset();                     /* close all prepared statements */
   if (!cleanup_done)
     cleanup();
@@ -1806,8 +1808,11 @@ void THD::disconnect()
 #endif
 
   /* Disconnect even if a active vio is not associated. */
-  if (net.vio != vio)
+  if (net.vio != vio && net.vio != NULL)
+  {
     vio_close(net.vio);
+    net.vio= NULL;
+  }
 
   mysql_mutex_unlock(&LOCK_thd_data);
 }

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (tor.didriksen:4140 to 4141) Tor Didriksen30 Jul