1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-22558 wrong error for invalid utf8 table comment

This commit is contained in:
Sergei Golubchik
2020-05-14 16:18:01 +02:00
parent 39c141b4ae
commit b01c8a6cc8
3 changed files with 31 additions and 4 deletions

View File

@ -4294,6 +4294,25 @@ bool validate_comment_length(THD *thd, LEX_STRING *comment, size_t max_len,
Well_formed_prefix(system_charset_info, *comment, max_len).length();
if (tmp_len < comment->length)
{
#if MARIADB_VERSION_ID < 100500
if (comment->length <= max_len)
{
if (thd->is_strict_mode())
{
my_error(ER_INVALID_CHARACTER_STRING, MYF(0),
system_charset_info->csname, comment->str);
DBUG_RETURN(true);
}
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_INVALID_CHARACTER_STRING,
ER_THD(thd, ER_INVALID_CHARACTER_STRING),
system_charset_info->csname, comment->str);
comment->length= tmp_len;
DBUG_RETURN(false);
}
#else
#error do it in TEXT_STRING_sys
#endif
if (thd->is_strict_mode())
{
my_error(err_code, MYF(0), name, static_cast<ulong>(max_len));