diff options
author | gluh@mysql.com/gluh.(none) <> | 2006-09-27 20:11:11 +0500 |
---|---|---|
committer | gluh@mysql.com/gluh.(none) <> | 2006-09-27 20:11:11 +0500 |
commit | 4aaf7e34ff45f084234b007b68fb4e0f892ca625 (patch) | |
tree | 87c6447257e8bbea4ce533d2d92fb68aa5114db6 /sql | |
parent | c3d63bef2b871ba7ab904f1b41a148d4e176d9f9 (diff) | |
download | mariadb-git-4aaf7e34ff45f084234b007b68fb4e0f892ca625.tar.gz |
additional 'after merge' fix
Diffstat (limited to 'sql')
-rw-r--r-- | sql/mysql_priv.h | 2 | ||||
-rw-r--r-- | sql/sql_parse.cc | 11 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 6 |
3 files changed, 9 insertions, 10 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index f293c769d75..2c8c7d7cc00 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -567,7 +567,7 @@ void get_default_definer(THD *thd, LEX_USER *definer); LEX_USER *create_default_definer(THD *thd); LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name); 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); enum enum_mysql_completiontype { diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 077de261628..18d048df393 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -7565,7 +7565,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 @@ -7575,13 +7574,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; } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 32f618e9601..764b6dd53c1 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -7523,7 +7523,7 @@ user: $$->host.str= (char *) "%"; $$->host.length= 1; - if (check_string_length(system_charset_info, &$$->user, + if (check_string_length(&$$->user, ER(ER_USERNAME), USERNAME_LENGTH)) YYABORT; } @@ -7534,9 +7534,9 @@ user: YYABORT; $$->user = $1; $$->host=$3; - if (check_string_length(system_charset_info, &$$->user, + if (check_string_length(&$$->user, ER(ER_USERNAME), USERNAME_LENGTH) || - check_string_length(&my_charset_latin1, &$$->host, + check_string_length(&$$->host, ER(ER_HOSTNAME), HOSTNAME_LENGTH)) YYABORT; } |