Bug #114526 | Inconsistent Results when Using ROUND(), GREATEST(), and CAST() | ||
---|---|---|---|
Submitted: | 1 Apr 13:35 | Modified: | 2 Apr 10:38 |
Reporter: | Jingzhou Fu | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 8.3.0 | OS: | Linux (Ubuntu 20.04, docker) |
Assigned to: | CPU Architecture: | x86 | |
Tags: | Logic bug |
[1 Apr 13:35]
Jingzhou Fu
[2 Apr 10:38]
MySQL Verification Team
Hi Mr. Fu, Thank you so much for your bug report. However, this is not a bug, but a feature ...... Here, you are actually using two different types in both expressions. One type is a string and the other type is a DATE. According to the SQL Standard, a database server should return a hard error ....... and no result, what so ever. MySQL attempts to return something back to the client side, which makes non-compliant with the SQL standard, but is more friendly. In all such situation a third data type is chosen and both values are converted to that resolving type. In MySQL case, it is an integer. Other RDBMS products may choose a different resolution type, but this is totally out of standard and therefore a choice of the RDBMS architecture. Not a bug.