Bug #29898 | DATE() function returns inconsistent results | ||
---|---|---|---|
Submitted: | 19 Jul 2007 14:22 | Modified: | 24 Jul 2007 16:08 |
Reporter: | Rob Morris | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: General | Severity: | S2 (Serious) |
Version: | 5.0.42 and up | OS: | Any |
Assigned to: | Evgeny Potemkin | CPU Architecture: | Any |
Tags: | backport_050044SP1, regression |
[19 Jul 2007 14:22]
Rob Morris
[19 Jul 2007 15:08]
Hartmut Holzgraefe
works fine on 5.0.38, fails on 5.0.42 and 5.0.44, now attaching mysqltest test case and testing 5.0.40 ...
[19 Jul 2007 16:14]
Hartmut Holzgraefe
regression seem to have started with 5.0.42
[19 Jul 2007 16:15]
Hartmut Holzgraefe
mysqltest test case
Attachment: bug29899.tgz (application/x-gtar, text), 779 bytes.
[19 Jul 2007 20:10]
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/31202 ChangeSet@1.2539, 2007-07-20 00:06:35+04:00, evgen@moonbone.local +3 -0 Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag. The Item_date_typecast::val_int function doesn't reset null_value flag. This makes all values that follows the first null value to be treated as nulls and led to a wrong result. Now the Item_date_typecast::val_int function correctly sets the null_value flag for both null and non-null values.
[20 Jul 2007 17:59]
Evgeny Potemkin
This isn't a regression. Prior to 5.0.42 DATE values were compares as strings and this bug didn't occur. Current DATE/DATETIME comparator compares them as ints thus the bug manifested itself.
[20 Jul 2007 23:46]
Bugs System
Pushed into 5.1.21-beta
[20 Jul 2007 23:49]
Bugs System
Pushed into 5.0.48
[24 Jul 2007 11:13]
Sveta Smirnova
Bug #30002 was marked as duplicate of this one.
[24 Jul 2007 16:08]
Peter Lavin
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at http://dev.mysql.com/doc/en/installing-source.html Added to the changelogs for version 5.0 and 5.1.
[5 Mar 2008 19:27]
Sveta Smirnova
Bug #35083 was marked as duplicate of this one.
[27 Jun 2008 12:27]
a aste
Ran into this bug yesterday on a RHEL5 system running MySQL 5.0.45. SELECT * FROM table WHERE DATE(datetimefield) stopped returning results unexpectedly. The same query works fine on a second identical system (RHEL5, MySQL 5.0.45).