Bug #115277 | CAST from float to string produces inconsistent results | ||
---|---|---|---|
Submitted: | 11 Jun 2024 5:43 | Modified: | 11 Jun 2024 9:30 |
Reporter: | loing chen | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: General | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | cast |
[11 Jun 2024 5:43]
loing chen
[11 Jun 2024 9:30]
MySQL Verification Team
Hi Mr. chen, Thank you for your bug report. However, it is not a bug. Simply, your stored function goes against SQL Standard. SQL Standard prescribes that mixing of different data types should always return an error. MySQL goes a step further and tries to do more. So, MySQL has adopted a set of common denominators. When converting any floating point to CHAR type, or the other way around, a DOUBLE is used for the better precision. Since, this is not prescribed in SQL Standard, this set of denominators is here to stay and it will not be changed. Not a bug.