diff options
author | Otto Kekäläinen <otto@kekalainen.net> | 2020-04-26 22:43:57 +0300 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2020-06-10 13:45:22 +0200 |
commit | cc0205cf86220a2f2427336b34c19bbd66390038 (patch) | |
tree | 2f1e453793615cc79cc59f53ce93af7e594a7bac | |
parent | aaaf005ce61a543f1a1470b179ccb535698b36ef (diff) | |
download | mariadb-git-bb-10.5-MDEV-22841.tar.gz |
MDEV-19917: Install Spider with a simple spider.cnfbb-10.5-MDEV-22841
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.
-rw-r--r-- | debian/mariadb-plugin-spider.install | 2 | ||||
-rw-r--r-- | debian/mariadb-plugin-spider.postinst | 10 | ||||
-rw-r--r-- | storage/spider/CMakeLists.txt | 7 | ||||
-rw-r--r-- | storage/spider/scripts/install_spider.sql | 42 |
4 files changed, 3 insertions, 58 deletions
diff --git a/debian/mariadb-plugin-spider.install b/debian/mariadb-plugin-spider.install index 89652fe2f3c..78f2c44cbd0 100644 --- a/debian/mariadb-plugin-spider.install +++ b/debian/mariadb-plugin-spider.install @@ -1,2 +1,2 @@ +etc/mysql/conf.d/spider.cnf etc/mysql/mariadb.conf.d usr/lib/mysql/plugin/ha_spider.so -usr/share/mysql/install_spider.sql diff --git a/debian/mariadb-plugin-spider.postinst b/debian/mariadb-plugin-spider.postinst deleted file mode 100644 index d4ddaa53156..00000000000 --- a/debian/mariadb-plugin-spider.postinst +++ /dev/null @@ -1,10 +0,0 @@ -#!/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# diff --git a/storage/spider/CMakeLists.txt b/storage/spider/CMakeLists.txt index 706b11ac141..2c3573c3709 100644 --- a/storage/spider/CMakeLists.txt +++ b/storage/spider/CMakeLists.txt @@ -50,11 +50,8 @@ ELSEIF(PLUGIN_PARTITION MATCHES "^NO$") ELSE() INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/spider/hs_client) - INSTALL(FILES - ${CMAKE_SOURCE_DIR}/storage/spider/scripts/install_spider.sql - DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server - ) - MYSQL_ADD_PLUGIN(spider ${SPIDER_SOURCES} STORAGE_ENGINE MODULE_ONLY MODULE_OUTPUT_NAME "ha_spider") + MYSQL_ADD_PLUGIN(spider ${SPIDER_SOURCES} + STORAGE_ENGINE COMPONENT spider-engine MODULE_ONLY MODULE_OUTPUT_NAME "ha_spider") IF(NOT TARGET spider) RETURN() ENDIF() diff --git a/storage/spider/scripts/install_spider.sql b/storage/spider/scripts/install_spider.sql deleted file mode 100644 index 403bd99fd68..00000000000 --- a/storage/spider/scripts/install_spider.sql +++ /dev/null @@ -1,42 +0,0 @@ -# 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; |