mirror of
https://github.com/MariaDB/server.git
synced 2025-08-05 13:16:09 +03:00
Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into mysql.com:/home/gluh/MySQL/Merge/5.1 include/mysql_com.h: Auto merged mysql-test/r/ctype_utf8.result: Auto merged mysql-test/r/func_time.result: Auto merged mysql-test/r/query_cache.result: Auto merged mysql-test/r/type_date.result: Auto merged mysql-test/r/view.result: Auto merged mysql-test/t/ctype_utf8.test: Auto merged mysql-test/t/func_time.test: Auto merged mysql-test/t/view.test: Auto merged sql/item_cmpfunc.cc: Auto merged sql/mysql_priv.h: Auto merged sql/slave.h: Auto merged sql/sql_acl.cc: Auto merged sql/sql_parse.cc: Auto merged sql-common/client.c: Auto merged sql/sql_repl.h: Auto merged sql/sql_yacc.yy: Auto merged sql/sp.cc: manual merge sql/sp_head.cc: manual merge sql/sql_class.h: manual merge sql/table.cc: manual merge
This commit is contained in:
@@ -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_BYTE_LEN + 1]; // buffer to store db in utf8
|
||||
char user_buff[USERNAME_BYTE_LENGTH + 1]; // buffer to store user in utf8
|
||||
char db_buff[NAME_LEN + 1]; // buffer to store db in utf8
|
||||
char user_buff[USERNAME_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_BYTE_LEN+1]; // buffer to store db in utf8
|
||||
char db_buff[NAME_LEN+1]; // buffer to store db in utf8
|
||||
char *db= passwd;
|
||||
uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
|
||||
*passwd++ : strlen(passwd);
|
||||
@@ -7783,7 +7783,6 @@ 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
|
||||
@@ -7793,13 +7792,13 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user)
|
||||
TRUE the passed string is longer than max_length
|
||||
*/
|
||||
|
||||
bool check_string_length(CHARSET_INFO *cs, LEX_STRING *str,
|
||||
const char *err_msg, uint max_length)
|
||||
bool check_string_length(LEX_STRING *str, const char *err_msg,
|
||||
uint max_length)
|
||||
{
|
||||
if (cs->cset->charpos(cs, str->str, str->str + str->length,
|
||||
max_length) >= str->length)
|
||||
return FALSE;
|
||||
if (str->length <= max_length)
|
||||
return FALSE;
|
||||
|
||||
my_error(ER_WRONG_STRING_LENGTH, MYF(0), str->str, err_msg, max_length);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user