From: Date: October 23 2006 9:49pm Subject: bk commit into 5.0 tree (msvensson:1.2323) BUG#22875 List-Archive: http://lists.mysql.com/commits/14211 X-Bug: 22875 Message-Id: <20061023194918.92AD986DE8C@localhost.localdomain> Below is the list of changes that have just been committed into a local 5.0 repository of msvensson. When msvensson 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@stripped, 2006-10-23 21:49:12+02:00, msvensson@neptunus.(none) +4 -0 Bug#22875 "FLUSH STATUS" does not reset global Com_% status variables - Instead of adding the current thread's status variables to global status vars when calling FLUSH STATUS, reset the global status vars - Improve comments sql/mysqld.cc@stripped, 2006-10-23 21:49:09+02:00, msvensson@neptunus.(none) +8 -2 Instead of adding the current thread's status variables to global status vars when calling FLUSH STATUS, reset the global status vars Add comments sql/set_var.cc@stripped, 2006-10-23 21:49:10+02:00, msvensson@neptunus.(none) +1 -1 Improve comments sql/sql_class.cc@stripped, 2006-10-23 21:49:10+02:00, msvensson@neptunus.(none) +2 -3 Improve comments sql/sql_class.h@stripped, 2006-10-23 21:49:10+02:00, msvensson@neptunus.(none) +6 -1 Improve comments # 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: msvensson # Host: neptunus.(none) # Root: /home/msvensson/mysql/bug22875/my50-bug22875 --- 1.576/sql/mysqld.cc 2006-10-23 21:49:18 +02:00 +++ 1.577/sql/mysqld.cc 2006-10-23 21:49:18 +02:00 @@ -5996,6 +5996,9 @@ {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; +/* + Variables shown by SHOW STATUS in alphabetical order +*/ struct show_var_st status_vars[]= { {"Aborted_clients", (char*) &aborted_threads, SHOW_LONG}, @@ -7466,12 +7469,15 @@ { 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); + /* Reset thread's status variables */ bzero((char*) &thd->status_var, sizeof(thd->status_var)); + /* Reset global status variables */ + bzero((char*) status_var, sizeof(status_var)); + for (struct show_var_st *ptr=status_vars; ptr->name; ptr++) { + /* Clear global variable */ if (ptr->type == SHOW_LONG) *(ulong*) ptr->value= 0; } --- 1.252/sql/sql_class.cc 2006-10-23 21:49:18 +02:00 +++ 1.253/sql/sql_class.cc 2006-10-23 21:49:18 +02:00 @@ -464,14 +464,13 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var) { - ulong *end= (ulong*) ((byte*) to_var + offsetof(STATUS_VAR, - last_system_status_var) + + ulong *end= (ulong*) ((byte*) to_var + + offsetof(STATUS_VAR, last_system_status_var) + sizeof(ulong)); ulong *to= (ulong*) to_var, *from= (ulong*) from_var; while (to != end) *(to++)+= *(from++); - /* it doesn't make sense to add last_query_cost values */ } --- 1.305/sql/sql_class.h 2006-10-23 21:49:18 +02:00 +++ 1.306/sql/sql_class.h 2006-10-23 21:49:18 +02:00 @@ -646,12 +646,17 @@ ulong com_stmt_reset; ulong com_stmt_close; + /* + Status variables which it does not make sense to add to + global status variable counter + */ double last_query_cost; } STATUS_VAR; /* This is used for 'show status'. It must be updated to the last ulong - variable in system_status_var + variable in system_status_var which it makes sense to add to the global + counter */ #define last_system_status_var com_stmt_close --- 1.169/sql/set_var.cc 2006-10-23 21:49:18 +02:00 +++ 1.170/sql/set_var.cc 2006-10-23 21:49:18 +02:00 @@ -804,7 +804,7 @@ /* - Variables shown by SHOW variables in alphabetical order + Variables shown by SHOW VARIABLES in alphabetical order */ struct show_var_st init_vars[]= {