[MDEV-20846] Add proper unlocking for MariaDB_FUNCTION_PLUGIN Created: 2019-10-16  Updated: 2023-12-22

Status: Open
Project: MariaDB Server
Component/s: Plugins
Fix Version/s: 11.5

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexey Botchkov
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-20837 Add MariaDB_FUNCTION_PLUGIN Closed

 Description   

UNINSTALL is not safe for MariaDB_FUNCTION_PLUGIN at the moment.

This is the relevant code:

    Create_func *builder=
      reinterpret_cast<Plugin_function*>(plugin_decl(plugin)->info)->
        create_func();
    plugin_unlock(thd, plugin);
    return builder;

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()

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