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.
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
- CAST(expr AS CHAR)
For example, ADDTIME() has the following overloads:
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)