From f8e924b467d099b5d99248c160a2aba59a6ea3ce Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 24 Jan 2012 13:00:13 +0400 Subject: BUG#13458237 - INCONSISTENT HANDLING OF INVALIDE DATES WITH ZERO DAY. SIMILAR TO '2009-10-00' - Reverting the patch for Bug # 12584302 The patch will be reverted in 5.1 and 5.5. The patch will not be reverted in 5.6, the change will be properly documented in 5.6. - Backporting DBUG_ASSERT not to crash on '0000-01-00' (already fixed in mysql-trunk (5.6)) --- sql-common/my_time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql-common') diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 0c90f14ae79..13ba691a090 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -785,7 +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_ASSERT(delsum+(int) y/4-temp >= 0); DBUG_RETURN(delsum+(int) y/4-temp); } /* calc_daynr */ -- cgit v1.2.1