Bug #111387 | select -1*a; Why isn't the result zero? | ||
---|---|---|---|
Submitted: | 13 Jun 2023 7:57 | Modified: | 13 Jun 2023 12:31 |
Reporter: | haizhen xue | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S3 (Non-critical) |
Version: | OS: | Any | |
Assigned to: | CPU Architecture: | Any |
[13 Jun 2023 7:57]
haizhen xue
[13 Jun 2023 8:51]
haizhen xue
select -1*a; expect result is 0;
[13 Jun 2023 12:31]
MySQL Verification Team
Hi Mr. xue, Thank you for your bug report. However, this is not a bug. If you have read our Ref. Manual, you would have known that applying an integer operation to a string will convert the string to the floating point value, which is 0.0 for a string, with a warning. Since -0.0 or -0 is a valid result for the floating point type, this is not a bug.