----- Original Message -----
Thanks for your help!
How should this then be re-written correctly?
Thinking strip away the procedures and work directly with a query of the information schema.
perhaps even just call: set sql_log_bin=0; install plugin "unix_socket"
and ignore the error if it exists..
SET sql_log_bin=0; USE mysql; DELIMITER //; CREATE PROCEDURE
debian_plugin_install(IN plugin_name CHAR(50), IN soname CHAR(50))
BEGIN DECLARE CONTINUE HANDLER FOR NOT FOUND EXECUTE
inst_plug; set @plugin_name=plugin_name; set @soname=soname ;set
@install_plugin=CONCAT(\"INSTALL PLUGIN \",@plugin_name,\" SONAME '\",
@soname, \"'\");PREPARE inst_plug FROM @install_plugin ;
select PLUGIN_NAME INTO @a from information_schema.plugins where
PLUGIN_NAME=@plugin_name AND PLUGIN_STATUS='ACTIVE' AND
PLUGIN_TYPE='AUTHENTICATION' AND PLUGIN_LIBRARY LIKE
concat(@soname,'%'
); DEALLOCATE PREPARE inst_plug; END// CALL
debian_plugin_install('unix_socket', 'auth_socket') // DROP PROCEDURE
debian_plugin_install//
https://github.com/ottok/mariadb-10.0/blob/master/debian/mariadb-server-10.0.postinst#L179
Pull requests appreciated :)