mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean
This commit is contained in:
@@ -193,7 +193,7 @@ static int get_or_create_user_conn(THD *thd, const char *user,
|
||||
const char *host,
|
||||
USER_RESOURCES *mqh)
|
||||
{
|
||||
int return_val=0;
|
||||
int return_val= 0;
|
||||
uint temp_len, user_len;
|
||||
char temp_user[USERNAME_LENGTH+HOSTNAME_LENGTH+2];
|
||||
struct user_conn *uc;
|
||||
@@ -201,7 +201,7 @@ static int get_or_create_user_conn(THD *thd, const char *user,
|
||||
DBUG_ASSERT(user != 0);
|
||||
DBUG_ASSERT(host != 0);
|
||||
|
||||
user_len=strlen(user);
|
||||
user_len= strlen(user);
|
||||
temp_len= (strmov(strmov(temp_user, user)+1, host) - temp_user)+1;
|
||||
(void) pthread_mutex_lock(&LOCK_user_conn);
|
||||
if (!(uc = (struct user_conn *) hash_search(&hash_user_connections,
|
||||
@@ -213,21 +213,21 @@ static int get_or_create_user_conn(THD *thd, const char *user,
|
||||
MYF(MY_WME)))))
|
||||
{
|
||||
net_send_error(thd, 0, NullS); // Out of memory
|
||||
return_val=1;
|
||||
return_val= 1;
|
||||
goto end;
|
||||
}
|
||||
uc->user=(char*) (uc+1);
|
||||
memcpy(uc->user,temp_user,temp_len+1);
|
||||
uc->host= uc->user + user_len + 1;
|
||||
uc->len = temp_len;
|
||||
uc->len= temp_len;
|
||||
uc->connections= uc->questions= uc->updates= uc->conn_per_hour= 0;
|
||||
uc->user_resources=*mqh;
|
||||
uc->intime=thd->thr_create_time;
|
||||
uc->user_resources= *mqh;
|
||||
uc->intime= thd->thr_create_time;
|
||||
if (my_hash_insert(&hash_user_connections, (byte*) uc))
|
||||
{
|
||||
my_free((char*) uc,0);
|
||||
net_send_error(thd, 0, NullS); // Out of memory
|
||||
return_val=1;
|
||||
return_val= 1;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
@@ -5305,6 +5305,8 @@ void create_select_for_variable(const char *var_name)
|
||||
THD *thd;
|
||||
LEX *lex;
|
||||
LEX_STRING tmp, null_lex_string;
|
||||
Item *var;
|
||||
char buff[MAX_SYS_VAR_LENGTH*2+4+8], *end;
|
||||
DBUG_ENTER("create_select_for_variable");
|
||||
|
||||
thd= current_thd;
|
||||
@@ -5314,8 +5316,14 @@ void create_select_for_variable(const char *var_name)
|
||||
tmp.str= (char*) var_name;
|
||||
tmp.length=strlen(var_name);
|
||||
bzero((char*) &null_lex_string.str, sizeof(null_lex_string));
|
||||
add_item_to_list(thd, get_system_var(thd, OPT_SESSION, tmp,
|
||||
null_lex_string));
|
||||
/*
|
||||
We set the name of Item to @@session.var_name because that then is used
|
||||
as the column name in the output.
|
||||
*/
|
||||
var= get_system_var(thd, OPT_SESSION, tmp, null_lex_string);
|
||||
end= strxmov(buff, "@@session.", var_name, NullS);
|
||||
var->set_name(buff, end-buff, system_charset_info);
|
||||
add_item_to_list(thd, var);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user