From fab56c1f243aa02b04e8d3d87104cc4a54db90a2 Mon Sep 17 00:00:00 2001 From: "ramil/ram@mysql.com/ramil.myoffice.izhnet.ru" <> Date: Thu, 8 Feb 2007 11:56:18 +0400 Subject: Fix for bug #25301: Non-zero dates with year 0000 are invalid The 0000 year is valid. The ISO standard for "Representation of dates and times" says: "Calendar years are numbered in ascending order according to the Gregorian calendar by values in the range [0000] to [9999]." Reverted fix for 21789: DATETIME with 0000-00-00 11:22:33 should be invalid, but is accepted as it's not a bug. Fix for 19370: DateTime datatype in MySQL has two bugs in it will be reverted during 4.1 -> 5.0 merging as it was pushed to the 5.0 tree. --- sql-common/my_time.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sql-common/my_time.c') diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 2d3d71e646c..0d8ad167ff5 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -350,10 +350,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, l_time->year > 9999 || l_time->month > 12 || l_time->day > 31 || l_time->hour > 23 || l_time->minute > 59 || l_time->second > 59 || - (!(flags & TIME_FUZZY_DATE) && - (l_time->month == 0 || l_time->day == 0)) || - (l_time->year == 0 && l_time->month == 0 && l_time->day == 0 && - (l_time->hour != 0 || l_time->minute != 0 || l_time->second != 0))) + (!(flags & TIME_FUZZY_DATE) && (l_time->month == 0 || l_time->day == 0))) { /* Only give warning for a zero date if there is some garbage after */ if (!not_zero_date) /* If zero date */ -- cgit v1.2.1