summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2005-07-14 10:46:15 +0500
committerunknown <bar@mysql.com>2005-07-14 10:46:15 +0500
commitc2192cd1a161dc8573d4b387e89b825ef7eaf1de (patch)
tree5c176739b0f73dfb0d35397879e6434dac085fc5 /sql/sql_table.cc
parentc577521007c728e77aa6ff337387a56f12e3eb58 (diff)
parente97882849946a458ffc77d3a57bd002277fb9f04 (diff)
downloadmariadb-git-c2192cd1a161dc8573d4b387e89b825ef7eaf1de.tar.gz
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/usr/home/bar/mysql-4.1.num-conv mysql-test/r/ctype_utf8.result: Auto merged mysql-test/t/ctype_utf8.test: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/sql_table.cc: Auto merged
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index d4dcfdd6759..204a8df6e9a 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -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)