[MDEV-20326] Add class DTCollation_numeric Created: 2019-08-12  Updated: 2019-08-12  Resolved: 2019-08-12

Status: Closed
Project: MariaDB Server
Component/s: Data types
Fix Version/s: 10.5.0

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

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

 Description   

We should eventually remove DTCollation from the top level Item class. Only string types really need it. It wastes memory for non-string Items.

As the first step, let's do the following:

  • add a new class DTCollation_numeric
  • change all:

    collation.set_numeric()
    

    to:

    collation= DTCollation_numeric();
    

  • remove virtual methods Field::derivation() and Field::repertoire()
  • change Field::dtcollation() to be a virtual method:

    virtual DTCollation dtcollation()= 0;
    

  • Reuse DTCollation_numeric() in Field_numeric::dtcollation() and Field_temporal::dtcollation()
  • Replace these members in Field_str:

      // TODO-10.2: Reuse DTCollation instead of these three members
      CHARSET_INFO *field_charset;
      enum Derivation field_derivation;
      uint field_repertoire;
    

    to:

      DTCollation m_collation;
    

Later we'll remove DTCollation from the top level Item class and replace it to a new Item virtual method:

virtual DTCollation dtcollation();

So numeric and temporal methods will return and instance of DTCollation_numeric(), by value or by reference.


Generated at Thu Feb 08 08:58:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.