Commit b6773f58 authored by Yuchen Pei's avatar Yuchen Pei

MDEV-31936 Simplify deinit_spider.inc

Spider is part of the server, and there's no need to check the
version.

All spider plugins are uninstalled in clean_up_spider.inc

DROP SERVER IF EXISTS makes things easier
parent ab9b1461
let $SERVER_NAME=
`SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(version(), '-', 2), '-', -1)`;
let $SERVER_MAJOR_VERSION=
`SELECT SUBSTRING_INDEX(version(), '.', 1)`;
let $SERVER_MINOR_VERSION=
`SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(version(), '.', 2), '.', -1)`;
let $PLUGIN_VERSION=
`SELECT SUBSTRING_INDEX(plugin_version, '.', 1)
FROM information_schema.plugins
WHERE plugin_name = 'SPIDER'`;
if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`)
{
let $HAS_REWRITE=
`SELECT IF (STRCMP('$SERVER_NAME', 'MariaDB') = 0,
IF ($SERVER_MAJOR_VERSION = 10,
IF ($SERVER_MINOR_VERSION < 4, 0, 1),
IF ($SERVER_MAJOR_VERSION < 10, 0, 1)),
0)`;
let $HAS_REWRITE= 0;
if ($HAS_REWRITE)
{
DROP FUNCTION spider_flush_rewrite_cache;
UNINSTALL PLUGIN spider_rewrite;
DROP TABLE IF EXISTS mysql.spider_rewrite_tables;
DROP TABLE IF EXISTS mysql.spider_rewrite_table_tables;
DROP TABLE IF EXISTS mysql.spider_rewrite_table_partitions;
DROP TABLE IF EXISTS mysql.spider_rewrite_table_subpartitions;
DROP TABLE IF EXISTS mysql.spider_rewritten_tables;
}
}
--source clean_up_spider.inc
if ($VERSION_COMPILE_OS_WIN)
{
if ($CHILD2_1_MYPORT)
{
DROP SERVER s_2_1;
}
if ($CHILD2_2_MYPORT)
{
DROP SERVER s_2_2;
}
if ($CHILD2_3_MYPORT)
{
DROP SERVER s_2_3;
}
if ($CHILD3_1_MYPORT)
{
DROP SERVER s_3_1;
}
if ($CHILD3_2_MYPORT)
{
DROP SERVER s_3_2;
}
if ($CHILD2_3_MYPORT)
{
DROP SERVER s_3_3;
}
}
if (!$VERSION_COMPILE_OS_WIN)
{
if ($CHILD2_1_MYSOCK)
{
DROP SERVER s_2_1;
}
if ($CHILD2_2_MYSOCK)
{
DROP SERVER s_2_2;
}
if ($CHILD2_3_MYSOCK)
{
DROP SERVER s_2_3;
}
if ($CHILD3_1_MYSOCK)
{
DROP SERVER s_3_1;
}
if ($CHILD3_2_MYSOCK)
{
DROP SERVER s_3_2;
}
if ($CHILD3_3_MYSOCK)
{
DROP SERVER s_3_3;
}
}
DROP SERVER IF EXISTS s_2_1;
DROP SERVER IF EXISTS s_2_2;
DROP SERVER IF EXISTS s_2_3;
DROP SERVER IF EXISTS s_3_1;
DROP SERVER IF EXISTS s_3_2;
DROP SERVER IF EXISTS s_3_3;
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