Bug #23656 NOW() and CURDATE() doesn't convert correctly when used by CAST() function
| Submitted: | 26 Oct 2006 5:43 | Modified: | 10 May 2007 17:48 |
|---|---|---|---|
| Reporter: | Tobias Asplund | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Data Types | Severity: | S3 (Non-critical) |
| Version: | 5.0.24, 4.1 BK, 5.1 BK | OS: | Linux (Linux, Max OS X) |
| Assigned to: | Evgeny Potemkin | CPU Architecture: | Any |
[26 Oct 2006 5:43]
Tobias Asplund
[26 Oct 2006 7:36]
Sveta Smirnova
Thank you for the report. Verified as described on Linux using last BK sources.
[26 Oct 2006 7:38]
Sveta Smirnova
There is Bug #23093 with mirror-like problem.
[26 Oct 2006 7:57]
Sveta Smirnova
4.1 and 5.1 versions are affected too
[3 May 2007 20:12]
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/26052 ChangeSet@1.2470, 2007-05-04 00:10:22+04:00, evgen@moonbone.local +3 -0 Bug#23656: Wrong conversion result of a DATETIME to integer using CAST function. The generic string to int conversion was used by the Item_func_signed and the Item_func_unsigned classes to convert DATE/DATETIME values to the SIGNED/UNSIGNED type. But this conversion produces wrong results for such values. Now if the item which result has to be converted can return its result as longlong then the item->val_int() method is used to allow the item to carry out the conversion itself and return the correct result. This condition is checked in the Item_func_signed::val_int() and the Item_func_unsigned::val_int() functions.
[3 May 2007 20:56]
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/26053 ChangeSet@1.2652, 2007-05-04 00:53:37+04:00, evgen@moonbone.local +3 -0 Bug#23656: Wrong conversion result of a DATETIME to integer using CAST function. The generic string to int conversion was used by the Item_func_signed and the Item_func_unsigned classes to convert DATE/DATETIME values to the SIGNED/UNSIGNED type. But this conversion produces wrong results for such values. Now if the item which result has to be converted can return its result as longlong then the item->val_int() method is used to allow the item to carry out the conversion itself and return the correct result. This condition is checked in the Item_func_signed::val_int() and the Item_func_unsigned::val_int() functions.
[7 May 2007 18:15]
Bugs System
Pushed into 5.1.18-beta
[8 May 2007 1:32]
Paul DuBois
Noted in 5.1.18 changelog. Using CAST() to convert DATETIME values to numeric values did not work. Setting to Patch Queued pending push into 5.0.x (and 4.1.x?).
[10 May 2007 6:44]
Bugs System
Pushed into 4.1.23
[10 May 2007 6:52]
Bugs System
Pushed into 5.0.42
[10 May 2007 17:48]
Paul DuBois
Noted in 5.0.42, 4.1.23 changelogs.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.062 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.