1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-16294: INSTALL PLUGIN IF NOT EXISTS / UNINSTALL PLUGIN IF EXISTS

Add INSTALL SONAME IF NOT EXISTS; syntax only, installing
duplicate SONAMES doesn't currently cause any errors or warnings.

UNINSTALL SONAME IF EXISTS was added.

Allow the installation / uninstallation of plugins without
doing checks for existence first.
This commit is contained in:
Daniel Black
2018-05-18 12:59:32 +10:00
committed by Sergei Golubchik
parent 4272eec050
commit bb85d92d6f
4 changed files with 93 additions and 17 deletions

View File

@ -265,3 +265,22 @@ UNINSTALL PLUGIN example;
--error ER_NO_SUCH_TABLE
RENAME TABLE t1 TO t2;
DROP TABLE t1;
--echo #
--echo # INSTALL IF NOT EXISTS [PLUGIN name] SONAME library /
--echo # UNINSTALL IF EXISTS PLUGIN|SONAME name
--echo #
--echo #
select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';
INSTALL PLUGIN IF NOT EXISTS example SONAME 'ha_example';
select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';
INSTALL PLUGIN IF NOT EXISTS EXAMPLE SONAME 'ha_example';
SHOW WARNINGS;
INSTALL SONAME IF NOT EXISTS 'ha_example';
SHOW WARNINGS;
UNINSTALL PLUGIN IF EXISTS example;
select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';
UNINSTALL SONAME IF EXISTS 'ha_example';
SHOW WARNINGS;
select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';