summaryrefslogtreecommitdiff
path: root/include/my_time.h
diff options
context:
space:
mode:
authorkaa@polly.local <>2006-10-11 14:16:30 +0400
committerkaa@polly.local <>2006-10-11 14:16:30 +0400
commit02ac635027a89b59e537d1c893a634a15efcb888 (patch)
treeede2b70c4281feecf1c13c6253569bac4ec72722 /include/my_time.h
parentb4908ed35d04e291cbfe800bab79b3088a926b04 (diff)
parent609a3cd2953458626065e1f0b288c1dc5bd3e877 (diff)
downloadmariadb-git-02ac635027a89b59e537d1c893a634a15efcb888.tar.gz
Merge polly.local:/tmp/maint/bug11655/my41-bug11655
into polly.local:/tmp/maint/bug11655/my50-bug11655
Diffstat (limited to 'include/my_time.h')
-rw-r--r--include/my_time.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/my_time.h b/include/my_time.h
index e52ef69475d..adce58b08d7 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -49,6 +49,16 @@ typedef long my_time_t;
#define TIME_NO_ZERO_DATE (TIME_NO_ZERO_IN_DATE*2)
#define TIME_INVALID_DATES (TIME_NO_ZERO_DATE*2)
+#define MYSQL_TIME_WARN_TRUNCATED 1
+#define MYSQL_TIME_WARN_OUT_OF_RANGE 2
+
+/* Limits for the TIME data type */
+#define TIME_MAX_HOUR 838
+#define TIME_MAX_MINUTE 59
+#define TIME_MAX_SECOND 59
+#define TIME_MAX_VALUE (TIME_MAX_HOUR*10000 + TIME_MAX_MINUTE*100 + \
+ TIME_MAX_SECOND)
+
enum enum_mysql_timestamp_type
str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
uint flags, int *was_cut);
@@ -61,7 +71,9 @@ ulonglong TIME_to_ulonglong(const MYSQL_TIME *time);
my_bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time,
- int *was_cut);
+ int *warning);
+
+int check_time_range(struct st_mysql_time *time, int *warning);
long calc_daynr(uint year,uint month,uint day);
uint calc_days_in_year(uint year);