1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge mysql.com:/usr/home/bar/mysql-4.1.num-conv

into  mysql.com:/usr/home/bar/mysql-5.0
This commit is contained in:
bar@mysql.com
2005-07-14 16:11:55 +05:00
5 changed files with 66 additions and 4 deletions

View File

@ -752,10 +752,15 @@ static 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)