diff options
author | unknown <dlenev@mysql.com> | 2004-12-16 16:31:50 +0300 |
---|---|---|
committer | unknown <dlenev@mysql.com> | 2004-12-16 16:31:50 +0300 |
commit | 2fb340b5209dda8f71f372fed17d65a0c5814821 (patch) | |
tree | 22957f403d1fae90ad99eced072996def0ae1104 /sql | |
parent | f40f838f50bda025cacd0529e1ec41bb4f1e5579 (diff) | |
download | mariadb-git-2fb340b5209dda8f71f372fed17d65a0c5814821.tar.gz |
Fix for bug #7297 "Two digit year should be interpreted correctly
even with zero month and day" aka "Date decoding trouble"
Two digit year should be interpreted correctly as year in 20th or 21st
century even with zero month and day. Only exception should be zero date
'00-00-00' or '00-00-00 00:00:00'.
mysql-test/r/type_datetime.result:
Added test for bug #7297 "Two digit year should be interpreted correctly
even with zero month and day"
mysql-test/t/type_datetime.test:
Added test for bug #7297 "Two digit year should be interpreted correctly
even with zero month and day"
sql/time.cc:
str_to_TIME(): Two digit year should be interpreted correctly as year
in 20th or 21st century even with zero month and day. Only exception
should be zero date '00-00-00' or '00-00-00 00:00:00'.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/time.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/time.cc b/sql/time.cc index 38670db054f..d8b4b80e351 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -410,7 +410,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date) else date[6]=0; - if (year_length == 2 && i >=2 && (date[1] || date[2])) + if (year_length == 2 && not_zero_date) date[0]+= (date[0] < YY_PART_YEAR ? 2000 : 1900); number_of_fields=i; while (i < 6) |