mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge 10.3 into 10.4
This commit is contained in:
@ -4402,6 +4402,25 @@ bool validate_comment_length(THD *thd, LEX_CSTRING *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));
|
||||
@ -7910,16 +7929,13 @@ blob_length_by_type(enum_field_types type)
|
||||
}
|
||||
|
||||
|
||||
static void append_drop_column(THD *thd, bool dont, String *str,
|
||||
Field *field)
|
||||
static inline
|
||||
void append_drop_column(THD *thd, String *str, Field *field)
|
||||
{
|
||||
if (!dont)
|
||||
{
|
||||
if (str->length())
|
||||
str->append(STRING_WITH_LEN(", "));
|
||||
str->append(STRING_WITH_LEN("DROP COLUMN "));
|
||||
append_identifier(thd, str, &field->field_name);
|
||||
}
|
||||
if (str->length())
|
||||
str->append(STRING_WITH_LEN(", "));
|
||||
str->append(STRING_WITH_LEN("DROP COLUMN "));
|
||||
append_identifier(thd, str, &field->field_name);
|
||||
}
|
||||
|
||||
|
||||
@ -8175,7 +8191,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
||||
field->invisible < INVISIBLE_SYSTEM)
|
||||
{
|
||||
StringBuffer<NAME_LEN*3> tmp;
|
||||
append_drop_column(thd, false, &tmp, field);
|
||||
append_drop_column(thd, &tmp, field);
|
||||
my_error(ER_MISSING, MYF(0), table->s->table_name.str, tmp.c_ptr());
|
||||
goto err;
|
||||
}
|
||||
@ -8228,10 +8244,10 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
||||
!vers_system_invisible)
|
||||
{
|
||||
StringBuffer<NAME_LEN*3> tmp;
|
||||
append_drop_column(thd, dropped_sys_vers_fields & VERS_SYS_START_FLAG,
|
||||
&tmp, table->vers_start_field());
|
||||
append_drop_column(thd, dropped_sys_vers_fields & VERS_SYS_END_FLAG,
|
||||
&tmp, table->vers_end_field());
|
||||
if (!(dropped_sys_vers_fields & VERS_SYS_START_FLAG))
|
||||
append_drop_column(thd, &tmp, table->vers_start_field());
|
||||
if (!(dropped_sys_vers_fields & VERS_SYS_END_FLAG))
|
||||
append_drop_column(thd, &tmp, table->vers_end_field());
|
||||
my_error(ER_MISSING, MYF(0), table->s->table_name.str, tmp.c_ptr());
|
||||
goto err;
|
||||
}
|
||||
|
Reference in New Issue
Block a user