Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-20846

Add proper unlocking for MariaDB_FUNCTION_PLUGIN

    Details

    • Type: Task
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: 10.5
    • Component/s: Plugins
    • Labels:
      None

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: