Bug #30951 makedate returns different results depending on version of mysql
Submitted: 11 Sep 2007 11:11 Modified: 26 Oct 2007 2:31
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version: OS:Any
Assigned to: Tatiana Azundris Nuernberg
Tags: makedate

[11 Sep 2007 11:11] Shane Bester
Description:
This query output the following results:

query:  select makedate(100,1);

6.0.2-alpha-community-nt-debug: 0100-01-01
5.1.23-beta-debug:              0100-01-01
5.0.48-enterprise-gpl-debug:    2000-01-01

Is it a bug?  Which value is correct answer?  I couldn't find anywhere in the manual that describes this behaviour exactly.  I read:

http://dev.mysql.com/doc/refman/5.1/en/year.html
http://dev.mysql.com/doc/refman/5.1/en/upgrading-from-5-0.html
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_makedate

How to repeat:
select makedate(100,1);

Suggested fix:
maybe related to bug #18997 ?
[11 Sep 2007 11:38] Miguel Solorzano
Thank you for the bug report.
[11 Oct 2007 7:54] Tatiana Azundris Nuernberg
5.1+ behaviour is correct.
[11 Oct 2007 10:01] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/35333

ChangeSet@1.2531, 2007-10-11 11:32:18+02:00, tnurnberg@sin.intern.azundris.com +3 -0
  Bug#30951: makedate returns different results depending on version of mysql
  
  makedate() incorrectly moved year values in [100;200[ into 1970-2069 range.
[11 Oct 2007 15:57] Ingo Strüwing
Approved. I would like to have a slightly more verbose changeset comment though.
[11 Oct 2007 16:16] Tatiana Azundris Nuernberg
Doc-Team: since this is a backport from 5.1, makedate() behaviour is now
the same across versions five and up. (As is, to my knowledge, all
time/date behaviour(?).) Since it was decided not to change the behaviour
of 4.1, makedate() behaviour, like that of many other time/date functions,
is different in 4.1 from that in 5+.
[12 Oct 2007 10:31] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/35462

ChangeSet@1.2531, 2007-10-12 11:46:48+02:00, tnurnberg@sin.intern.azundris.com +3 -0
  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.
[15 Oct 2007 13:16] Tatiana Azundris Nuernberg
pushed to 5.0.52/maint on Fri 2007/10/12
[18 Oct 2007 21:35] Bugs System
Pushed into 5.1.23-beta
[18 Oct 2007 21:36] Bugs System
Pushed into 5.0.52
[26 Oct 2007 2:31] Paul Dubois
Noted in 5.0.52, 5.1.23 changelogs.

MAKEDATE() incorrectly moved year values in the 100-200 range into 
the 1970-2069 range. (This is legitimate for 00-99, but three-digit
years should be used unchanged.)