UNINSTALL is not safe for MariaDB_FUNCTION_PLUGIN at the moment.
This is the relevant code:
It immediately unlocks the plugin, so UNINSTALL can happen when the plugin functions is in use.
We should implement proper unlocking for plugin functions.
- The above piece of the code should not call plugin_unlock()
- Every Item_func loaded from a plugin should:
- decrement ref counter in destructor
- increment ref counter in clone()