Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
The fact that an Item has a not fixed number of decimal digits
is currently stored in Item::decimals as a special value
NOT_FIXED_DEC (31).
We should stop using decimal==NOT_FIXED_DEC for that purposes,
and introduce a new virtual method "bool not_fixed_dec()" instead.
This should help to avoid bugs like MDEV-4511
when NOT_FIXED_DEC is erroneously treated as "normal"
number of decimals.
Also, there is currently no a way to get the real number of
decimals from an Item if decimals=NOT_FIXED_DEC, which
makes calculating decimal precision and scale hard in
fix_length_and_dec() of some items.