Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram 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.2128 06/05/15 17:35:49 ramil@stripped +3 -0
Addition to fix for #10210: running SHOW STATUS increments counters it shouldn't
- add "hidden" thread statistics to the global statistic array.
sql/sql_select.cc
1.415 06/05/15 17:35:38 ramil@stripped +5 -0
Addition to fix for #10210: running SHOW STATUS increments counters it shouldn't
- add "hidden" thread statistics to the global statistic array.
sql/sql_class.h
1.290 06/05/15 17:35:38 ramil@stripped +2 -0
Addition to fix for #10210: running SHOW STATUS increments counters it shouldn't
- add "hidden" thread statistics to the global statistic array.
sql/sql_class.cc
1.233 06/05/15 17:35:37 ramil@stripped +26 -0
Addition to fix for #10210: running SHOW STATUS increments counters it shouldn't
- add "hidden" thread statistics to the global statistic array.
# 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: ramil
# Host: myoffice.izhnet.ru
# Root: /usr/home/ram/work/5.0.b10210
--- 1.232/sql/sql_class.cc 2006-04-21 19:54:58 +05:00
+++ 1.233/sql/sql_class.cc 2006-05-15 17:35:37 +05:00
@@ -471,6 +471,32 @@ void add_to_status(STATUS_VAR *to_var, S
}
+/*
+ Add the difference between two status variable arays to another one.
+
+ SYNOPSIS
+ add_to_status()
+ to_var add to this array
+ from_var1 from this array
+ from_var2 minus this array
+ length array length in bytes
+
+ NOTE
+ This function assumes that all variables are long/ulong.
+*/
+
+void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var1,
+ STATUS_VAR *from_var2, uint length)
+{
+ ulong *to= (ulong*) to_var;
+ ulong *end= (ulong*) ((byte*) to_var + length);
+ ulong *from1= (ulong*) from_var1, *from2= (ulong*) from_var2;
+
+ while (to != end)
+ *(to++)+= *(from1++) - *(from2++);
+}
+
+
void THD::awake(THD::killed_state state_to_set)
{
THD_CHECK_SENTRY(this);
--- 1.289/sql/sql_class.h 2006-05-12 15:42:58 +05:00
+++ 1.290/sql/sql_class.h 2006-05-15 17:35:38 +05:00
@@ -2112,3 +2112,5 @@ public:
/* Functions in sql_class.cc */
void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var);
+void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var1,
+ STATUS_VAR *from_var2, uint length);
--- 1.414/sql/sql_select.cc 2006-05-12 15:42:58 +05:00
+++ 1.415/sql/sql_select.cc 2006-05-15 17:35:38 +05:00
@@ -1927,6 +1927,11 @@ mysql_select(THD *thd, Item ***rref_poin
err:
if ((thd->lex->orig_sql_command == SQLCOM_SHOW_STATUS) && saved_status_var)
{
+ /* Update global statistics */
+ pthread_mutex_lock(&LOCK_status);
+ add_diff_to_status(&global_status_var, &thd->status_var,
+ (STATUS_VAR*) saved_status_var, status_var_buf_size);
+ pthread_mutex_unlock(&LOCK_status);
/* Restore status variables */
memcpy(&thd->status_var, saved_status_var, status_var_buf_size);
}
| Thread |
|---|
| • bk commit into 5.0 tree (ramil:1.2128) | ramil | 15 May |