diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-11-23 19:04:42 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-11-26 08:10:47 +0400 |
commit | 4447a02cf13a49876001a40ca7db8fdedb731fd5 (patch) | |
tree | 1ccf39024e26a1efa68237e5d44a2296a990441d /sql/sql_time.h | |
parent | 27f3329ff6cb755b600d536347669bef1a7d98b5 (diff) | |
download | mariadb-git-4447a02cf13a49876001a40ca7db8fdedb731fd5.tar.gz |
MDEV-16991 Rounding vs truncation for TIME, DATETIME, TIMESTAMPbb-10.4-mdev16991
Diffstat (limited to 'sql/sql_time.h')
-rw-r--r-- | sql/sql_time.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sql/sql_time.h b/sql/sql_time.h index 433374e2e9a..cfbff205667 100644 --- a/sql/sql_time.h +++ b/sql/sql_time.h @@ -57,7 +57,7 @@ bool int_to_datetime_with_warn(THD *thd, const Longlong_hybrid &nr, bool time_to_datetime(THD *thd, const MYSQL_TIME *tm, MYSQL_TIME *dt); bool time_to_datetime_with_warn(THD *thd, const MYSQL_TIME *tm, MYSQL_TIME *dt, - date_mode_t fuzzydate); + date_conv_mode_t fuzzydate); inline void datetime_to_date(MYSQL_TIME *ltime) { @@ -166,13 +166,20 @@ non_zero_date(const MYSQL_TIME *ltime) non_zero_hhmmssuu(ltime)); } static inline bool -check_date(const MYSQL_TIME *ltime, date_mode_t flags, int *was_cut) +check_date(const MYSQL_TIME *ltime, date_conv_mode_t flags, int *was_cut) { return check_date(ltime, non_zero_date(ltime), ulonglong(flags & TIME_MODE_FOR_XXX_TO_DATE), was_cut); } -bool check_date_with_warn(THD *thd, const MYSQL_TIME *ltime, date_mode_t fuzzy_date, - timestamp_type ts_type); +bool check_date_with_warn(THD *thd, const MYSQL_TIME *ltime, + date_conv_mode_t fuzzy_date, timestamp_type ts_type); +static inline bool +check_date_with_warn(THD *thd, const MYSQL_TIME *ltime, + date_mode_t fuzzydate, timestamp_type ts_type) +{ + return check_date_with_warn(thd, ltime, date_conv_mode_t(fuzzydate), ts_type); +} + bool adjust_time_range_with_warn(THD *thd, MYSQL_TIME *ltime, uint dec); longlong pack_time(const MYSQL_TIME *my_time); |