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

Split Item_hybrid_func::fix_attributes into virtual methods in Type_handler

Details

    Description

      This task will add a new virtual method in Type_handler:

        virtual bool Item_hybrid_func_fix_attributes(THD *thd, Item_hybrid_func *func,
                                                     Item **items,
                                                     uint nitems) const;
      

      and split this code in Item_hybrid_func::fix_attributes into the new method implementation in the relevant type handler implementations:

       switch (Item_hybrid_func::result_type()) {
       case STRING_RESULT:
       ..
       case DECIMAL_RESULT:
        ..
       case REAL_RESULT:
       ..
       case INT_RESULT:
       ..
       case ROW_RESULT:
       case TIME_RESULT:
       ..
       }
      

      and also remove a special STRING_RESULT condition in Item_func_case::fix_length_and_dec(), to make the code symmetric across the data types.

      Note, the THD* parameter to Type_handler::Item_hybrid_func_fix_attributes is not needed right now, but it will be needed soon:

      • for MDEV-10575
      • to get rid of current_thd calls inside count_string_length(), as it was planned to get rid of most current_thd calls in 10.3.

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            bar Alexander Barkov made changes -
            Description This task will add a new virtual method in {{Type_handler}}:
            {code:cpp}
              virtual bool Item_hybrid_func_fix_attributes(THD *thd, Item_hybrid_func *func,
                                                           Item **items,
                                                           uint nitems) const;
            {code}
            and split this code in {{Item_hybrid_func::fix_attributes}} into the new method implementation in the relevant type handler implementations:
            {code:cpp}
             switch (Item_hybrid_func::result_type()) {
             case STRING_RESULT:
             ..
             case DECIMAL_RESULT:
              ..
             case REAL_RESULT:
             ..
             case INT_RESULT:
             ..
             case ROW_RESULT:
             case TIME_RESULT:
             ..
             }
            {code}
            This task will add a new virtual method in {{Type_handler}}:
            {code:cpp}
              virtual bool Item_hybrid_func_fix_attributes(THD *thd, Item_hybrid_func *func,
                                                           Item **items,
                                                           uint nitems) const;
            {code}
            and split this code in {{Item_hybrid_func::fix_attributes}} into the new method implementation in the relevant type handler implementations:
            {code:cpp}
             switch (Item_hybrid_func::result_type()) {
             case STRING_RESULT:
             ..
             case DECIMAL_RESULT:
              ..
             case REAL_RESULT:
             ..
             case INT_RESULT:
             ..
             case ROW_RESULT:
             case TIME_RESULT:
             ..
             }
            {code}

            and also remove a special {{STRING_RESULT}} condition in {{Item_func_case::fix_length_and_dec()}}, to make the code symmetric across the data types.
            bar Alexander Barkov made changes -
            Description This task will add a new virtual method in {{Type_handler}}:
            {code:cpp}
              virtual bool Item_hybrid_func_fix_attributes(THD *thd, Item_hybrid_func *func,
                                                           Item **items,
                                                           uint nitems) const;
            {code}
            and split this code in {{Item_hybrid_func::fix_attributes}} into the new method implementation in the relevant type handler implementations:
            {code:cpp}
             switch (Item_hybrid_func::result_type()) {
             case STRING_RESULT:
             ..
             case DECIMAL_RESULT:
              ..
             case REAL_RESULT:
             ..
             case INT_RESULT:
             ..
             case ROW_RESULT:
             case TIME_RESULT:
             ..
             }
            {code}

            and also remove a special {{STRING_RESULT}} condition in {{Item_func_case::fix_length_and_dec()}}, to make the code symmetric across the data types.
            This task will add a new virtual method in {{Type_handler}}:
            {code:cpp}
              virtual bool Item_hybrid_func_fix_attributes(THD *thd, Item_hybrid_func *func,
                                                           Item **items,
                                                           uint nitems) const;
            {code}
            and split this code in {{Item_hybrid_func::fix_attributes}} into the new method implementation in the relevant type handler implementations:
            {code:cpp}
             switch (Item_hybrid_func::result_type()) {
             case STRING_RESULT:
             ..
             case DECIMAL_RESULT:
              ..
             case REAL_RESULT:
             ..
             case INT_RESULT:
             ..
             case ROW_RESULT:
             case TIME_RESULT:
             ..
             }
            {code}

            and also remove a special {{STRING_RESULT}} condition in {{Item_func_case::fix_length_and_dec()}}, to make the code symmetric across the data types.

            Note, the {{THD*}} parameter to {{Type_handler::Item_hybrid_func_fix_attributes}} is not needed right now, but it will be needed soon:
            - for MDEV-10575
            - to get rid of {{current_thd}} calls inside {{count_string_length()}}, as it was planned to get rid of most {{current_thd}} calls in {{10.3}}.


            bar Alexander Barkov made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            bar Alexander Barkov made changes -
            Assignee Alexander Barkov [ bar ] Oleksandr Byelkin [ sanja ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Alexander Barkov [ bar ]
            Status In Review [ 10002 ] Stalled [ 10000 ]

            Pushed into bb-10.2-ext, merged to 10.3.

            bar Alexander Barkov added a comment - Pushed into bb-10.2-ext, merged to 10.3.
            bar Alexander Barkov made changes -
            Fix Version/s 10.3.0 [ 22127 ]
            Fix Version/s 10.3 [ 22126 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            bar Alexander Barkov made changes -
            Labels datatype
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 78837 ] MariaDB v4 [ 133079 ]

            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.