diff options
author | Alexander Barkov <bar@mariadb.org> | 2013-07-08 16:49:42 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2013-07-08 16:49:42 +0400 |
commit | 1f3ec9800c6c186949302ba27f0137dfe7c0f5f5 (patch) | |
tree | e0e46189e0c73712d39954f0280c63830fd5332e /sql-common/my_time.c | |
parent | 874bb251372d60243d44e2ba74f0237bc88ec8c2 (diff) | |
parent | 78cc6db44a9f1344dd5c00cf4f3cdde158fe108e (diff) | |
download | mariadb-git-1f3ec9800c6c186949302ba27f0137dfe7c0f5f5.tar.gz |
Merging from 5.3
modified:
include/my_time.h
libmysql/libmysql.c
mysql-test/r/adddate_454.result
mysql-test/r/cast.result
mysql-test/r/date_formats.result
mysql-test/r/func_sapdb.result
mysql-test/r/func_time.result
mysql-test/r/mdev316.result
mysql-test/r/parser.result
mysql-test/r/partition_datatype.result
mysql-test/r/partition_pruning.result
mysql-test/r/type_date.result
mysql-test/r/type_datetime.result
mysql-test/suite/vcol/r/vcol_misc.result
mysql-test/t/cast.test
sql-common/my_time.c
sql/field.cc
sql/field_conv.cc
sql/filesort.cc
sql/item.cc
sql/item.h
sql/item_cmpfunc.cc
sql/item_func.cc
sql/item_strfunc.cc
sql/item_timefunc.cc
sql/sql_time.cc
pending merges:
Sergei Golubchik 2013-07-03 MDEV-4667 DATE('string') incompability betwe...
Diffstat (limited to 'sql-common/my_time.c')
-rw-r--r-- | sql-common/my_time.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c index df75bb49c89..69cd9458135 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -82,7 +82,7 @@ my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, { if (not_zero_date) { - if ((((flags & TIME_NO_ZERO_IN_DATE) || !(flags & TIME_FUZZY_DATE)) && + if (((flags & TIME_NO_ZERO_IN_DATE) && (ltime->month == 0 || ltime->day == 0)) || ltime->neg || (!(flags & TIME_INVALID_DATES) && ltime->month && ltime->day > days_in_month[ltime->month-1] && @@ -114,7 +114,7 @@ my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, length Length of string l_time Date is stored here flags Bitmap of following items - TIME_FUZZY_DATE Set if we should allow partial dates + TIME_FUZZY_DATE TIME_DATETIME_ONLY Set if we only allow full datetimes. TIME_NO_ZERO_IN_DATE Don't allow partial dates TIME_NO_ZERO_DATE Don't allow 0000-00-00 date @@ -1242,12 +1242,7 @@ longlong number_to_datetime(longlong nr, ulong sec_part, MYSQL_TIME *time_res, nr= (nr+19000000L)*1000000L; /* YYMMDD, year: 1970-1999 */ goto ok; } - /* - Though officially we support DATE values from 1000-01-01 only, one can - easily insert a value like 1-1-1. So, for consistency reasons such dates - are allowed when TIME_FUZZY_DATE is set. - */ - if (nr < 10000101L && !(flags & TIME_FUZZY_DATE)) + if (nr < 10000101L) goto err; if (nr <= 99991231L) { @@ -1326,7 +1321,7 @@ int number_to_time(my_bool neg, longlong nr, ulong sec_part, if (nr > 9999999 && neg == 0) { if (number_to_datetime(nr, sec_part, ltime, - TIME_FUZZY_DATE | TIME_INVALID_DATES, was_cut) < 0) + TIME_INVALID_DATES, was_cut) < 0) return -1; ltime->year= ltime->month= ltime->day= 0; |