Bug #103337 | DATE and DATETIME camparison with CHAR throws ERROR | ||
---|---|---|---|
Submitted: | 15 Apr 2021 19:45 | Modified: | 16 Apr 2021 19:04 |
Reporter: | Eimantas Jatkonis | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S2 (Serious) |
Version: | 8.0.21, 8.0.23 | OS: | Linux |
Assigned to: | CPU Architecture: | Any |
[15 Apr 2021 19:45]
Eimantas Jatkonis
[16 Apr 2021 7:36]
Roy Lyseng
This is not a bug. It was a problem that was fixed in https://bugs.mysql.com/bug.php?id=93513
[16 Apr 2021 19:04]
Eimantas Jatkonis
Your mentioned problem has other kind of problem, as there is no month with 32 days. This is kind similar to mine, because CHAR to DATE conversion is required. Data type conversions is "warning" scope, not "error". In MySQL unconvertable values becomes 0 or NULL. Like "ABC" * 1 = 0 BUG#93513 solution was not required, AND it is inconsistent. example with INT to DATE conversion still produces warnings, not errors. mysql> SELECT DATE(123456); +--------------+ | DATE(123456) | +--------------+ | NULL | +--------------+ 1 row in set, 1 warning (0.00 sec) mysql> show warnings; +---------+------+------------------------------------+ | Level | Code | Message | +---------+------+------------------------------------+ | Warning | 1292 | Incorrect datetime value: '123456' | +---------+------+------------------------------------+ 1 row in set (0.00 sec) BUG#93513 proposed solution required for one user, and it is not configurable with sql_mode. This is not OK.