diff options
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r-- | sql/field_conv.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc index a744af76626..932188d56a8 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -417,6 +417,13 @@ void Field::do_field_decimal(Copy_field *copy) } +void Field::do_field_timestamp(Copy_field *copy) +{ + // XXX why couldn't we do it everywhere? + copy->from_field->save_in_field(copy->to_field); +} + + void Field::do_field_temporal(Copy_field *copy) { MYSQL_TIME ltime; @@ -706,6 +713,16 @@ void Copy_field::set(Field *to,Field *from,bool save) } +Field::Copy_func *Field_timestamp::get_copy_func(const Field *from) const +{ + Field::Copy_func *copy= Field_temporal::get_copy_func(from); + if (copy == do_field_temporal && from->type() == MYSQL_TYPE_TIMESTAMP) + return do_field_timestamp; + else + return copy; +} + + Field::Copy_func *Field_temporal::get_copy_func(const Field *from) const { /* If types are not 100 % identical then convert trough get_date() */ |