mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
ctype_utf8.result:
adding test case
sql_table.cc:
sql_table.cc:
- do not create a new item when charsets are the same
- return ER_INVALID_DEFAULT if default value cannot
be converted into the column character set.
item.cc:
- Allow conversion not only to Unicode,
but also to and from "binary".
- Adding safe_charset_converter() for Item_num
and Item_varbinary, returning a fixed const Item.
This commit is contained in:
@@ -557,10 +557,15 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
Convert the default value from client character
|
||||
set into the column character set if necessary.
|
||||
*/
|
||||
if (sql_field->def)
|
||||
if (sql_field->def && cs != sql_field->def->collation.collation)
|
||||
{
|
||||
sql_field->def=
|
||||
sql_field->def->safe_charset_converter(cs);
|
||||
if (!(sql_field->def=
|
||||
sql_field->def->safe_charset_converter(cs)))
|
||||
{
|
||||
/* Could not convert */
|
||||
my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
}
|
||||
|
||||
if (sql_field->sql_type == FIELD_TYPE_SET)
|
||||
|
||||
Reference in New Issue
Block a user