Bug #4094 | STR_TO_DATE returns values for invalid dates | ||
---|---|---|---|
Submitted: | 10 Jun 2004 19:35 | Modified: | 25 Aug 2004 18:37 |
Reporter: | Ed Shelton | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 4.1.2 | OS: | Linux (Linux) |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
[10 Jun 2004 19:35]
Ed Shelton
[11 Jun 2004 16:53]
Dean Ellis
Regarding the returning of NULL, it currently returns NULL for illegal dates, which is subtly different than an invalid date (and is expected behavior for now) as you note. For the rest, verifying that the function description does imply a time component will be returned whether or not the format string includes a time component (ie: "returns a DATETIME value", and the second example), but against 4.1.3 a time component is only returned if the format string includes a time component as well. Either the function description needs to be updated or the function should match the description and return a DATETIME in all cases. Thank you for the report.
[13 Jun 2004 18:57]
Brian Aker
Paul, please update the documentation on this. Strict mode should return an error though.
[25 Aug 2004 18:37]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant product(s). Additional info: I updated the STR_TO_DATE() description with additional information about return type, and a pointer to the section that describes how dates are checked.