diff options
author | igor@olga.mysql.com <> | 2007-06-30 16:24:09 -0700 |
---|---|---|
committer | igor@olga.mysql.com <> | 2007-06-30 16:24:09 -0700 |
commit | 38deea24964e1acf0920f8dee1a4442531d3ed80 (patch) | |
tree | 5c5791f99f377362ada084e6a977b0dd39f605c0 /sql/field_conv.cc | |
parent | 3b8b31b0be33dce4a7a2f8085a2fd959da45ad89 (diff) | |
parent | f8bf427ba41df2aa4b19667e7b8c2d64a85b6074 (diff) | |
download | mariadb-git-38deea24964e1acf0920f8dee1a4442531d3ed80.tar.gz |
Merge olga.mysql.com:/home/igor/mysql-4.1-opt
into olga.mysql.com:/home/igor/mysql-5.0-opt
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r-- | sql/field_conv.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 410db357510..a286255ec23 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -307,6 +307,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_varbinary_pre50(Copy_field *copy) { char buff[MAX_FIELD_WIDTH]; @@ -662,7 +671,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; |