summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <tsmith@maint1.mysql.com>2007-07-04 21:22:35 +0200
committerunknown <tsmith@maint1.mysql.com>2007-07-04 21:22:35 +0200
commit06a8615fb989c165bae6d8ed804c44e69c635d1e (patch)
treeb9486f8c30ebfa7de4e0cb336600162a6e18c593 /sql
parent9e451f519fc914b73f8d3382e65b45c752ee912f (diff)
parent5e0349cc1cf92524fe6bdf9ccc290f56a073591b (diff)
downloadmariadb-git-06a8615fb989c165bae6d8ed804c44e69c635d1e.tar.gz
Merge maint1.mysql.com:/data/localhome/tsmith/bk/41
into maint1.mysql.com:/data/localhome/tsmith/bk/maint/41
Diffstat (limited to 'sql')
-rw-r--r--sql/field_conv.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 59b550572c3..4a7935a4be7 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -311,6 +311,15 @@ static void do_field_string(Copy_field *copy)
}
+static void do_field_enum(Copy_field *copy)
+{
+ if (copy->from_field->val_int() == 0)
+ ((Field_enum *) copy->to_field)->store_type((ulonglong) 0);
+ else
+ do_field_string(copy);
+}
+
+
static void do_field_int(Copy_field *copy)
{
longlong value=copy->from_field->val_int();
@@ -538,7 +547,13 @@ void (*Copy_field::get_copy_func(Field *to,Field *from))(Copy_field*)
to->real_type() == FIELD_TYPE_SET)
{
if (!to->eq_def(from))
- return do_field_string;
+ {
+ if (from->real_type() == MYSQL_TYPE_ENUM &&
+ to->real_type() == MYSQL_TYPE_ENUM)
+ return do_field_enum;
+ else
+ return do_field_string;
+ }
}
else if (to->charset() != from->charset())
return do_field_string;