[MDEV-20764] Add MariaDB_FUNCTION_COLLECTION_PLUGIN Created: 2019-10-07  Updated: 2019-10-16  Resolved: 2019-10-07

Status: Closed
Project: MariaDB Server
Component/s: Data types, Plugins
Fix Version/s: 10.5.0

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-274 The data type for IPv6/IPv4 addresses... Closed
blocks MDEV-4912 Data type plugin API version 1 Closed
blocks MDEV-20768 Turn INET functions into a function c... Closed
Relates
relates to MDEV-5315 ItemFunc plugins for server Open
relates to MDEV-20837 Add MariaDB_FUNCTION_PLUGIN Closed

 Description   

A function collection plugin will provide an array of Create_item's.

A function collection plugin data will have a structure approximately like this:

struct st_mariadb_function_collection
{
  int m_interface_version;
  HASH m_hash;
  const Native_func_registry *m_elements;
  size_t m_count; // The number of elements in m_elements
};

m_elements will point to a static array of Native_func_registry's, like the one defined in item_create.cc:

static Native_func_registry func_array[] =
{
  { { STRING_WITH_LEN("FUNC1") }, BUILDER(Create_func_func1)},
  { { STRING_WITH_LEN("FUNC2") }, BUILDER(Create_func_func2)},
  { { STRING_WITH_LEN("FUNC3") }, BUILDER(Create_func_func3)},
  { { STRING_WITH_LEN("FUNC4") }, BUILDER(Create_func_func4)},
  { { STRING_WITH_LEN("FUNC5") }, BUILDER(Create_func_func5)},
  ...
};

When initializing a function collection plugin, the server will populate m_hash.
When de-initializing a function collection plugin, the server will free m_hash.

Function collection plugins will allow to:

  • Split out optional SQL functions into seperate plugins (e.g. GIS, XML, INET functions)
  • Remove conditional compilation from existing server code.
  • Provide a better interface (than the existing limited UDF API), which will support:
    • character sets and collations
    • user defined data types

Generated at Thu Feb 08 09:01:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.