diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-02-02 20:13:28 +0200 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-02-02 20:13:28 +0200 |
commit | fe145b0900d8006310232e2edb4137c04c116702 (patch) | |
tree | 12d9c3f5bea6c6481050211f64ad22118d925c93 /include/my_time.h | |
parent | d98270e1a39c5c9d40b9d3fbca7d8a3ebeb92ccc (diff) | |
parent | 72ae1d65dd62f1e2cc308549a84a46feadd158f4 (diff) | |
download | mariadb-git-fe145b0900d8006310232e2edb4137c04c116702.tar.gz |
merge
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 fdfe130c45f..68f9c2e739f 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -50,6 +50,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 |