summaryrefslogtreecommitdiff
path: root/sql/time.cc
diff options
context:
space:
mode:
authorunknown <ingo@chilla.local>2006-07-06 15:38:47 +0200
committerunknown <ingo@chilla.local>2006-07-06 15:38:47 +0200
commit9532056d1351f0377db90738363f5b4bff176588 (patch)
tree1efd4d6be4cd94b4d675fcaf788d5c44f897a53b /sql/time.cc
parent4ceb9bb0901432d675003d8e306c020a54f880be (diff)
downloadmariadb-git-9532056d1351f0377db90738363f5b4bff176588.tar.gz
After merge fixes.
mysql-test/r/archive.result: After merge fix. It might come from the fix for bug 1662 (ALTER TABLE LIKE ignores DATA/INDEX DIRECTPORY) sql/time.cc: After merge fix. Auto resolve failed because this piece of code was moved from another file to here.
Diffstat (limited to 'sql/time.cc')
-rw-r--r--sql/time.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/time.cc b/sql/time.cc
index ae776a32aab..0461f7723c6 100644
--- a/sql/time.cc
+++ b/sql/time.cc
@@ -749,6 +749,7 @@ void make_truncated_value_warning(THD *thd, const char *str_val,
ER_TRUNCATED_WRONG_VALUE, warn_buff);
}
+/* Daynumber from year 0 to 9999-12-31 */
#define MAX_DAY_NUMBER 3652424L
bool date_add_interval(TIME *ltime, interval_type int_type, INTERVAL interval)
@@ -804,7 +805,7 @@ bool date_add_interval(TIME *ltime, interval_type int_type, INTERVAL interval)
ltime->hour= (uint) (sec/3600);
daynr= calc_daynr(ltime->year,ltime->month,1) + days;
/* Day number from year 0 to 9999-12-31 */
- if ((ulonglong) daynr >= MAX_DAY_NUMBER)
+ if ((ulonglong) daynr > MAX_DAY_NUMBER)
goto invalid_date;
get_date_from_daynr((long) daynr, &ltime->year, &ltime->month,
&ltime->day);
@@ -815,7 +816,7 @@ bool date_add_interval(TIME *ltime, interval_type int_type, INTERVAL interval)
period= (calc_daynr(ltime->year,ltime->month,ltime->day) +
sign * (long) interval.day);
/* Daynumber from year 0 to 9999-12-31 */
- if ((ulong) period >= MAX_DAY_NUMBER)
+ if ((ulong) period > MAX_DAY_NUMBER)
goto invalid_date;
get_date_from_daynr((long) period,&ltime->year,&ltime->month,&ltime->day);
break;