Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
Under terms of MDEV-20837 we added MariaDB_FUNCTION_PLUGIN.
Every function plugin exports a Create_func object. This is the traditional way of defining functions in MySQL/MariaDB. But it has a disadvantage: it does not support function overloading.
So two plugin authors cannot create functions with the same name but different signatures, e.g.
SOME_FUNC(geometry);
|
SOME_FUNC(inet6);
|
Inside the server we already have Item_handled_func, which supports overloading through its Item_handled_func::Handler, and which is used by some functions:
- Bit operators | & ^ << >> ~
- bit_expr + INTERVAL
- BIT_COUNT()
- ADDTIME()
- STR_TO_DATE()
- CAST(expr AS CHAR)
For example, ADDTIME() has the following overloads:
ADDTIME(DATE or DATETIME or TIMESTAMP, any scalar type) |
ADDTIME(TIME, any scalar type) |
ADDTIME(Any string type, any scalar type) |
Let's expose this interface to function plugins, so a function plugin exports:
- either a traditional style Create_func object (without overloading support)
- or a handler for Item_handled_func (with overloading support)
Attachments
Issue Links
- relates to
-
MDEV-4912 Data type plugin API version 1
- Closed
-
MDEV-20837 Add MariaDB_FUNCTION_PLUGIN
- Closed