summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2009-01-15 12:36:34 +0300
committerAlexander Nozdrin <alik@sun.com>2009-01-15 12:36:34 +0300
commit9a6e05d8b9908b3b0b5bca849f5af66e7c832e7c (patch)
treebe028a1a84e838d448eb31e5e947534c24532f97 /sql/sql_class.cc
parenta08460b83a9cbcc31fcc8875441a9430816c3421 (diff)
downloadmariadb-git-9a6e05d8b9908b3b0b5bca849f5af66e7c832e7c.tar.gz
Backport patch for Bug#31222 (com_% global status counters behave randomly
with mysql_change_user) to 5.0.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 883291ec460..91c0aa66761 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -391,6 +391,10 @@ void THD::init_for_queries()
void THD::change_user(void)
{
+ pthread_mutex_lock(&LOCK_status);
+ add_to_status(&global_status_var, &status_var);
+ pthread_mutex_unlock(&LOCK_status);
+
cleanup();
cleanup_done= 0;
init();