summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2015-06-26 14:48:22 +0300
committerMonty <monty@mariadb.org>2015-06-26 14:48:22 +0300
commitbc300464f1674dc774fd166a87d8894cbe498563 (patch)
tree8c937ad0ad3001175e884c37a806e2ca6ebcfbca /sql/sql_class.h
parent67c56ab1e4841058c40e6b61e1dcbb6e21d4ce52 (diff)
downloadmariadb-git-bc300464f1674dc774fd166a87d8894cbe498563.tar.gz
Fix for MDEV-8301; Statistics for a thread could be counted twice in SHOW STATUS while thread was ending
Fixed by adding a marker if we have added the thread statistics to the global counters.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 67db1662f10..17dd0f9f64f 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1733,11 +1733,11 @@ public:
/* Do not set socket timeouts for wait_timeout (used with threadpool) */
bool skip_wait_timeout;
- /* container for handler's private per-connection data */
- Ha_data ha_data[MAX_HA];
-
bool prepare_derived_at_open;
+ /* Set to 1 if status of this THD is already in global status */
+ bool status_in_global;
+
/*
To signal that the tmp table to be created is created for materialized
derived table or a view.
@@ -1746,6 +1746,9 @@ public:
bool save_prep_leaf_list;
+ /* container for handler's private per-connection data */
+ Ha_data ha_data[MAX_HA];
+
#ifndef MYSQL_CLIENT
binlog_cache_mngr * binlog_setup_trx_data();
@@ -3116,6 +3119,8 @@ public:
{
mysql_mutex_lock(&LOCK_status);
add_to_status(&global_status_var, &status_var);
+ /* Mark that this THD status has already been added in global status */
+ status_in_global= 1;
mysql_mutex_unlock(&LOCK_status);
}