[MDEV-9395] Add Type_handler::Item_decimal_scale() and Item_divisor_precision_increment() Created: 2016-01-11  Updated: 2017-04-29  Resolved: 2017-04-29

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Fix Version/s: 10.3.1

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: refactoring

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed

 Description   

These pieces of the code are not friendly to pluggable data types:

uint decimal_scale() const
{
  return decimals < NOT_FIXED_DEC ? decimals :
         is_temporal_type_with_time(field_type()) ?
         TIME_SECOND_PART_DIGITS :
         MY_MIN(max_length, DECIMAL_MAX_SCALE);
}

uint divisor_precision_increment() const
{
  return decimals <  NOT_FIXED_DEC ? decimals :
         is_temporal_type_with_time(field_type()) ?
         TIME_SECOND_PART_DIGITS :
         decimals;
}

We'll add virtual methods in Type_handler instead:

virtual uint Item_decimal_scale(const Item *item) const;
virtual uint Item_divisor_precision_increment(const Item *) const;



 Comments   
Comment by Alexander Barkov [ 2017-04-29 ]

Pushed to bb-10.2-ext

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