mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
after merge fix
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user