summaryrefslogtreecommitdiff
path: root/include/my_time.h
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-02-02 19:05:28 +0200
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-02-02 19:05:28 +0200
commitac3243c8c82077c34e99e8f7f9a83e5bc9fd7b66 (patch)
tree4635605ae0572f713774190b2fe771d0df3a1f96 /include/my_time.h
parent3473329d3b5e2fd339c184c2e7c75bb6b3bda3ad (diff)
parent59f68983ffee45616a8ec255b5f13535236dd0ea (diff)
downloadmariadb-git-ac3243c8c82077c34e99e8f7f9a83e5bc9fd7b66.tar.gz
merge to 5.1.
Diffstat (limited to 'include/my_time.h')
-rw-r--r--include/my_time.h13
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