| Bug #71562 | CAST should give warning for invalid date | ||
|---|---|---|---|
| Submitted: | 3 Feb 2014 10:17 | Modified: | 3 Feb 2014 11:36 |
| Reporter: | Daniël van Eeden (OCA) | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
| Version: | OS: | Any | |
| Assigned to: | CPU Architecture: | Any | |
[3 Feb 2014 11:36]
MySQL Verification Team
Hello Daniel, Thank you for the bug report and test case. Verified as described. Thanks, Umesh

Description: The CAST() function does not give any warning/error if an invalid date is supplied. How to repeat: mysql> SET sql_mode := 'STRICT_ALL_TABLES,NO_ZERO_DATE,NO_ZERO_IN_DATE'; Query OK, 0 rows affected (0.00 sec) mysql> SELECT CAST('2014-00-30' AS DATE); +----------------------------+ | CAST('2014-00-30' AS DATE) | +----------------------------+ | 2014-00-30 | +----------------------------+ 1 row in set (0.00 sec) Suggested fix: Return warning/error if the date is invalid.