summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-11-22 12:10:18 +0400
committerunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-11-22 12:10:18 +0400
commitb275e4f01989316fe2acdb9f85f1274e26393638 (patch)
treef78d55c9c33ec05f302440e8325d03b9747f7d66 /sql-common
parent00820e2b0aafe2d90b5ba8b56698ada25069af43 (diff)
parent2bd1c73e3db37b0dde4c7aed9a5ddff846fe610c (diff)
downloadmariadb-git-b275e4f01989316fe2acdb9f85f1274e26393638.tar.gz
Merge mysql.com:/usr/home/ram/work/bug21789/my41-bug21789
into mysql.com:/usr/home/ram/work/bug21789/my50-bug21789 mysql-test/r/date_formats.result: Auto merged sql-common/my_time.c: merging
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/my_time.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 93bf23ed284..18bed99412d 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -411,7 +411,9 @@ 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->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)))
{
/* Only give warning for a zero date if there is some garbage after */
if (!not_zero_date) /* If zero date */