diff options
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index e85a7d74851..ae863504202 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1487,9 +1487,7 @@ void THD::init_for_queries() void THD::change_user(void) { - mysql_mutex_lock(&LOCK_status); - add_to_status(&global_status_var, &status_var); - mysql_mutex_unlock(&LOCK_status); + add_status_to_global(); cleanup(); reset_killed(); @@ -1520,6 +1518,7 @@ void THD::cleanup(void) #endif mysql_ha_cleanup(this); + locked_tables_list.unlock_locked_tables(this); close_temporary_tables(this); @@ -1527,8 +1526,6 @@ void THD::cleanup(void) trans_rollback(this); xid_cache_delete(&transaction.xid_state); - locked_tables_list.unlock_locked_tables(this); - DBUG_ASSERT(open_tables == NULL); /* If the thread was in the middle of an ongoing transaction (rolled |