List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:January 7 2013 4:14pm
Subject:bzr push into mysql-trunk branch (tor.didriksen:5332 to 5333)
View as plain text  
 5333 Tor Didriksen	2013-01-07 [merge]
      merge 5.6 => trunk

    modified:
      sql/mysqld.cc
      sql/sql_class.cc
 5332 Ahmad Abdullateef	2013-01-07
      BUG#16066150 - SIGNAL_WITH_VIO_SHUTDOWN IS ALWAYS SET IN CMAKE
      
      DESCRIPTION:
      SIGNAL_WITH_VIO_SHUTDOWN is not used as it is hard-coded to 1 in CMake
      configuration, hence its existence is of no merit.
      
      
      FIX :
      All references to SIGNAL_WITH_VIO_SHUTDOWN has been removed.

    modified:
      config.h.cmake
      configure.cmake
      sql/rpl_slave.cc
      sql/sql_class.cc
      sql/sql_class.h
      sql/sql_connect.cc
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2013-01-02 13:35:44 +0000
+++ b/sql/mysqld.cc	2013-01-07 16:06:11 +0000
@@ -2660,6 +2660,21 @@ bool one_thread_per_connection_end(THD *
   */
   DBUG_EXECUTE_IF("sleep_after_lock_thread_count_before_delete_thd", sleep(5););
   remove_global_thread(thd);
+  if (kill_blocked_pthreads_flag)
+  {
+    // Do not block if we are about to shut down
+    block_pthread= false;
+  }
+
+  // Clean up errors now, before possibly waiting for a new connection.
+#ifndef EMBEDDED_LIBRARY
+  ERR_remove_state(0);
+#endif
+
+  /*
+    Using global resources (like mutexes) is unsafe once we have released
+    the mutex here: the server may be shutting down.
+   */
   mysql_mutex_unlock(&LOCK_thread_count);
   delete thd;
 
@@ -2673,9 +2688,6 @@ bool one_thread_per_connection_end(THD *
   DBUG_PRINT("signal", ("Broadcasting COND_thread_count"));
   DBUG_LEAVE;                                   // Must match DBUG_ENTER()
   my_thread_end();
-#ifndef EMBEDDED_LIBRARY
-  ERR_remove_state(0);
-#endif
   mysql_cond_broadcast(&COND_thread_count);
 
   pthread_exit(0);

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2013-01-07 12:52:53 +0000
+++ b/sql/sql_class.cc	2013-01-07 16:06:11 +0000
@@ -3539,11 +3539,11 @@ void Statement_map::reset()
 
 Statement_map::~Statement_map()
 {
-  /* Must go first, hash_free will reset st_hash.records */
-  mysql_mutex_lock(&LOCK_prepared_stmt_count);
-  DBUG_ASSERT(prepared_stmt_count >= st_hash.records);
-  prepared_stmt_count-= st_hash.records;
-  mysql_mutex_unlock(&LOCK_prepared_stmt_count);
+  /*
+    We do not want to grab the global LOCK_prepared_stmt_count mutex here.
+    reset() should already have been called to maintain prepared_stmt_count.
+   */
+  DBUG_ASSERT(st_hash.records == 0);
 
   my_hash_free(&names_hash);
   my_hash_free(&st_hash);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (tor.didriksen:5332 to 5333) Tor Didriksen5 Feb