From 91f6d169a667721dabb398cefb56d687fb0e57e2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Oct 2007 11:46:48 +0200 Subject: Bug#30951: makedate returns different results depending on version of mysql makedate() will fold years below 100 into the 1970-2069 range. CS removes code that also wrongly folded years between 100 and 200 into that range, which should be left unchanged. Backport from 5.1. mysql-test/r/func_sapdb.result: Show that makedate() works correctly for 100 <= year < 200. mysql-test/t/func_sapdb.test: Show that makedate() works correctly for 100 <= year < 200. sql-common/my_time.c: Remove unnecessary date magic. Syncs behaviour with 5.1+ and manual. --- sql-common/my_time.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'sql-common/my_time.c') diff --git a/sql-common/my_time.c b/sql-common/my_time.c index f5d5828e024..3c08db6bf97 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -769,11 +769,6 @@ long calc_daynr(uint year,uint month,uint day) if (year == 0 && month == 0 && day == 0) DBUG_RETURN(0); /* Skip errors */ - if (year < 200) - { - if ((year=year+1900) < 1900+YY_PART_YEAR) - year+=100; - } delsum= (long) (365L * year+ 31*(month-1) +day); if (month <= 2) year--; -- cgit v1.2.1