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

Item_param: replace {INT|DECIMAL|REAL|STRING|TIME}_VALUE with Type_handler

Details

    Description

      Item_param has two parallel systems to maintain the data type:

      • Type_handler_hybrid_field_type, which is used externally, like for a regular Item.
      • enum_item_param_state constants INT_VALUE, DECIMAL_VALUE, REAL_VALUE, STRING_VALUE, TIME_VALUE, which are used internally, to maintain the data stored inside Item_param::value.

      We'll do the following:

      • Remove the data type specific constants from enum_item_param_state
      • Add a new value SHORT_DATA_VALUE instead, for all data types.
      • Start using Type_handler_hybrid_field_type to maintain Item_param::value internally.

      After this change, enum_item_param_state will look like this:

      enum enum_item_param_state
      {
        NO_VALUE, NULL_VALUE, SHORT_DATA_VALUE, LONG_DATA_VALUE,
        DEFAULT_VALUE, IGNORE_VALUE
      } state;
      

      Note, SHORT_DATA_VALUE is needed to distinguish the state from LONG_DATA_VALUE.

      These changes are needed to simplify further work for:

      • MDEV-14270 Dynamic CREATE TABLE does not preserve the data type of SP variables with NULL value
      • MDEV-4912 Add a plugin to field types (column types)

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            Description {{Item_param}} has two parallel systems to maintain the data type:
            - {{Type_handler_hybrid_field_type}}, which is used externally, like a regular {{Item}}.
            - {{enum_item_param_state}} constants {{INT_VALUE}}, {{DECIMAL_VALUE}}, {{REAL_VALUE}}, {{STRING_VALUE}}, {{TIME_VALUE}}, which are used internally, to maintain the data stored inside {{Item_param::value}}.

            We'll do the following:
            - Remove the data type specific constants from {{enum_item_param_state}}
            - Add a new value {{SHORT_DATA_VALUE}} instead, for all data types.
            - Start using {{Type_handler_hybrid_field_type}} to maintain {{Item_param::value}} internally.

            After this change, {{enum_item_param_state}} will look like this:

            {code:cpp}
            enum enum_item_param_state
            {
              NO_VALUE, NULL_VALUE, SHORT_DATA_VALUE, LONG_DATA_VALUE,
              DEFAULT_VALUE, IGNORE_VALUE
            } state;
            {code}

            Note, {{SHORT_DATA_VALUE}} is needed to distinguish the state from {{LONG_DATA_VALUE}}.

            This is needed to simplify further work for:
            - MDEV-14270 Dynamic CREATE TABLE does not preserve the data type of SP variables with NULL value
            - MDEV-4912 Add a plugin to field types (column types)
            {{Item_param}} has two parallel systems to maintain the data type:
            - {{Type_handler_hybrid_field_type}}, which is used externally, like for a regular {{Item}}.
            - {{enum_item_param_state}} constants {{INT_VALUE}}, {{DECIMAL_VALUE}}, {{REAL_VALUE}}, {{STRING_VALUE}}, {{TIME_VALUE}}, which are used internally, to maintain the data stored inside {{Item_param::value}}.

            We'll do the following:
            - Remove the data type specific constants from {{enum_item_param_state}}
            - Add a new value {{SHORT_DATA_VALUE}} instead, for all data types.
            - Start using {{Type_handler_hybrid_field_type}} to maintain {{Item_param::value}} internally.

            After this change, {{enum_item_param_state}} will look like this:

            {code:cpp}
            enum enum_item_param_state
            {
              NO_VALUE, NULL_VALUE, SHORT_DATA_VALUE, LONG_DATA_VALUE,
              DEFAULT_VALUE, IGNORE_VALUE
            } state;
            {code}

            Note, {{SHORT_DATA_VALUE}} is needed to distinguish the state from {{LONG_DATA_VALUE}}.

            This is needed to simplify further work for:
            - MDEV-14270 Dynamic CREATE TABLE does not preserve the data type of SP variables with NULL value
            - MDEV-4912 Add a plugin to field types (column types)
            bar Alexander Barkov made changes -
            Description {{Item_param}} has two parallel systems to maintain the data type:
            - {{Type_handler_hybrid_field_type}}, which is used externally, like for a regular {{Item}}.
            - {{enum_item_param_state}} constants {{INT_VALUE}}, {{DECIMAL_VALUE}}, {{REAL_VALUE}}, {{STRING_VALUE}}, {{TIME_VALUE}}, which are used internally, to maintain the data stored inside {{Item_param::value}}.

            We'll do the following:
            - Remove the data type specific constants from {{enum_item_param_state}}
            - Add a new value {{SHORT_DATA_VALUE}} instead, for all data types.
            - Start using {{Type_handler_hybrid_field_type}} to maintain {{Item_param::value}} internally.

            After this change, {{enum_item_param_state}} will look like this:

            {code:cpp}
            enum enum_item_param_state
            {
              NO_VALUE, NULL_VALUE, SHORT_DATA_VALUE, LONG_DATA_VALUE,
              DEFAULT_VALUE, IGNORE_VALUE
            } state;
            {code}

            Note, {{SHORT_DATA_VALUE}} is needed to distinguish the state from {{LONG_DATA_VALUE}}.

            This is needed to simplify further work for:
            - MDEV-14270 Dynamic CREATE TABLE does not preserve the data type of SP variables with NULL value
            - MDEV-4912 Add a plugin to field types (column types)
            {{Item_param}} has two parallel systems to maintain the data type:
            - {{Type_handler_hybrid_field_type}}, which is used externally, like for a regular {{Item}}.
            - {{enum_item_param_state}} constants {{INT_VALUE}}, {{DECIMAL_VALUE}}, {{REAL_VALUE}}, {{STRING_VALUE}}, {{TIME_VALUE}}, which are used internally, to maintain the data stored inside {{Item_param::value}}.

            We'll do the following:
            - Remove the data type specific constants from {{enum_item_param_state}}
            - Add a new value {{SHORT_DATA_VALUE}} instead, for all data types.
            - Start using {{Type_handler_hybrid_field_type}} to maintain {{Item_param::value}} internally.

            After this change, {{enum_item_param_state}} will look like this:

            {code:cpp}
            enum enum_item_param_state
            {
              NO_VALUE, NULL_VALUE, SHORT_DATA_VALUE, LONG_DATA_VALUE,
              DEFAULT_VALUE, IGNORE_VALUE
            } state;
            {code}

            Note, {{SHORT_DATA_VALUE}} is needed to distinguish the state from {{LONG_DATA_VALUE}}.

            These changes are needed to simplify further work for:
            - MDEV-14270 Dynamic CREATE TABLE does not preserve the data type of SP variables with NULL value
            - MDEV-4912 Add a plugin to field types (column types)
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            issue.field.resolutiondate 2017-11-29 06:45:04.0 2017-11-29 06:45:04.347
            bar Alexander Barkov made changes -
            Fix Version/s 10.3.3 [ 22644 ]
            Fix Version/s 10.3 [ 22126 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 83932 ] MariaDB v4 [ 133403 ]

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.