Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-20326

Add class DTCollation_numeric

    XMLWordPrintable

    Details

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: