1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1

into  mysql.com:/usr/home/bar/mysql-4.1.num-conv
This commit is contained in:
bar@mysql.com
2005-07-14 10:46:15 +05:00
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)