[MDEV-6346] Implement Item::not_fixed_dec() Created: 2014-06-16  Updated: 2021-05-11

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Alexander Barkov Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: 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.


Generated at Thu Feb 08 07:11:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.