Commit cc0205cf authored by Otto Kekäläinen's avatar Otto Kekäläinen Committed by Vladislav Vaintroub

MDEV-19917: Install Spider with a simple spider.cnf

To install Spider one can simply drop a /etc/mysql/conf.d/spider.cnf like

  [mariadb]
  plugin-load-add=ha_spider.so

This is automatically generated and installed when plugin is correctly
registered to plugin.cmake with its own component name. Many other plugins
such as Connect and RocksDB install in the same way.

This solved MDEV-19917 as the mere adding and removing of spider.cnf
automatically installs and uninstalls it.

Remove the overly complex and uncecessary install.sql from Spider,
if should not be needed in modern times anymore.

With this change there is no need for a uninstall.sql either.
parent aaaf005c
etc/mysql/conf.d/spider.cnf etc/mysql/mariadb.conf.d
usr/lib/mysql/plugin/ha_spider.so usr/lib/mysql/plugin/ha_spider.so
usr/share/mysql/install_spider.sql
#!/bin/sh
set -e
# Install Spider
mysql --defaults-file=/etc/mysql/debian.cnf < /usr/share/mysql/install_spider.sql || true
# Always exit with success instead of leaving dpkg in a broken state
#DEBHELPER#
...@@ -50,11 +50,8 @@ ELSEIF(PLUGIN_PARTITION MATCHES "^NO$") ...@@ -50,11 +50,8 @@ ELSEIF(PLUGIN_PARTITION MATCHES "^NO$")
ELSE() ELSE()
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/spider/hs_client) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/spider/hs_client)
INSTALL(FILES MYSQL_ADD_PLUGIN(spider ${SPIDER_SOURCES}
${CMAKE_SOURCE_DIR}/storage/spider/scripts/install_spider.sql STORAGE_ENGINE COMPONENT spider-engine MODULE_ONLY MODULE_OUTPUT_NAME "ha_spider")
DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server
)
MYSQL_ADD_PLUGIN(spider ${SPIDER_SOURCES} STORAGE_ENGINE MODULE_ONLY MODULE_OUTPUT_NAME "ha_spider")
IF(NOT TARGET spider) IF(NOT TARGET spider)
RETURN() RETURN()
ENDIF() ENDIF()
......
# Copyright (C) 2010-2019 Kentoku Shiba
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
drop procedure if exists mysql.spider_plugin_installer;
delimiter //
create procedure mysql.spider_plugin_installer()
begin
set @win_plugin := IF(@@version_compile_os like 'Win%', 1, 0);
set @have_spider_i_s_plugin := 0;
select @have_spider_i_s_plugin := 1 from INFORMATION_SCHEMA.plugins where PLUGIN_NAME = 'SPIDER';
set @have_spider_plugin := 0;
select @have_spider_plugin := 1 from mysql.plugin where name = 'spider';
if @have_spider_i_s_plugin = 0 then
if @have_spider_plugin = 1 then
-- spider plugin is present in mysql.plugin but not in
-- information_schema.plugins. Remove spider plugin entry
-- in mysql.plugin first.
delete from mysql.plugin where name = 'spider';
end if;
-- Install spider plugin
if @win_plugin = 0 then
install plugin spider soname 'ha_spider.so';
else
install plugin spider soname 'ha_spider.dll';
end if;
end if;
end;//
delimiter ;
call mysql.spider_plugin_installer;
drop procedure mysql.spider_plugin_installer;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment