summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorramil/ram@myoffice.izhnet.ru <>2006-11-22 12:13:09 +0400
committerramil/ram@myoffice.izhnet.ru <>2006-11-22 12:13:09 +0400
commitd40abd87384392a1a4a52f0b34f3cd6caf07396a (patch)
treef00a12589d0ab6cf45d552e9ab048c10defb1615 /sql-common
parent7a23b1baf7f96a060b2ee6226644b058aa819b5d (diff)
parentb11dba2f0bebf46e11d8d63b4f440f06a800afee (diff)
downloadmariadb-git-d40abd87384392a1a4a52f0b34f3cd6caf07396a.tar.gz
Merge mysql.com:/usr/home/ram/work/bug21789/my50-bug21789
into mysql.com:/usr/home/ram/work/bug21789/my51-bug21789
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 b4cfe041529..868b1b2172d 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 */