summaryrefslogtreecommitdiff
path: root/sql-common/my_time.c
diff options
context:
space:
mode:
authorunknown <ramil/ram@ramil.myoffice.izhnet.ru>2007-02-08 13:02:53 +0400
committerunknown <ramil/ram@ramil.myoffice.izhnet.ru>2007-02-08 13:02:53 +0400
commit442aca800fd8d64b88cef5cb57509d8abc56ae3d (patch)
tree1406c46c9d43dcd64d792a520a93cc8e49c45910 /sql-common/my_time.c
parentb081cccef7cfebbc24b3203b5f38578920dfa427 (diff)
parentcc2c4e265a721a7b4ff53907b57256b6c51f8df3 (diff)
downloadmariadb-git-442aca800fd8d64b88cef5cb57509d8abc56ae3d.tar.gz
Merge mysql.com:/home/ram/work/b25301/b25301.5.0
into mysql.com:/home/ram/work/b25301/b25301.5.1 mysql-test/t/strict.test: Auto merged sql-common/my_time.c: Auto merged mysql-test/r/date_formats.result: merging mysql-test/r/strict.result: merging mysql-test/r/type_datetime.result: merging
Diffstat (limited to 'sql-common/my_time.c')
-rw-r--r--sql-common/my_time.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index a26e38b2123..5943db7e0e3 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -85,8 +85,7 @@ my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date,
(!(flags & TIME_INVALID_DATES) &&
ltime->month && ltime->day > days_in_month[ltime->month-1] &&
(ltime->month != 2 || calc_days_in_year(ltime->year) != 366 ||
- ltime->day != 29)) ||
- (ltime->year == 0 && (ltime->month != 0 || ltime->day != 0)))
+ ltime->day != 29)))
{
*was_cut= 2;
return TRUE;
@@ -410,9 +409,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
if (number_of_fields < 3 ||
l_time->year > 9999 || l_time->month > 12 ||
l_time->day > 31 || l_time->hour > 23 ||
- l_time->minute > 59 || l_time->second > 59 ||
- (l_time->year == 0 && l_time->month == 0 && l_time->day == 0 &&
- (l_time->hour != 0 || l_time->minute != 0 || l_time->second != 0)))
+ l_time->minute > 59 || l_time->second > 59)
{
/* Only give warning for a zero date if there is some garbage after */
if (!not_zero_date) /* If zero date */