[MDEV-9934] Easier loading of plugins Created: 2016-04-17  Updated: 2017-05-30

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

Type: Task Priority: Minor
Reporter: Daniël van Eeden Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Use a JSON file to load all plugins (multiple functions, multiple .so or .dll files, etc) and run a .sql file if required.

INSTALL SOFILE 'foo.so' is nice, but platform specific and this won't run a .sql file (as used by Oracle MySQL rewrite plugin and memcached plugins)

See also: https://bugs.mysql.com/bug.php?id=73802



 Comments   
Comment by Elena Stepanova [ 2016-04-17 ]

I don't know anything about INSTALL SOFILE, but we do have INSTALL SONAME 'foo'. It does not solve the problem with sql file, but it is platform-independent.

Comment by Daniël van Eeden [ 2016-04-18 ]

Sorry INTALL SOFILE is what I was referring to. Forgot the .so/.dll part is optional.

Comment by Sergei Golubchik [ 2017-05-29 ]

In Bug#73802 you specify to issues that a json file should solve:

  • Many plugins have more than one function. Loading all functions takes one statement per function
  • Loading plugins on Windows or Linux/UNIX is different (.so vs. .dll)

INSTALL SONAME fixes them both.

As for the "run sql file", I think it's the plugin job to install itself properly. I agree, that it's an open issue now. Ideally, I'd like a user to do INSTALL PLUGIN or INSTALL SONAME and the server would run necessary sql commands automatically. One of the issues to consider, if the plugin is loaded with --plugin-load command-line option, it'll be initialized before the server is ready to accept connections, that is, before the server is able to run plugin initialization sql script.

Comment by Daniël van Eeden [ 2017-05-29 ]

The json-file also serves another purpose: List not-yet-installed plugins, but that could also be rolled into INSTALL SONAME.
And what about plugins without a so-file? E.g.

# yum install mariadb-foobar-extension
# rpm -ql mariadb-foobar-extension
/plugin/dir/location/foobar_10_0.sql
/plugin/dir/location/foobar_10_1.sql
/plugin/dir/location/foobar_10_2.sql
/plugin/dir/location/foobar.json
mariadb> SHOW EXTENSIONS;
+----------------------------+----------+--------------------+-------------+---------+
| Name                       | Status   | Type               | Library     | License |
+----------------------------+----------+--------------------+-------------+---------+
| foobar                     | AVAILABLE   | SQL PACKAGE     | NULL        | MIT    |
+----------------------------+----------+--------------------+-------------+---------+
mariadb> INSTALL EXTENSION 'foobar';

(installs whatever .sql file(s) are appropriate)

Later update the RPM package and the json file gets updated and this triggers MariaDB to update the installed package/function/procedures/etc

Comment by Sergei Golubchik [ 2017-05-30 ]

I see. For not installed plugins you can use SHOW PLUGINS SONAME statement: https://mariadb.com/kb/en/mariadb/show-plugins-soname/

For packages, you're right, we don't have anything at the moment. There is MDEV-10591 in progress, though, and what one calls “a package” will clearly be influenced by it. I agree about ease of installing, etc, just let's revisit it when MDEV-10591 is closed.

Generated at Thu Feb 08 07:38:25 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.