diff options
author | Alexander Barkov <bar@mariadb.org> | 2014-06-04 20:32:57 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2014-06-04 20:32:57 +0400 |
commit | 661daf16f11ffa879ffb005008b6e73f6744e0ad (patch) | |
tree | c0f1facac5d17e590dc2aa12353d2f513c007bdf /include/my_time.h | |
parent | a1975dd2c106180ab16836631e6797cff5b4e396 (diff) | |
download | mariadb-git-661daf16f11ffa879ffb005008b6e73f6744e0ad.tar.gz |
MDEV-4858 Wrong results for a huge unsigned value inserted into a TIME column
MDEV-6099 Bad results for DATE_ADD(.., INTERVAL 2000000000000000000.0 SECOND)
MDEV-6097 Inconsistent results for CAST(int,decimal,double AS DATETIME)
MDEV-6100 No warning on CAST(9000000 AS TIME)
Diffstat (limited to 'include/my_time.h')
-rw-r--r-- | include/my_time.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/my_time.h b/include/my_time.h index 4d8ea0c2eda..f3fd1f1b638 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -82,6 +82,13 @@ typedef long my_time_t; #define MYSQL_TIME_WARN_TRUNCATED 1 #define MYSQL_TIME_WARN_OUT_OF_RANGE 2 +#define MYSQL_TIME_NOTE_TRUNCATED 16 + +#define MYSQL_TIME_WARN_WARNINGS (MYSQL_TIME_WARN_TRUNCATED|MYSQL_TIME_WARN_OUT_OF_RANGE) +#define MYSQL_TIME_WARN_NOTES (MYSQL_TIME_NOTE_TRUNCATED) + +#define MYSQL_TIME_WARN_HAVE_WARNINGS(x) MY_TEST((x) & MYSQL_TIME_WARN_WARNINGS) +#define MYSQL_TIME_WARN_HAVE_NOTES(x) MY_TEST((x) & MYSQL_TIME_WARN_NOTES) /* Limits for the TIME data type */ #define TIME_MAX_HOUR 838 @@ -115,7 +122,7 @@ longlong double_to_datetime(double nr, MYSQL_TIME *ltime, uint flags, int *cut) ltime, flags, cut); } -int number_to_time(my_bool neg, longlong nr, ulong sec_part, +int number_to_time(my_bool neg, ulonglong nr, ulong sec_part, MYSQL_TIME *ltime, int *was_cut); ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *); ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *); |