additional 'after merge' fix

parent c3d63bef
...@@ -567,7 +567,7 @@ void get_default_definer(THD *thd, LEX_USER *definer); ...@@ -567,7 +567,7 @@ void get_default_definer(THD *thd, LEX_USER *definer);
LEX_USER *create_default_definer(THD *thd); LEX_USER *create_default_definer(THD *thd);
LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name); LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name);
LEX_USER *get_current_user(THD *thd, LEX_USER *user); LEX_USER *get_current_user(THD *thd, LEX_USER *user);
bool check_string_length(CHARSET_INFO *cs, LEX_STRING *str, bool check_string_length(LEX_STRING *str,
const char *err_msg, uint max_length); const char *err_msg, uint max_length);
enum enum_mysql_completiontype { enum enum_mysql_completiontype {
......
...@@ -7565,7 +7565,6 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user) ...@@ -7565,7 +7565,6 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user)
SYNOPSIS SYNOPSIS
check_string_length() check_string_length()
cs string charset
str string to be checked str string to be checked
err_msg error message to be displayed if the string is too long err_msg error message to be displayed if the string is too long
max_length max length max_length max length
...@@ -7575,13 +7574,13 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user) ...@@ -7575,13 +7574,13 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user)
TRUE the passed string is longer than max_length TRUE the passed string is longer than max_length
*/ */
bool check_string_length(CHARSET_INFO *cs, LEX_STRING *str, bool check_string_length(LEX_STRING *str, const char *err_msg,
const char *err_msg, uint max_length) uint max_length)
{ {
if (cs->cset->charpos(cs, str->str, str->str + str->length, if (str->length <= max_length)
max_length) >= str->length) return FALSE;
return FALSE;
my_error(ER_WRONG_STRING_LENGTH, MYF(0), str->str, err_msg, max_length); my_error(ER_WRONG_STRING_LENGTH, MYF(0), str->str, err_msg, max_length);
return TRUE; return TRUE;
} }
...@@ -7523,7 +7523,7 @@ user: ...@@ -7523,7 +7523,7 @@ user:
$$->host.str= (char *) "%"; $$->host.str= (char *) "%";
$$->host.length= 1; $$->host.length= 1;
if (check_string_length(system_charset_info, &$$->user, if (check_string_length(&$$->user,
ER(ER_USERNAME), USERNAME_LENGTH)) ER(ER_USERNAME), USERNAME_LENGTH))
YYABORT; YYABORT;
} }
...@@ -7534,9 +7534,9 @@ user: ...@@ -7534,9 +7534,9 @@ user:
YYABORT; YYABORT;
$$->user = $1; $$->host=$3; $$->user = $1; $$->host=$3;
if (check_string_length(system_charset_info, &$$->user, if (check_string_length(&$$->user,
ER(ER_USERNAME), USERNAME_LENGTH) || ER(ER_USERNAME), USERNAME_LENGTH) ||
check_string_length(&my_charset_latin1, &$$->host, check_string_length(&$$->host,
ER(ER_HOSTNAME), HOSTNAME_LENGTH)) ER(ER_HOSTNAME), HOSTNAME_LENGTH))
YYABORT; YYABORT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment