summaryrefslogtreecommitdiff
path: root/include/my_time.h
diff options
context:
space:
mode:
authormonty@mishka.local <>2004-09-28 20:08:00 +0300
committermonty@mishka.local <>2004-09-28 20:08:00 +0300
commitf2941380c4e69f55abc0f09c2e0091ea0cdf3c00 (patch)
tree7f0311baaca32e6242f23dcf0a89ed38e39c9ac0 /include/my_time.h
parent095f7e874087183fdc2fc914708b579175da95f3 (diff)
downloadmariadb-git-f2941380c4e69f55abc0f09c2e0091ea0cdf3c00.tar.gz
Strict mode & better warnings
Under strict mode MySQL will generate an error message if there was any conversion when assigning data to a field. Added checking of date/datetime fields. If strict mode, give error if we have not given value to field without a default value (for INSERT)
Diffstat (limited to 'include/my_time.h')
-rw-r--r--include/my_time.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/my_time.h b/include/my_time.h
index d4dbe459c3b..332b26a15eb 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -41,8 +41,13 @@ typedef long my_time_t;
#define YY_PART_YEAR 70
/* Flags to str_to_datetime */
-#define TIME_FUZZY_DATE 1
-#define TIME_DATETIME_ONLY 2
+#define TIME_FUZZY_DATE 1
+#define TIME_DATETIME_ONLY 2
+/* Must be same as MODE_NO_ZERO_IN_DATE */
+#define TIME_NO_ZERO_IN_DATE (65536L*2*2*2*2*2*2*2)
+/* Must be same as MODE_NO_ZERO_DATE */
+#define TIME_NO_ZERO_DATE (TIME_NO_ZERO_IN_DATE*2)
+#define TIME_INVALID_DATES (TIME_NO_ZERO_DATE*2)
enum enum_mysql_timestamp_type
str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
@@ -52,6 +57,7 @@ bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time,
int *was_cut);
long calc_daynr(uint year,uint month,uint day);
+uint calc_days_in_year(uint year);
void init_time(void);