[MCOL-5215] UNION on DECIMAL returns incorrect results Created: 2022-09-06 Updated: 2023-02-28 Resolved: 2023-02-28 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | PrimProc |
| Affects Version/s: | None |
| Fix Version/s: | 23.02.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Jigao Luo | Assignee: | Gagan Goel (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Assigned for Review: | |
||||||||||||
| Assigned for Testing: | |
||||||||||||
| Description |
|
Here is an example SQL script with wrong outputs when UNOIN of MCS computes with DECIMAL with 38 digits precision when the precision is saturated. An example wrong case is a UNION with DECIMAL(38) and DECIMAL(38,38). The result type in the system is a DECIMAL(38,38), which is wrong and can not represent any number with digits before the `.`.
The correct behaviour is to throw a warning when the precision of DECIMAL is saturated. However, there are some cases to be discussed. |
| Comments |
| Comment by Gagan Goel (Inactive) [ 2023-02-28 ] | |
|
For QA: We have added a new error message if the UNION operation exceeds the currently supported maximum DECIMAL precision of 38 digits:
Once the support for MCOL-5417 is added, the above query in the issue description should execute as expected and this error message will be removed. | |
| Comment by Daniel Lee (Inactive) [ 2023-02-28 ] | |
|
Build verified: engine: 4d4e4ad30dd2ec494ea9d323e1fa7fa69e97243e Verified with the test case in the description. |