Bug #103093 | MINUS between const value 0 and field with MIN bigint value gets wrong result | ||
---|---|---|---|
Submitted: | 24 Mar 2021 12:14 | Modified: | 12 Apr 2021 18:10 |
Reporter: | Hubery Lu | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[24 Mar 2021 12:14]
Hubery Lu
[26 Mar 2021 14:02]
MySQL Verification Team
Hi Mr. Lu, Thank you for your bug report. However, it is not a bug. Simply, the maximum value for the signed 64-bit integer is 9,223,372,036,854,775,807, hence 0 - 9,223,372,036,854,775,808 can not be expressed for that type of the integer. Ideally, the error should be returned, but MySQL is not a very strict type-checking system. This will not change, since the introduction of the strict type-checking would break millions of existing applications. Not a bug.
[26 Mar 2021 14:51]
Tor Didriksen
In other parts of the codebase, we try quite hard to handle LLONG_MIN, and over/underflow issues. I think this is a (legacy) bug, and that the fix is quite simple.
[12 Apr 2021 18:10]
Jon Stephens
Documented fix as follows in the MySQL 8.0.25 changelog: 0 - (MAX(BIGINT) + 1) returned -(MAX(BIGINT) + 1). Now an out of range error is returned instead. Closed.
[13 Apr 2021 12:47]
MySQL Verification Team
Thank you , Jon .....
[26 Apr 2021 17:52]
Jon Stephens
This fix now appears in MySQL 8.0.26. No other changes.
[27 Apr 2021 12:26]
MySQL Verification Team
Thank you, Jon.