summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-07-03 09:46:20 +0200
committerSergei Golubchik <sergii@pisem.net>2013-07-03 09:46:20 +0200
commit78cc6db44a9f1344dd5c00cf4f3cdde158fe108e (patch)
tree3f6ad0e92adf22f242be974da029d4194dec2cf2 /sql-common
parentcfae3065d7ed5b7c5aa35596933d9f234f221878 (diff)
downloadmariadb-git-78cc6db44a9f1344dd5c00cf4f3cdde158fe108e.tar.gz
MDEV-4667 DATE('string') incompability between mysql and mariadb
Cleanup: remove TIME_FUZZY_DATE. Introduce TIME_FUZZY_DATES which means "very fuzzy, the resulting value is only used for comparison. It can be invalid date, fine, as long as it can be compared". Updated many tests results (they're better now).
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/my_time.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 5ad037ab6c9..d3a968ec53f 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -83,7 +83,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] &&
@@ -115,7 +115,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
@@ -1324,7 +1324,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;