List:Commits« Previous MessageNext Message »
From:jani Date:January 10 2006 4:56pm
Subject:bk commit into 5.0 tree (jani:1.2029)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jani. When jani does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2029 06/01/10 18:56:23 jani@stripped +2 -0
  Fixed refresh_status function.

  sql/sql_parse.cc
    1.521 06/01/10 18:56:17 jani@stripped +7 -9
    Changed refresh status to take thd as argument to avoid current_thd.
    Removed add_to_status away from loop, as it is not necessary for each
    variable, only required for each thread. In this case only the current
    thread.

  sql/sql_class.cc
    1.225 06/01/10 18:56:16 jani@stripped +6 -1
    Improved documentation on add_to_status().

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jani
# Host:	ua141d10.elisa.omakaista.fi
# Root:	/home/my/bk/mysql-5.0

--- 1.224/sql/sql_class.cc	2005-12-18 16:24:12 +02:00
+++ 1.225/sql/sql_class.cc	2006-01-10 18:56:16 +02:00
@@ -445,7 +445,12 @@
 
 
 /*
-  Add to one status variable another status variable
+  Add all status variables to another status variable array
+
+  SYNOPSIS
+   add_to_status()
+   to_var       add to this array
+   from_var     from this array
 
   NOTES
     This function assumes that all variables are long/ulong.

--- 1.520/sql/sql_parse.cc	2006-01-06 00:49:24 +02:00
+++ 1.521/sql/sql_parse.cc	2006-01-10 18:56:17 +02:00
@@ -6538,7 +6538,7 @@
   if (options & REFRESH_HOSTS)
     hostname_cache_refresh();
   if (thd && (options & REFRESH_STATUS))
-    refresh_status();
+    refresh_status(thd);
   if (options & REFRESH_THREADS)
     flush_thread_cache();
 #ifdef HAVE_REPLICATION
@@ -6624,20 +6624,18 @@
 
 /* Clear most status variables */
 
-static void refresh_status(void)
+static void refresh_status(THD *thd)
 {
   pthread_mutex_lock(&LOCK_status);
+
+  /* We must update the global status before cleaning up the thread */
+  add_to_status(&global_status_var, &thd->status_var);
+  bzero((char*) &thd->status_var, sizeof(thd->status_var));
+
   for (struct show_var_st *ptr=status_vars; ptr->name; ptr++)
   {
     if (ptr->type == SHOW_LONG)
       *(ulong*) ptr->value= 0;
-    else if (ptr->type == SHOW_LONG_STATUS)
-    {
-      THD *thd= current_thd;
-      /* We must update the global status before cleaning up the thread */
-      add_to_status(&global_status_var, &thd->status_var);
-      bzero((char*) &thd->status_var, sizeof(thd->status_var));
-    }
   }
   /* Reset the counters of all key caches (default and named). */
   process_key_caches(reset_key_cache_counters);
Thread
bk commit into 5.0 tree (jani:1.2029)jani10 Jan