Bug #28208 | Comparison of curdate() or now() with string sometimes fails | ||
---|---|---|---|
Submitted: | 2 May 2007 22:07 | Modified: | 12 Jun 2007 14:45 |
Reporter: | Pete Harlan (Candidate Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S2 (Serious) |
Version: | 5.0.42-bk, 5.1 | OS: | Linux (Debian Etch x86_64) |
Assigned to: | Evgeny Potemkin | CPU Architecture: | Any |
Tags: | regression |
[2 May 2007 22:07]
Pete Harlan
[3 May 2007 6:38]
Sveta Smirnova
Thank you for the report. Verified as described.
[15 May 2007 19:40]
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/26734 ChangeSet@1.2487, 2007-05-15 23:37:18+04:00, evgen@moonbone.local +3 -0 Bug#28208: Wrong result of a non-const STRING function with a const DATETIME function. A wrong condition was used to check that the Arg_comparator::can_compare_as_dates() function calculated the value of the string constant. When comparing a non-const STRING function with a constant DATETIME function it leads to saving an arbitrary value as a cached value of the DATETIME function. Now the Arg_comparator::set_cmp_func() funcion initializes the const_value variable to the impossible DATETIME value (-1) and this const_value is cached only if it was changed by the Arg_comparator::can_compare_as_dates() function.
[15 May 2007 20:32]
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/26737 ChangeSet@1.2487, 2007-05-16 00:30:12+04:00, evgen@moonbone.local +3 -0 Bug#28208: Wrong result of a non-const STRING function with a const DATETIME function. A wrong condition was used to check that the Arg_comparator::can_compare_as_dates() function calculated the value of the string constant. When comparing a non-const STRING function with a constant DATETIME function it leads to saving an arbitrary value as a cached value of the DATETIME function. Now the Arg_comparator::set_cmp_func() function initializes the const_value variable to the impossible DATETIME value (-1) and this const_value is cached only if it was changed by the Arg_comparator::can_compare_as_dates() function.
[20 May 2007 17:11]
Bugs System
Pushed into 5.0.44
[20 May 2007 17:12]
Bugs System
Pushed into 5.1.19-beta
[12 Jun 2007 14:45]
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 Noted in changelogs 5.0.44 and 5.1.19-beta.