Commit 8447edb7 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

Specify a new client_plugindir path, to be used during testing

When testing installed packages, the client (mariadb or mysql) can have
plugins stored in a separate location compared to server. This change
ensures that the correct paths are used for the plugin-dir directive in
the my.cnf generated by mysql-test-run.

The directives in my.cnf will be replaced like so:

[client]
plugin-dir=$client_plugindir

[mysqld]
plugin-dir=$plugindir

where $<variable-name> corresponds to the variable name in mtr.
parent 609a9312
......@@ -3,9 +3,6 @@
# when running tests - not to depend on the current machine localization.
#
[client]
plugin-dir=@mysqld.1.plugin-dir
[mysql]
default-character-set=latin1
......
......@@ -216,6 +216,7 @@ my @mysqld_rules=
my @client_rules=
(
{ 'character-sets-dir' => \&fix_charset_dir },
{ 'plugin-dir' => sub { $::client_plugindir } },
);
......
......@@ -130,6 +130,7 @@ our $path_testlog;
our $default_vardir;
our $opt_vardir; # Path to use for var/ dir
our $plugindir;
our $client_plugindir;
my $path_vardir_trace; # unix formatted opt_vardir for trace files
my $opt_tmpdir; # Path to use for tmp/ dir
my $opt_tmpdir_pid;
......@@ -2784,12 +2785,15 @@ sub setup_vardir() {
# and make them world readable
copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022");
# create a plugin dir and copy or symlink plugins into it
unless($plugindir)
{
# create a plugin dir and copy or symlink plugins into it
if ($source_dist)
{
$plugindir="$opt_vardir/plugins";
# Source builds collect both client plugins and server plugins in the
# same directory.
$client_plugindir= $plugindir;
mkpath($plugindir);
if (IS_WINDOWS)
{
......@@ -2845,10 +2849,18 @@ sub setup_vardir() {
<$bindir/lib/plugin/*.so>, # bintar
<$bindir/lib/plugin/*.dll>)
{
my $pname=basename($_);
my $pname= basename($_);
set_plugin_var($pname);
$plugindir=dirname($_) unless $plugindir;
$plugindir= dirname($_) unless $plugindir;
}
# Note: client plugins can be installed separately from server plugins,
# as is the case for Debian packaging.
for (<$bindir/lib/*/libmariadb3/plugin>)
{
$client_plugindir= $_ if <$_/*.so>;
}
$client_plugindir= $plugindir unless $client_plugindir;
}
}
......
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