← Back to team overview

maria-developers team mailing list archive

bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (knielsen:2786)

 

#At lp:maria

 2786 knielsen@xxxxxxxxxxxxxxx	2010-01-04 [merge]
      Merge mysql-test-run.pl fix for plugin detection.
      modified:
        mysql-test/mysql-test-run.pl

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2010-01-04 08:47:15 +0000
+++ b/mysql-test/mysql-test-run.pl	2010-01-04 12:26:56 +0000
@@ -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...");
   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
 # 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=".
     ($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
   # ----------------------------------------------------