1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

after merge fix

sql/mysql_priv.h:
  after merge fix
  added charset parameter to check_string_length() function
sql/slave.h:
  after merge fix
  USERNAME_LENGTH const is changed to USERNAME_BYTE_LENGTH
sql/sql_parse.cc:
  after merge fix
  added charset parameter to check_string_length() function
sql/sql_yacc.yy:
  after merge fix
  added charset parameter to check_string_length() function
This commit is contained in:
unknown
2006-09-08 16:16:39 +05:00
parent dc6243e588
commit 4ef211eee0
4 changed files with 15 additions and 14 deletions

View File

@@ -7552,6 +7552,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
@@ -7561,16 +7562,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 (system_charset_info->cset->charpos(system_charset_info, str->str,
str->str + str->length, max_length) >=
str->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;
}