[MCOL-4656] Analyse wrong and possibly redundant code in Decimal::integralWideRound Created: 2021-04-01 Updated: 2023-12-15 |
|
| Status: | Open |
| Project: | MariaDB ColumnStore |
| Component/s: | PrimProc |
| Affects Version/s: | 6.1.1 |
| Fix Version/s: | 23.10 |
| Type: | Task | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Roman |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | beginner-friendly | ||
| Issue Links: |
|
||||||||
| Epic Link: | ColumnStore Compatibility Improvements | ||||||||
| Description |
|
This code:
looks wrong. The increment and decrement happens AFTER the value is passed to the constructor. So the supposed rounding does not actually happen. The intended code was most likely as follows:
However, there is a chance that the entire Decimal::integralWideRound() is a dead code. This method is used only once in functioncolumn.h in FunctionColumn::getDecimalVal(). This is a snippet:
tntnatbry and bar could not find an SQL script which would make the execution enter the branch calling integralWideRound(). The code should be further analysed what we should do:
|
| Comments |
| Comment by Roman [ 2021-07-03 ] |
|
The function Decimal::integralWideRound() and the corresponding branch in FunctionColumn::getDecimalVal() must be removed. |