diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-02-02 19:05:28 +0200 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-02-02 19:05:28 +0200 |
commit | 72ae1d65dd62f1e2cc308549a84a46feadd158f4 (patch) | |
tree | 4635605ae0572f713774190b2fe771d0df3a1f96 /include/my_time.h | |
parent | e805a0fd9de24cf1a9a6fb7bd10a336dbcd46fe9 (diff) | |
parent | a70c34bf0f34703fd330f8cb828e48b303c5296a (diff) | |
download | mariadb-git-72ae1d65dd62f1e2cc308549a84a46feadd158f4.tar.gz |
merge to 5.1.
Diffstat (limited to 'include/my_time.h')
-rw-r--r-- | include/my_time.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/my_time.h b/include/my_time.h index 58995f1bf62..0bbb83b78b7 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -52,6 +52,19 @@ typedef long my_time_t; /* two-digit years < this are 20..; >= this are 19.. */ #define YY_PART_YEAR 70 +/* + check for valid times only if the range of time_t is greater than + the range of my_time_t +*/ +#if SIZEOF_TIME_T > 4 || defined(TIME_T_UNSIGNED) +# define IS_TIME_T_VALID_FOR_TIMESTAMP(x) \ + ((x) <= TIMESTAMP_MAX_VALUE && \ + (x) >= TIMESTAMP_MIN_VALUE) +#else +# define IS_TIME_T_VALID_FOR_TIMESTAMP(x) \ + ((x) >= TIMESTAMP_MIN_VALUE) +#endif + /* Flags to str_to_datetime */ #define TIME_FUZZY_DATE 1 #define TIME_DATETIME_ONLY 2 |