mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Merge BUG#15110 from 5.0 into 5.1.
Merge mysql.com:/home/alik/MySQL/devel/5.0-bug15110 into mysql.com:/home/alik/MySQL/devel/5.1-bug15110
This commit is contained in:
@@ -67,7 +67,7 @@ static void decrease_user_connections(USER_CONN *uc);
|
||||
static bool check_db_used(THD *thd,TABLE_LIST *tables);
|
||||
static bool check_multi_update_lock(THD *thd);
|
||||
static void remove_escape(char *name);
|
||||
static void refresh_status(void);
|
||||
static void refresh_status(THD *thd);
|
||||
static bool append_file_to_dir(THD *thd, const char **filename_ptr,
|
||||
const char *table_name);
|
||||
|
||||
@@ -209,7 +209,7 @@ static int get_or_create_user_conn(THD *thd, const char *user,
|
||||
{
|
||||
int return_val= 0;
|
||||
uint temp_len, user_len;
|
||||
char temp_user[USERNAME_LENGTH+HOSTNAME_LENGTH+2];
|
||||
char temp_user[USER_HOST_BUFF_SIZE];
|
||||
struct user_conn *uc;
|
||||
|
||||
DBUG_ASSERT(user != 0);
|
||||
@@ -741,7 +741,7 @@ static void reset_mqh(LEX_USER *lu, bool get_them= 0)
|
||||
{
|
||||
USER_CONN *uc;
|
||||
uint temp_len=lu->user.length+lu->host.length+2;
|
||||
char temp_user[USERNAME_LENGTH+HOSTNAME_LENGTH+2];
|
||||
char temp_user[USER_HOST_BUFF_SIZE];
|
||||
|
||||
memcpy(temp_user,lu->user.str,lu->user.length);
|
||||
memcpy(temp_user+lu->user.length+1,lu->host.str,lu->host.length);
|
||||
@@ -6625,7 +6625,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
|
||||
if (options & REFRESH_HOSTS)
|
||||
hostname_cache_refresh();
|
||||
if (thd && (options & REFRESH_STATUS))
|
||||
refresh_status();
|
||||
refresh_status(thd);
|
||||
if (options & REFRESH_THREADS)
|
||||
flush_thread_cache();
|
||||
#ifdef HAVE_REPLICATION
|
||||
@@ -6713,18 +6713,18 @@ void kill_one_thread(THD *thd, ulong id, bool only_kill_query)
|
||||
|
||||
/* Clear most status variables */
|
||||
|
||||
static void refresh_status(void)
|
||||
static void refresh_status(THD *thd)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_status);
|
||||
|
||||
/* We must update the global status before cleaning up the thread */
|
||||
add_to_status(&global_status_var, &thd->status_var);
|
||||
bzero((char*) &thd->status_var, sizeof(thd->status_var));
|
||||
|
||||
for (SHOW_VAR *ptr= status_vars; ptr->name; ptr++)
|
||||
if (ptr->type == SHOW_LONG) // note that SHOW_LONG_NOFLUSH variables are not reset
|
||||
*(ulong*) ptr->value= 0;
|
||||
|
||||
/* We must update the global status before cleaning up the thread */
|
||||
THD *thd= current_thd;
|
||||
add_to_status(&global_status_var, &thd->status_var);
|
||||
bzero((char*) &thd->status_var, sizeof(thd->status_var));
|
||||
|
||||
/* Reset the counters of all key caches (default and named). */
|
||||
process_key_caches(reset_key_cache_counters);
|
||||
pthread_mutex_unlock(&LOCK_status);
|
||||
|
||||
Reference in New Issue
Block a user