mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge mysql-test-run.pl fix for plugin detection.
This commit is contained in:
@ -301,6 +301,9 @@ sub main {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check for plugin availability so we know whether to skip tests or not.
|
||||||
|
detect_plugins();
|
||||||
|
|
||||||
mtr_report("Collecting tests...");
|
mtr_report("Collecting tests...");
|
||||||
my $tests= collect_test_cases($opt_suites, \@opt_cases);
|
my $tests= collect_test_cases($opt_suites, \@opt_cases);
|
||||||
|
|
||||||
@ -1877,6 +1880,64 @@ sub have_maria_support () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Detect plugin presense and set environment variables appropriately.
|
||||||
|
# This needs to be done early, so we can know whether to skip tests.
|
||||||
|
sub detect_plugins {
|
||||||
|
# --------------------------------------------------------------------------
|
||||||
|
# Add the path where mysqld will find ha_example.so
|
||||||
|
# --------------------------------------------------------------------------
|
||||||
|
if ($mysql_version_id >= 50100) {
|
||||||
|
my $plugin_filename;
|
||||||
|
if (IS_WINDOWS)
|
||||||
|
{
|
||||||
|
$plugin_filename = "ha_example.dll";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$plugin_filename = "ha_example.so";
|
||||||
|
}
|
||||||
|
my $lib_example_plugin=
|
||||||
|
mtr_file_exists(vs_config_dirs('storage/example',$plugin_filename),
|
||||||
|
"$basedir/storage/example/.libs/".$plugin_filename,
|
||||||
|
"$basedir/lib/mariadb/plugin/".$plugin_filename,
|
||||||
|
"$basedir/lib/mysql/plugin/".$plugin_filename);
|
||||||
|
$ENV{'EXAMPLE_PLUGIN'}=
|
||||||
|
($lib_example_plugin ? basename($lib_example_plugin) : "");
|
||||||
|
$ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=".
|
||||||
|
($lib_example_plugin ? dirname($lib_example_plugin) : "");
|
||||||
|
|
||||||
|
$ENV{'HA_EXAMPLE_SO'}="'".$plugin_filename."'";
|
||||||
|
$ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=EXAMPLE=".$plugin_filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------
|
||||||
|
# Add the path where mysqld will find graph_engine.so
|
||||||
|
# --------------------------------------------------------------------------
|
||||||
|
if ($mysql_version_id >= 50100 && !(IS_WINDOWS && $opt_embedded_server)) {
|
||||||
|
my $plugin_filename;
|
||||||
|
if (IS_WINDOWS)
|
||||||
|
{
|
||||||
|
$plugin_filename = "oqgraph_engine.dll";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$plugin_filename = "oqgraph_engine.so";
|
||||||
|
}
|
||||||
|
my $lib_oqgraph_plugin=
|
||||||
|
mtr_file_exists(vs_config_dirs('storage/oqgraph',$plugin_filename),
|
||||||
|
"$basedir/storage/oqgraph/.libs/".$plugin_filename,
|
||||||
|
"$basedir/lib/mariadb/plugin/".$plugin_filename,
|
||||||
|
"$basedir/lib/mysql/plugin/".$plugin_filename);
|
||||||
|
$ENV{'OQGRAPH_PLUGIN'}=
|
||||||
|
($lib_oqgraph_plugin ? basename($lib_oqgraph_plugin) : "");
|
||||||
|
$ENV{'OQGRAPH_PLUGIN_OPT'}= "--plugin-dir=".
|
||||||
|
($lib_oqgraph_plugin ? dirname($lib_oqgraph_plugin) : "");
|
||||||
|
|
||||||
|
$ENV{'GRAPH_ENGINE_SO'}="'".$plugin_filename."'";
|
||||||
|
$ENV{'OQGRAPH_PLUGIN_LOAD'}="--plugin_load=;OQGRAPH=".$plugin_filename.";";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Set environment to be used by childs of this process for
|
# Set environment to be used by childs of this process for
|
||||||
# things that are constant during the whole lifetime of mysql-test-run
|
# things that are constant during the whole lifetime of mysql-test-run
|
||||||
@ -1935,60 +1996,6 @@ sub environment_setup {
|
|||||||
$ENV{'UDF_EXAMPLE_LIB_OPT'}= "--plugin-dir=".
|
$ENV{'UDF_EXAMPLE_LIB_OPT'}= "--plugin-dir=".
|
||||||
($lib_udf_example ? dirname($lib_udf_example) : "");
|
($lib_udf_example ? dirname($lib_udf_example) : "");
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# Add the path where mysqld will find ha_example.so
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
if ($mysql_version_id >= 50100) {
|
|
||||||
my $plugin_filename;
|
|
||||||
if (IS_WINDOWS)
|
|
||||||
{
|
|
||||||
$plugin_filename = "ha_example.dll";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$plugin_filename = "ha_example.so";
|
|
||||||
}
|
|
||||||
my $lib_example_plugin=
|
|
||||||
mtr_file_exists(vs_config_dirs('storage/example',$plugin_filename),
|
|
||||||
"$basedir/storage/example/.libs/".$plugin_filename,
|
|
||||||
"$basedir/lib/mariadb/plugin/".$plugin_filename,
|
|
||||||
"$basedir/lib/mysql/plugin/".$plugin_filename);
|
|
||||||
$ENV{'EXAMPLE_PLUGIN'}=
|
|
||||||
($lib_example_plugin ? basename($lib_example_plugin) : "");
|
|
||||||
$ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=".
|
|
||||||
($lib_example_plugin ? dirname($lib_example_plugin) : "");
|
|
||||||
|
|
||||||
$ENV{'HA_EXAMPLE_SO'}="'".$plugin_filename."'";
|
|
||||||
$ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=EXAMPLE=".$plugin_filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# Add the path where mysqld will find graph_engine.so
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
if ($mysql_version_id >= 50100 && !(IS_WINDOWS && $opt_embedded_server)) {
|
|
||||||
my $plugin_filename;
|
|
||||||
if (IS_WINDOWS)
|
|
||||||
{
|
|
||||||
$plugin_filename = "oqgraph_engine.dll";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$plugin_filename = "oqgraph_engine.so";
|
|
||||||
}
|
|
||||||
my $lib_oqgraph_plugin=
|
|
||||||
mtr_file_exists(vs_config_dirs('storage/oqgraph',$plugin_filename),
|
|
||||||
"$basedir/storage/oqgraph/.libs/".$plugin_filename,
|
|
||||||
"$basedir/lib/mariadb/plugin/".$plugin_filename,
|
|
||||||
"$basedir/lib/mysql/plugin/".$plugin_filename);
|
|
||||||
$ENV{'OQGRAPH_PLUGIN'}=
|
|
||||||
($lib_oqgraph_plugin ? basename($lib_oqgraph_plugin) : "");
|
|
||||||
$ENV{'OQGRAPH_PLUGIN_OPT'}= "--plugin-dir=".
|
|
||||||
($lib_oqgraph_plugin ? dirname($lib_oqgraph_plugin) : "");
|
|
||||||
|
|
||||||
$ENV{'GRAPH_ENGINE_SO'}="'".$plugin_filename."'";
|
|
||||||
$ENV{'OQGRAPH_PLUGIN_LOAD'}="--plugin_load=;OQGRAPH=".$plugin_filename.";";
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
# Add the path where mysqld will find mypluglib.so
|
# Add the path where mysqld will find mypluglib.so
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user