mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
cleanup: mtr and plugins
* in --parallel mode don't copy/symlinks plugins individually in each forked child's vardir, use the common parent vardir with all plugins * move pam plugin specific code from mysql-test-run.pl to suite/plugins/suite.pm
This commit is contained in:
@ -2580,82 +2580,72 @@ sub setup_vardir() {
|
|||||||
copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022");
|
copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022");
|
||||||
|
|
||||||
# create a plugin dir and copy or symlink plugins into it
|
# create a plugin dir and copy or symlink plugins into it
|
||||||
if ($source_dist)
|
unless($plugindir)
|
||||||
{
|
{
|
||||||
$plugindir="$opt_vardir/plugins";
|
if ($source_dist)
|
||||||
mkpath($plugindir);
|
|
||||||
if (IS_WINDOWS)
|
|
||||||
{
|
{
|
||||||
if (!$opt_embedded_server)
|
$plugindir="$opt_vardir/plugins";
|
||||||
|
mkpath($plugindir);
|
||||||
|
if (IS_WINDOWS)
|
||||||
{
|
{
|
||||||
for (<$bindir/storage/*$opt_vs_config/*.dll>,
|
if (!$opt_embedded_server)
|
||||||
<$bindir/plugin/*$opt_vs_config/*.dll>,
|
{
|
||||||
<$bindir/libmariadb$opt_vs_config/*.dll>,
|
for (<$bindir/storage/*$opt_vs_config/*.dll>,
|
||||||
<$bindir/sql$opt_vs_config/*.dll>)
|
<$bindir/plugin/*$opt_vs_config/*.dll>,
|
||||||
|
<$bindir/libmariadb$opt_vs_config/*.dll>,
|
||||||
|
<$bindir/sql$opt_vs_config/*.dll>)
|
||||||
|
{
|
||||||
|
my $pname=basename($_);
|
||||||
|
copy rel2abs($_), "$plugindir/$pname";
|
||||||
|
set_plugin_var($pname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
my $opt_use_copy= 1;
|
||||||
|
if (symlink "$opt_vardir/run", "$plugindir/symlink_test")
|
||||||
|
{
|
||||||
|
$opt_use_copy= 0;
|
||||||
|
unlink "$plugindir/symlink_test";
|
||||||
|
}
|
||||||
|
|
||||||
|
for (<$bindir/storage/*/*.so>,
|
||||||
|
<$bindir/plugin/*/*.so>,
|
||||||
|
<$bindir/plugin/*/auth_pam_tool_dir>,
|
||||||
|
<$bindir/libmariadb/plugins/*/*.so>,
|
||||||
|
<$bindir/libmariadb/*.so>,
|
||||||
|
<$bindir/sql/*.so>)
|
||||||
{
|
{
|
||||||
my $pname=basename($_);
|
my $pname=basename($_);
|
||||||
copy rel2abs($_), "$plugindir/$pname";
|
if ($opt_use_copy)
|
||||||
|
{
|
||||||
|
copy rel2abs($_), "$plugindir/$pname";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
symlink rel2abs($_), "$plugindir/$pname";
|
||||||
|
}
|
||||||
set_plugin_var($pname);
|
set_plugin_var($pname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
my $opt_use_copy= 1;
|
# hm, what paths work for debs and for rpms ?
|
||||||
if (symlink "$opt_vardir/run", "$plugindir/symlink_test")
|
for (<$bindir/lib64/mysql/plugin/*.so>,
|
||||||
{
|
<$bindir/lib/mysql/plugin/*.so>,
|
||||||
$opt_use_copy= 0;
|
<$bindir/lib64/mariadb/plugin/*.so>,
|
||||||
unlink "$plugindir/symlink_test";
|
<$bindir/lib/mariadb/plugin/*.so>,
|
||||||
}
|
<$bindir/lib/plugin/*.so>, # bintar
|
||||||
|
<$bindir/lib/plugin/*.dll>)
|
||||||
for (<$bindir/plugin/auth_pam/auth_pam_tool>)
|
|
||||||
{
|
|
||||||
mkpath("$plugindir/auth_pam_tool_dir");
|
|
||||||
if ($opt_use_copy)
|
|
||||||
{
|
|
||||||
copy rel2abs($_), "$plugindir/auth_pam_tool_dir/auth_pam_tool"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
symlink rel2abs($_), "$plugindir/auth_pam_tool_dir/auth_pam_tool";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (<$bindir/storage/*/*.so>,
|
|
||||||
<$bindir/plugin/*/*.so>,
|
|
||||||
<$bindir/plugin/*/auth_pam_tool_dir>,
|
|
||||||
<$bindir/libmariadb/plugins/*/*.so>,
|
|
||||||
<$bindir/libmariadb/*.so>,
|
|
||||||
<$bindir/sql/*.so>)
|
|
||||||
{
|
{
|
||||||
my $pname=basename($_);
|
my $pname=basename($_);
|
||||||
if ($opt_use_copy)
|
|
||||||
{
|
|
||||||
copy rel2abs($_), "$plugindir/$pname";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
symlink rel2abs($_), "$plugindir/$pname";
|
|
||||||
}
|
|
||||||
set_plugin_var($pname);
|
set_plugin_var($pname);
|
||||||
|
$plugindir=dirname($_) unless $plugindir;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$plugindir= $mysqld_variables{'plugin-dir'} || '.';
|
|
||||||
# hm, what paths work for debs and for rpms ?
|
|
||||||
for (<$bindir/lib64/mysql/plugin/*.so>,
|
|
||||||
<$bindir/lib/mysql/plugin/*.so>,
|
|
||||||
<$bindir/lib64/mariadb/plugin/*.so>,
|
|
||||||
<$bindir/lib/mariadb/plugin/*.so>,
|
|
||||||
<$bindir/lib/plugin/*.so>, # bintar
|
|
||||||
<$bindir/lib/plugin/*.dll>)
|
|
||||||
{
|
|
||||||
my $pname=basename($_);
|
|
||||||
set_plugin_var($pname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Remove old log files
|
# Remove old log files
|
||||||
foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
|
foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
|
||||||
|
@ -4,6 +4,13 @@ use My::Platform;
|
|||||||
|
|
||||||
@ISA = qw(My::Suite);
|
@ISA = qw(My::Suite);
|
||||||
|
|
||||||
|
if (-d '../sql') {
|
||||||
|
my $src = "$::bindir/plugin/auth_pam/auth_pam_tool";
|
||||||
|
my $dst = "$::plugindir/auth_pam_tool_dir/auth_pam_tool";
|
||||||
|
::mkpath( "$::plugindir/auth_pam_tool_dir");
|
||||||
|
symlink $src, $dst or ::copy $src, $dst;
|
||||||
|
}
|
||||||
|
|
||||||
sub cassandra_running() {
|
sub cassandra_running() {
|
||||||
return 0 if IS_WINDOWS;
|
return 0 if IS_WINDOWS;
|
||||||
system 'echo show version | cqlsh -3 2>/dev/null >/dev/null';
|
system 'echo show version | cqlsh -3 2>/dev/null >/dev/null';
|
||||||
|
Reference in New Issue
Block a user