Commit 5d5746bd authored by Bjorn Munch's avatar Bjorn Munch

Bug #11750417 40942: UNABLE TO INSTALL FEDERATED PLUGIN

  Link plugin with a copy of string.o
  Copied test from 5.5 but this was dysfunctional, made it work
  Also tested on Windows
parent 699b3b84
if (`select plugin_library IS NULL from information_schema.plugins where plugin_name LIKE '%federated%'`)
{
--skip federated plugin not available
}
...@@ -1979,6 +1979,24 @@ sub environment_setup { ...@@ -1979,6 +1979,24 @@ sub environment_setup {
$ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=EXAMPLE=".$plugin_filename; $ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=EXAMPLE=".$plugin_filename;
} }
# --------------------------------------------------------------------------
# Add the path where mysqld will find ha_federated.so
# --------------------------------------------------------------------------
my $fedplug_filename;
if (IS_WINDOWS) {
$fedplug_filename = "ha_federated.dll";
} else {
$fedplug_filename = "ha_federated.so";
}
my $lib_fed_plugin=
mtr_file_exists(vs_config_dirs('storage/federated',$fedplug_filename),
"$basedir/storage/federated/.libs/".$fedplug_filename,
"$basedir/lib/mysql/plugin/".$fedplug_filename);
$ENV{'FEDERATED_PLUGIN'}= $fedplug_filename;
$ENV{'FEDERATED_PLUGIN_DIR'}=
($lib_fed_plugin ? dirname($lib_fed_plugin) : "");
# ---------------------------------------------------- # ----------------------------------------------------
# Add the path where mysqld will find mypluglib.so # Add the path where mysqld will find mypluglib.so
# ---------------------------------------------------- # ----------------------------------------------------
......
--plugin_dir=$FEDERATED_PLUGIN_DIR
--loose-federated=ON
CREATE TABLE t2(a int);
CREATE TABLE t1(a int) ENGINE=FEDERATED
CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/t2';
Warnings:
Warning 1286 Unknown table engine 'FEDERATED'
Warning 1266 Using storage engine MyISAM for table 't1'
DROP TABLE t1;
INSTALL PLUGIN federated SONAME 'FEDERATED_PLUGIN';
INSTALL PLUGIN FEDERATED SONAME 'FEDERATED_PLUGIN';
ERROR HY000: Function 'FEDERATED' already exists
UNINSTALL PLUGIN federated;
INSTALL PLUGIN federated SONAME 'FEDERATED_PLUGIN';
CREATE TABLE t1(a int) ENGINE=FEDERATED
CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/t2';
DROP TABLE t1;
UNINSTALL PLUGIN federated;
UNINSTALL PLUGIN federated;
ERROR 42000: PLUGIN federated does not exist
DROP TABLE t2;
--source include/have_federated_plugin.inc
connect (master,localhost,root,,test,$MASTER_MYPORT,);
connect (slave,localhost,root,,test,$SLAVE_MYPORT,);
connection master;
CREATE TABLE t2(a int);
connection slave;
CREATE TABLE t1(a int) ENGINE=FEDERATED
CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/t2';
DROP TABLE t1;
--replace_result $FEDERATED_PLUGIN FEDERATED_PLUGIN
eval INSTALL PLUGIN federated SONAME '$FEDERATED_PLUGIN';
--replace_result $FEDERATED_PLUGIN FEDERATED_PLUGIN
--error ER_UDF_EXISTS
eval INSTALL PLUGIN FEDERATED SONAME '$FEDERATED_PLUGIN';
UNINSTALL PLUGIN federated;
--replace_result $FEDERATED_PLUGIN FEDERATED_PLUGIN
eval INSTALL PLUGIN federated SONAME '$FEDERATED_PLUGIN';
CREATE TABLE t1(a int) ENGINE=FEDERATED
CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/t2';
DROP TABLE t1;
UNINSTALL PLUGIN federated;
--error ER_SP_DOES_NOT_EXIST
UNINSTALL PLUGIN federated;
connection master;
DROP TABLE t2;
...@@ -37,14 +37,14 @@ pkgplugin_LTLIBRARIES = @plugin_federated_shared_target@ ...@@ -37,14 +37,14 @@ pkgplugin_LTLIBRARIES = @plugin_federated_shared_target@
ha_federated_la_LDFLAGS = -module -rpath $(pkgplugindir) ha_federated_la_LDFLAGS = -module -rpath $(pkgplugindir)
ha_federated_la_CXXFLAGS= $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN ha_federated_la_CXXFLAGS= $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_federated_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN ha_federated_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_federated_la_SOURCES = ha_federated.cc ha_federated_la_SOURCES = ha_federated.cc $(top_srcdir)/mysys/string.c
EXTRA_LIBRARIES = libfederated.a EXTRA_LIBRARIES = libfederated.a
noinst_LIBRARIES = @plugin_federated_static_target@ noinst_LIBRARIES = @plugin_federated_static_target@
libfederated_a_CXXFLAGS = $(AM_CXXFLAGS) libfederated_a_CXXFLAGS = $(AM_CXXFLAGS)
libfederated_a_CFLAGS = $(AM_CFLAGS) libfederated_a_CFLAGS = $(AM_CFLAGS)
libfederated_a_SOURCES= ha_federated.cc libfederated_a_SOURCES= ha_federated.cc $(top_srcdir)/mysys/string.c
EXTRA_DIST = CMakeLists.txt plug.in EXTRA_DIST = CMakeLists.txt plug.in
......
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