[MDEV-16414] Add type_handler_xpath_nodeset and remove XPATH_NODESET Created: 2018-06-06  Updated: 2018-06-06  Resolved: 2018-06-06

Status: Closed
Project: MariaDB Server
Component/s: Data types, XML Functions
Fix Version/s: 10.4.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   

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.

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