[MCOL-4607] SEC_TO_TIME(wideDecimal) returns 0 in DECIMAL context Created: 2021-03-15 Updated: 2023-07-02 |
|
| Status: | Open |
| Project: | MariaDB ColumnStore |
| Component/s: | PrimProc |
| Affects Version/s: | 5.6.1, 6.1.1 |
| Fix Version/s: | Icebox |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | beginner-friendly | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Notice, SEC_TO_TIME(a) per se returned a correct result, but when I further put it into a DECIMAL plus operation, it returned 0. The expected result is:
|
| Comments |
| Comment by Alexander Barkov [ 2021-03-26 ] |
|
The problem happens because Func_sec_to_time::getDecimalVal() does not set the `precision` member for the output value. |
| Comment by Mu He [ 2023-03-24 ] |
|
The reason should be here, the issue could be solved by just assigning d.value = tmpVal for all situation or like d.value = d.s128Value = tmpVal inside the if statement. It may mean that the data is recognized as a wide decimal but read the value instead rather than the s128Value. |
| Comment by Mu He [ 2023-03-24 ] |
|
I think we should use op_ct.isWideDecimalType() here instead of parm[0] |