List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:January 15 2009 10:11am
Subject:bzr push into mysql-5.0-bugteam branch (alik:2730)
View as plain text  
 2730 Alexander Nozdrin	2009-01-15 [merge]
      Pull from 5.0-bugteam
modified:
  mysql-test/r/innodb_cache.result
  mysql-test/r/query_cache.result
  mysql-test/t/query_cache.test
  sql/mysql_priv.h
  sql/sql_cache.cc
  tests/mysql_client_test.c

=== modified file 'mysql-test/r/not_embedded_server.result'
--- a/mysql-test/r/not_embedded_server.result	2005-09-02 23:13:18 +0000
+++ b/mysql-test/r/not_embedded_server.result	2009-01-15 09:36:34 +0000
@@ -3,3 +3,10 @@ execute stmt1;
 Id	User	Host	db	Command	Time	State	Info
 number	root	localhost	test	Query	time	NULL	show full processlist
 deallocate prepare stmt1;
+FLUSH STATUS;
+SHOW GLOBAL STATUS LIKE 'com_select';
+Variable_name	Value
+Com_select	101
+SHOW GLOBAL STATUS LIKE 'com_select';
+Variable_name	Value
+Com_select	101

=== modified file 'mysql-test/t/not_embedded_server.test'
--- a/mysql-test/t/not_embedded_server.test	2005-07-28 00:22:47 +0000
+++ b/mysql-test/t/not_embedded_server.test	2009-01-15 09:36:34 +0000
@@ -16,3 +16,31 @@ execute stmt1;
 deallocate prepare stmt1;
 
 # End of 4.1 tests
+
+#
+# Bug#31222: com_% global status counters behave randomly with
+# mysql_change_user.
+#
+
+FLUSH STATUS;
+
+--disable_result_log
+--disable_query_log
+
+let $i = 100;
+
+while ($i)
+{
+  dec $i;
+
+  SELECT 1;
+}
+
+--enable_query_log
+--enable_result_log
+
+SHOW GLOBAL STATUS LIKE 'com_select';
+
+--change_user
+
+SHOW GLOBAL STATUS LIKE 'com_select';

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2008-09-17 06:34:00 +0000
+++ b/sql/sql_class.cc	2009-01-15 09:36:34 +0000
@@ -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();

Thread
bzr push into mysql-5.0-bugteam branch (alik:2730)Alexander Nozdrin15 Jan