1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +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:
bar@mysql.com
2005-07-13 13:00:17 +05:00
parent ff764e2b5a
commit 5150fdcc04
5 changed files with 66 additions and 4 deletions

View File

@ -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)