summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2014-04-18 13:41:15 +0400
committerAlexander Barkov <bar@mnogosearch.org>2014-04-18 13:41:15 +0400
commit1c6d508a2b9dd1dfaeb68b3443212b57190950d8 (patch)
tree55284120225d0e51fbcc82abf411062b3e7bdfd9 /sql/field.cc
parentf7a47e137b18277db676c1e241d06664594208d1 (diff)
parent8db600f951005b0b23b23dcd0ddd848303aa13ac (diff)
downloadmariadb-git-1c6d508a2b9dd1dfaeb68b3443212b57190950d8.tar.gz
Merge from 5.3
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/field.cc b/sql/field.cc
index e9cd153ad75..998110fbed4 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -5058,6 +5058,13 @@ int Field_temporal::store_time_dec(MYSQL_TIME *ltime, uint dec)
int error = 0, have_smth_to_conv= 1;
MYSQL_TIME l_time= *ltime;
ErrConvTime str(ltime);
+
+ if (l_time.time_type == MYSQL_TIMESTAMP_TIME && time_to_datetime(&l_time))
+ {
+ have_smth_to_conv= 0;
+ error= 1;
+ goto store;
+ }
/*
We don't perform range checking here since values stored in TIME
structure always fit into DATETIME range.
@@ -5066,6 +5073,7 @@ int Field_temporal::store_time_dec(MYSQL_TIME *ltime, uint dec)
(current_thd->variables.sql_mode &
(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
MODE_INVALID_DATES)), &error);
+store:
return store_TIME_with_warning(&l_time, &str, error, have_smth_to_conv);
}