summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorKent Boortz <kent.boortz@oracle.com>2011-07-03 17:47:37 +0200
committerKent Boortz <kent.boortz@oracle.com>2011-07-03 17:47:37 +0200
commitb6e6097c95eee4f453c117c298ee6a03fdcd499d (patch)
tree448d397ed328f719a29a8fbbd54df8d943ed7274 /sql-common
parent1400d7a2cc33fd158efcb3bd638c4ee4c8762207 (diff)
parent8e14d52610d747977bcbe2875cbe7d93724d8143 (diff)
downloadmariadb-git-b6e6097c95eee4f453c117c298ee6a03fdcd499d.tar.gz
Updated/added copyright headers
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/my_time.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index da9b06facf8..0c90f14ae79 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -774,7 +774,7 @@ long calc_daynr(uint year,uint month,uint day)
int y= year; /* may be < 0 temporarily */
DBUG_ENTER("calc_daynr");
- if (y == 0 && month == 0 && day == 0)
+ if (y == 0 && month == 0)
DBUG_RETURN(0); /* Skip errors */
/* Cast to int to be able to handle month == 0 */
delsum= (long) (365 * y + 31 *((int) month - 1) + (int) day);
@@ -785,6 +785,7 @@ long calc_daynr(uint year,uint month,uint day)
temp=(int) ((y/100+1)*3)/4;
DBUG_PRINT("exit",("year: %d month: %d day: %d -> daynr: %ld",
y+(month <= 2),month,day,delsum+y/4-temp));
+ DBUG_ASSERT(delsum+(int) y/4-temp > 0);
DBUG_RETURN(delsum+(int) y/4-temp);
} /* calc_daynr */