1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

Fix for Bug#31222: com_% global status counters

behave randomly with mysql_change_user.
  
The problem was that global status variables were not updated
in THD::check_user(), so thread statistics were lost after
COM_CHANGE_USER.
  
The fix is to update global status variables with the thread ones
before preparing the thread for new user.


mysql-test/r/change_user.result:
  Update result file.
mysql-test/t/change_user.test:
  Add a test case for Bug#31222: com_% global status counters
  behave randomly with mysql_change_user.
sql/sql_class.cc:
  Update global status variables when we're handling
  COM_CHANGE_USER for a thread.
This commit is contained in:
unknown
2008-02-12 20:59:09 +03:00
parent a0d88ebb0b
commit 215625b143
3 changed files with 39 additions and 0 deletions

View File

@@ -769,6 +769,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();
killed= NOT_KILLED;
cleanup_done= 0;