[MDEV-20732] max_char_length() returns value that is too small for a string returned by FORMAT() with doubles in scientific notation Created: 2019-10-03 Updated: 2020-01-16 Resolved: 2020-01-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types |
| Affects Version/s: | 10.4 |
| Fix Version/s: | 10.4.12, 10.5.1 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Roman | Assignee: | Roman |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Consider the example:
There is an assumption that doubles represented as strings couldn't take more then 22 chars. This is incorrect if a big double is sent into FORMAT() function. However the expression args[0]->max_char_length() that is called inside Item_func_format::fix_length_and_dec() returns 22 and this causes the error. This is also relevant for ColumnStore. |
| Comments |
| Comment by Gagan Goel (Inactive) [ 2019-12-30 ] | |||||||||||||||||
|
Re-opening this since Format() function on a float data type does not estimate the result length correctly. Here is an example:
| |||||||||||||||||
| Comment by Gagan Goel (Inactive) [ 2019-12-30 ] | |||||||||||||||||
|
Patch for the fix is in PR 1431 | |||||||||||||||||
| Comment by Robert Bindar [ 2020-01-16 ] | |||||||||||||||||
|
Merged the PR on github. Thanks for the good work! |