List:Commits« Previous MessageNext Message »
From:Chuck Bell Date:August 3 2011 6:17pm
Subject:bzr push into mysql-5.5 branch (chuck.bell:3485 to 3486) WL#5710
View as plain text  
 3486 Chuck Bell	2011-08-03
      WL#5710 : enable and disable plugins
      
      This patch adds checks to ensure the $MYSQLD, $MYSQL_MY_PRINT_DEFAULTS
      environment variables are set. If not, the test is skipped.

    modified:
      mysql-test/t/mysql_plugin.test
 3485 Chuck Bell	2011-08-03
      WL#5710 : enable and disable plugins
      
      This patch corrects the --my-print-defaults option error in the 
      mysql_plugin test file.

    modified:
      mysql-test/t/mysql_plugin.test
=== modified file 'mysql-test/t/mysql_plugin.test'
--- a/mysql-test/t/mysql_plugin.test	2011-08-03 12:46:06 +0000
+++ b/mysql-test/t/mysql_plugin.test	2011-08-03 18:00:33 +0000
@@ -21,9 +21,12 @@ perl;
 use File::Basename;
   my ($mysqld)= split " ", $ENV{MYSQLD_BOOTSTRAP_CMD};
   my $mysqld_basedir=dirname($mysqld);
+  my $my_print_defaults= $ENV{MYSQL_MY_PRINT_DEFAULTS};
+  my $my_print_defaults_basedir=dirname($my_print_defaults);
   open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mysqld.inc") or die;
   print FILE "let \$MYSQLD= $mysqld;\n";
   print FILE "let \$MYSQLD_BASEDIR= $mysqld_basedir;\n";
+  print FILE "let \$MYSQL_MY_PRINT_DEFAULTS_BASEDIR= $my_print_defaults_basedir;\n";
   close FILE;
 EOF
 
@@ -40,7 +43,21 @@ remove_file $MYSQL_TMP_DIR/mysqld.inc;
 # The mysql_plugin tool now accepts --my-print-defaults which points to the executable my_print_defaults.exe
 # we can get this path from the variable $MYSQL_MY_PRINT_DEFAULTS.
 
-let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS;
+# Now we do a sanity check and skip if something is wrong.
+
+# Check for my_print_defaults location. Skip if not found.
+if ($MYSQL_MY_PRINT_DEFAULTS_BASEDIR == '')
+{
+  --skip Test requires known location of my_print_defaults executable.
+}
+
+# Check for mysqld location. Skip if not found.
+if ($MYSQLD == '')
+{
+  --skip Test requires known location of mysqld executable.
+}
+
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
 
 --echo #
 --echo # Ensure the plugin isn't loaded.
@@ -155,28 +172,28 @@ EOF
 --echo # 
 --echo # Attempt to use bad paths - datadir
 --echo #
-let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=/data_not_there/ --basedir=$MYSQL_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS;
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=/data_not_there/ --basedir=$MYSQL_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
 --error 1,2,256
 --exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1
 
 --echo # 
 --echo # Attempt to use bad paths - basedir
 --echo #
-let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=/basedir_not_there/ --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS;
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=/basedir_not_there/ --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
 --error 1,2,256
 --exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1
 
 --echo # 
 --echo # Attempt to use bad paths - plugin_dir
 --echo #
-let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=/plugin_not_there/ --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS;
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=/plugin_not_there/ --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
 --error 1,2,256
 --exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1
 
 --echo # 
 --echo # Attempt to use bad paths - mysqld
 --echo #
-let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=/mysqld_not_there/ --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS;
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=/mysqld_not_there/ --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
 --error 1,2,256
 --exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1
 
@@ -191,35 +208,35 @@ let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN
 --echo # 
 --echo # Missing library
 --echo #
-let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --plugin-ini=$MYSQL_TEST_DIR/include/daemon_example_bad_soname.ini --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS;
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --plugin-ini=$MYSQL_TEST_DIR/include/daemon_example_bad_soname.ini --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
 --error 1,2,256
 --exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1
 
 --echo # 
 --echo # Bad format for config file
 --echo #
-let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --plugin-ini=$MYSQL_TEST_DIR/include/daemon_example_bad_format.ini --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS;
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --plugin-ini=$MYSQL_TEST_DIR/include/daemon_example_bad_format.ini --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
 --error 1,2,256
 --exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1
 
 --echo # 
 --echo # Missing base_dir option
 --echo #
-let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS;
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
 --error 1,2,139,256
 --exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1
 
 --echo # 
 --echo # Missing data_dir option
 --echo #
-let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --basedir=$MYSQL_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS;
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --basedir=$MYSQL_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
 --error 1,2,139,256
 --exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1
 
 --echo # 
 --echo # Missing plugin_dir option
 --echo #
-let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQL_DATADIR --basedir=$MYSQL_BASEDIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS;
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQL_DATADIR --basedir=$MYSQL_BASEDIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
 --error 1,2,139,256
 --exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5 branch (chuck.bell:3485 to 3486) WL#5710Chuck Bell4 Aug