diff options
Diffstat (limited to 'sql/sql_time.cc')
-rw-r--r-- | sql/sql_time.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/sql_time.cc b/sql/sql_time.cc index b194d46643e..5ef7b2c7c34 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -230,6 +230,20 @@ check_date_with_warn(const MYSQL_TIME *ltime, ulonglong fuzzy_date, } +bool +adjust_time_range_with_warn(MYSQL_TIME *ltime, uint dec) +{ + MYSQL_TIME copy= *ltime; + ErrConvTime str(©); + int warnings= 0; + if (check_time_range(ltime, dec, &warnings)) + return true; + if (warnings) + make_truncated_value_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, + &str, MYSQL_TIMESTAMP_TIME, NullS); + return false; +} + /* Convert a string to 8-bit representation, for use in str_to_time/str_to_date/str_to_date. |