summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-09-23 20:22:30 +0200
committerSergei Golubchik <serg@mariadb.org>2017-09-23 20:22:30 +0200
commit1320ad5b9253256afe98e948d25ed0a423a1e6da (patch)
tree97369f9aa107f08568e1647c3c6cbfeaabf3feea /sql/field_conv.cc
parent88adfd0cea34b93b50d6cc1128df45bae2124bc2 (diff)
parentca3c8d9b58fdc267b7c4df1ce3afde5ec6599344 (diff)
downloadmariadb-git-1320ad5b9253256afe98e948d25ed0a423a1e6da.tar.gz
Merge branch '10.2' into bb-10.2-ext
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r--sql/field_conv.cc17
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() */