diff options
Diffstat (limited to 'sql/sql_time.cc')
| -rw-r--r-- | sql/sql_time.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sql_time.cc b/sql/sql_time.cc index 753f78ccc22..6899654c28f 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -509,7 +509,14 @@ bool int_to_datetime_with_warn(THD *thd, const Longlong_hybrid &nr, my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, uint *error_code) { thd->used|= THD::TIME_ZONE_USED; - return thd->variables.time_zone->TIME_to_gmt_sec(t, error_code); + my_time_t ts= thd->variables.time_zone->TIME_to_gmt_sec(t, error_code); + if (*error_code == ER_WARN_DATA_OUT_OF_RANGE && ts == TIMESTAMP_MAX_VALUE) + { + ErrConvTime value(t); + thd->push_warning_truncated_wrong_value("timestamp", value.ptr()); + *error_code= 0; + } + return ts; } |
