[MCOL-5248] Truncate on char and varchar columns with numeric digits returned incorrect results Created: 2022-10-04 Updated: 2023-02-08 Resolved: 2023-01-17 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | None |
| Affects Version/s: | 22.08.2 |
| Fix Version/s: | 22.08.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Lee (Inactive) | Assignee: | David Hall (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 2022-22, 2022-23 | ||||||||
| Assigned for Review: | |
||||||||
| Assigned for Testing: | |
||||||||
| Description |
|
Build tested: 22.08.2 It seems to be a data type overflow issue. The issue was uncovered by MTR test case devregression/r/mcs7085_regression_bug3483.test. Actually, the reference result is also incorrect. The reference result needs to be updated when the issue is fixed. ColumnStore
InnoDB
|
| Comments |
| Comment by David Hall (Inactive) [ 2022-10-28 ] |
|
The code tries to convert the string to a decimal type. But we don't support that conversion directly, so it converts to double, then to decimal. However, it the value is larger in magnitude than can fit into a 64 bit int (including the right of the decimal after truncation), it saturates. Investigation shows that MDB converts strings to double and truncates there. I modified MCS to behave similarly. |
| Comment by Daniel Lee (Inactive) [ 2023-01-17 ] |
|
Build verified: 23.02 engine: 35c8359d90cefef25794bdc908aac9afc94b22a3 |