maria-discuss team mailing list archive
Mailing list archive
Re: install plugin “if not installed”?
On Mar 29, Felipe Gasper wrote:
> Is there any way to install a plugin via SQL but to trap the error
> that comes up if the plugin is already installed?
> I’d like to do it without creating a “throwaway” procedure, if that’s
Yes. There's more than one way to do it:
* INSTALL PLUGIN IF NOT EXISTS is available since 10.4.0
* INSTALL SONAME doesn't error out if the plugin is installed
* compound statements offer a generic way to avoid a throwaway procedure:
BEGIN NOT ATOMIC
DECLARE EXIT HANDLER FOR 1968 DO 1
INSTALL PLUGIN ...
IF NOT EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='...') THEN
INSTALL PLUGIN ...;
Chief Architect MariaDB