[MDEV-30491] select rtrim command result is truncated Created: 2023-01-29 Updated: 2023-11-28 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.5.18 |
| Fix Version/s: | 10.4, 10.5, 10.6, 10.11 |
| Type: | Bug | Priority: | Major |
| Reporter: | dongjian | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
centos 7.6 |
||
| Attachments: |
|
| Description |
|
|
| Comments |
| Comment by Sergei Golubchik [ 2023-01-30 ] | |||
|
Caused by using DBL_DIG + 7 as a max string length for a double:
DBL_DIG supposedly covers all significant digits after the decimal dot, while +7 supposedly comes from the sign character -, 1. and e308. But DBL_DIG is defined as number of decimal digits that are guaranteed to be preserved in text → double → text roundtrip without change due to rounding or overflow. And "digits after the dot" can include one extra digit, that is not guaranteed to be preserved exactly (like in this bug report 7 becomes 5). And also there can be e-308. So to be safe the length should be DBL_DIG + 9. But it fails many tests, these failures need to be analyzed. Perhaps this fix is too big for GA versions at all | |||
| Comment by dongjian [ 2023-02-02 ] | |||
|
Thank you for your help. |