1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge maint2.mysql.com:/data/localhome/tsmith/bk/mrg50/50

into  maint2.mysql.com:/data/localhome/tsmith/bk/mrg50/51
This commit is contained in:
tsmith@maint2.mysql.com
2006-09-13 09:03:52 +02:00
39 changed files with 612 additions and 341 deletions

View File

@ -1047,8 +1047,8 @@ static int check_connection(THD *thd)
char *passwd= strend(user)+1;
uint user_len= passwd - user - 1;
char *db= passwd;
char db_buff[NAME_LEN+1]; // buffer to store db in utf8
char user_buff[USERNAME_LENGTH+1]; // buffer to store user in utf8
char db_buff[NAME_BYTE_LEN + 1]; // buffer to store db in utf8
char user_buff[USERNAME_BYTE_LENGTH + 1]; // buffer to store user in utf8
uint dummy_errors;
/*
@ -1724,7 +1724,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
password. New clients send the size (1 byte) + string (not null
terminated, so also '\0' for empty string).
*/
char db_buff[NAME_LEN+1]; // buffer to store db in utf8
char db_buff[NAME_BYTE_LEN+1]; // buffer to store db in utf8
char *db= passwd;
uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
*passwd++ : strlen(passwd);
@ -7803,6 +7803,7 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user)
SYNOPSIS
check_string_length()
cs string charset
str string to be checked
err_msg error message to be displayed if the string is too long
max_length max length
@ -7812,13 +7813,13 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user)
TRUE the passed string is longer than max_length
*/
bool check_string_length(LEX_STRING *str, const char *err_msg,
uint max_length)
bool check_string_length(CHARSET_INFO *cs, LEX_STRING *str,
const char *err_msg, uint max_length)
{
if (str->length <= max_length)
return FALSE;
if (cs->cset->charpos(cs, str->str, str->str + str->length,
max_length) >= str->length)
return FALSE;
my_error(ER_WRONG_STRING_LENGTH, MYF(0), str->str, err_msg, max_length);
return TRUE;
}