Bug #108423 | When the maximum integers of double and float are inserted, the data is distorte | ||
---|---|---|---|
Submitted: | 8 Sep 2022 10:03 | Modified: | 12 Sep 2022 7:51 |
Reporter: | diandian wei | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S1 (Critical) |
Version: | mysql Ver 8.0.22 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[8 Sep 2022 10:03]
diandian wei
[8 Sep 2022 11:08]
diandian wei
The execution result is incorrect. It's supposed to be 99999999999999999999. mysql> select float1,double1 from ompsitem; +--------+---------+ | float1 | double1 | +--------+---------+ | 1e20 | 1e20 | +--------+---------+ 1 row in set (0.00 sec)
[12 Sep 2022 7:51]
MySQL Verification Team
Hello diandian wei, Thank you for the report and feedback. Discussed internally with concern developer and concluded that it is indeed not a bug. there are 20 digits of precision, which exceeds the precision for both data types. Thus, 1e20 is the best possible approximation for 99999999999999999999. Official manual confirms this on how strict and non-strict mode handles Out-of-Range and Overflow Handling values - https://dev.mysql.com/doc/refman/8.0/en/out-of-range-and-overflow.html regards, Umesh