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

Add type_handler_xpath_nodeset and remove XPATH_NODESET

Details

    Description

      In item_xmlfunc.cc there is a number of tests like:

        if (item->type() == Item::XPATH_NODESET)
      

      We'll modify this code in a more Type_handler-ish style, as follows:

      • Remove XPATH_NODESET from the enum Item::Type.
      • Add a new type handler declaration in item_xmlfunc.cc:

        static Type_handler_long_blob type_handler_xpath_nodeset;
        

      • Overload Item_nodeset_func::type_handler() and Item_nodeset_func::fixed_type_handler() to return &type_handler_xpath_nodeset.
      • Change all tests for XPATH_NODESET to a test like this:

         if (item->fixed_type_handler() == &type_handler_xpath_nodeset)
        

      Additionally, we'll do the following cleanups:

      • Rename the method Item::val_nodeset() to a more generic Item::val_raw(). It will be later used by other non-traditional data types.
      • Remove XPATH_NODESET_CMP, as it's not used.

      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 In {{item_xmlfunc.cc}} there is a number of tests like:

            {code:sql}
              if (item->type() == Item::XPATH_NODESET)
            {code}

            We'll modify this code in a more Type_handler-ish style, as follows:

            - Remove {{XPATH_NODESET}} from the enum Item::Type.

            - Add a new type handler declaration in {{item_xmlfunc.cc}}:
            {code:cpp}
            static Type_handler_long_blob type_handler_xpath_nodeset;
            {code}

            - Overload {{Item_nodeset_func::type_handler()}} and {{Item_nodeset_func::fixed_type_handler()}} to return {{&type_handler_xpath_nodeset}}.

            - Change all tests for {{XPATH_NODESET}} to a test like this:
            {code:sql}
             if (item->fixed_type_handler() == &type_handler_xpath_nodeset)
            {code}

            Additionally, we'll rename the method {{Item::val_nodeset()}} to a more generic {{Item::val_raw()}}. It will be later used by other non-traditional data types.
            In {{item_xmlfunc.cc}} there is a number of tests like:

            {code:sql}
              if (item->type() == Item::XPATH_NODESET)
            {code}

            We'll modify this code in a more Type_handler-ish style, as follows:

            - Remove {{XPATH_NODESET}} from the enum Item::Type.

            - Add a new type handler declaration in {{item_xmlfunc.cc}}:
            {code:cpp}
            static Type_handler_long_blob type_handler_xpath_nodeset;
            {code}

            - Overload {{Item_nodeset_func::type_handler()}} and {{Item_nodeset_func::fixed_type_handler()}} to return {{&type_handler_xpath_nodeset}}.

            - Change all tests for {{XPATH_NODESET}} to a test like this:
            {code:sql}
             if (item->fixed_type_handler() == &type_handler_xpath_nodeset)
            {code}

            Additionally, we'll do the following cleanups:
            - Rename the method {{Item::val_nodeset()}} to a more generic {{Item::val_raw()}}. It will be later used by other non-traditional data types.
            - Remove {{XPATH_NODESET_CMP}}, as it's not used.

            bar Alexander Barkov made changes -
            issue.field.resolutiondate 2018-06-06 11:00:58.0 2018-06-06 11:00:58.995
            bar Alexander Barkov made changes -
            Fix Version/s 10.4.0 [ 23115 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 87709 ] MariaDB v4 [ 133581 ]

            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.