Bug #106924 | Query result is incorrect if there is a condition compares char field with 0 | ||
---|---|---|---|
Submitted: | 6 Apr 2022 8:12 | Modified: | 6 Apr 2022 12:07 |
Reporter: | Brian Yue (OCA) | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 8.0.27 | OS: | Any (rhel-7.4) |
Assigned to: | CPU Architecture: | Any (x86-64) |
[6 Apr 2022 8:12]
Brian Yue
[6 Apr 2022 12:07]
MySQL Verification Team
Hi Mr. Yue, Thank you for your bug report. However, it is not a bug. SQL does not function like some other programming languages, where many data types always have their integer value. In this case, comparing a string to an integer, requires conversions of both to the floating point type. Since letters can not be converted properly, they are converted to 0.00. An integer like 0 (zero) is also converted to 0.00, so the comparison works. This is explained in our Reference Manual, section on expressions. Not a bug.