diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-07-14 14:09:00 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-07-14 14:09:00 +0300 |
commit | ca82f4340c546c089cb90271cbc0755f936af7a4 (patch) | |
tree | a3b02e0dad401f6113a7dcf7eee229640c880d48 /sql | |
parent | 5ce3a5b2f36ad366e0dd9553dd19fc18897db39c (diff) | |
parent | 678640019debce6c77109dc5f52e323eaee45a9f (diff) | |
download | mariadb-git-ca82f4340c546c089cb90271cbc0755f936af7a4.tar.gz |
merge
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_class.cc | 6 | ||||
-rw-r--r-- | sql/sql_class.h | 17 |
2 files changed, 16 insertions, 7 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index f41007aedfb..b1e416257ec 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1168,6 +1168,9 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var) while (to != end) *(to++)+= *(from++); + + to_var->bytes_received+= from_var->bytes_received; + to_var->bytes_sent+= from_var->bytes_sent; } /* @@ -1193,6 +1196,9 @@ void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var, while (to != end) *(to++)+= *(from++) - *(dec++); + + to_var->bytes_received+= from_var->bytes_received - dec_var->bytes_received;; + to_var->bytes_sent+= from_var->bytes_sent - dec_var->bytes_sent; } diff --git a/sql/sql_class.h b/sql/sql_class.h index 269c2418ec8..d90279454ee 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -476,12 +476,14 @@ typedef struct system_variables } SV; -/* per thread status variables */ +/** + Per thread status variables. + Must be long/ulong up to last_system_status_var so that + add_to_status/add_diff_to_status can work. +*/ typedef struct system_status_var { - ulonglong bytes_received; - ulonglong bytes_sent; ulong com_other; ulong com_stat[(uint) SQLCOM_END]; ulong created_tmp_disk_tables; @@ -537,13 +539,14 @@ typedef struct system_status_var Number of statements sent from the client */ ulong questions; + + ulonglong bytes_received; + ulonglong bytes_sent; /* IMPORTANT! SEE last_system_status_var DEFINITION BELOW. - Below 'last_system_status_var' are all variables which doesn't make any - sense to add to the /global/ status variable counter. - Status variables which it does not make sense to add to - global status variable counter + Below 'last_system_status_var' are all variables that cannot be handled + automatically by add_to_status()/add_diff_to_status(). */ double last_query_cost; } STATUS_VAR; |