Bug #31990 | MINUTE() and SECOND() return bogus results when used on a DATE | ||
---|---|---|---|
Submitted: | 31 Oct 2007 15:16 | Modified: | 11 Jan 2008 15:57 |
Reporter: | Edam | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0, 5.1 | OS: | Linux |
Assigned to: | Tatiana Azundris Nuernberg | CPU Architecture: | Any |
Tags: | date, minute, second |
[31 Oct 2007 15:16]
Edam
[1 Nov 2007 10:07]
Hartmut Holzgraefe
Verified, same on 5.1, too. IMHO HOUR(), MINUTE(), SECOND() on DATE values should return NULL ...
[8 Nov 2007 5:08]
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/37305 ChangeSet@1.2557, 2007-11-08 06:08:44+01:00, tnurnberg@mysql.com +4 -0 Bug#31990: MINUTE() and SECOND() return bogus results when used on a DATE HOUR(), MINUTE(), ... returned spurious results when used on a DATE-cast. This happened because DATE-cast object did not overload get_time() method in superclass Item. The default method was inappropriate here and misinterpreted the data. Patch adds missing method; get_time() on DATE-casts now returns SQL-NULL on NULL input, 0 otherwise. This coincides with the way DATE-columns behave.
[10 Nov 2007 12:05]
Tatiana Azundris Nuernberg
pushed to 5.0.52, 5.1.23 in opt
[16 Nov 2007 9:31]
Bugs System
Pushed into 5.0.52
[16 Nov 2007 9:33]
Bugs System
Pushed into 5.1.23-rc
[16 Nov 2007 9:35]
Bugs System
Pushed into 6.0.4-alpha
[11 Dec 2007 9:13]
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/39692 ChangeSet@1.2560, 2007-12-11 10:12:05+01:00, tnurnberg@mysql.com +8 -0 Bug#31990: MINUTE() and SECOND() return bogus results when used on a DATE HOUR(), MINUTE(), ... returned spurious results when used on a DATE-cast. This happened because DATE-cast object did not overload get_time() method in superclass Item. The default method was inappropriate here and misinterpreted the data. Patch adds missing method; get_time() on DATE-casts now returns SQL-NULL on NULL input, 0 otherwise. This coincides with the way DATE-columns behave. Also fixes similar bug in Date-Field now.
[20 Dec 2007 7:16]
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/40250 ChangeSet@1.2674, 2007-12-20 08:15:34+01:00, tnurnberg@mysql.com +1 -0 Bug#31990: MINUTE() and SECOND() return bogus results when used on a DATE post-merge fixes
[28 Dec 2007 12:27]
Tatiana Azundris Nuernberg
pushed on 12/20 to 5.0.54-opt, 5.1.23-opt, 6.0.5-opt
[11 Jan 2008 12:18]
Bugs System
Pushed into 6.0.5-alpha
[11 Jan 2008 12:21]
Bugs System
Pushed into 5.1.23-rc
[11 Jan 2008 12:22]
Bugs System
Pushed into 5.0.56
[11 Jan 2008 15:57]
Paul DuBois
Noted in 5.0.56, 5.1.23, 6.0.5 changelogs. HOUR(), MINUTE(), and SECOND() could return non-zero values for DATE arguments.