List:Commits« Previous MessageNext Message »
From:Chuck Bell Date:July 29 2011 3:52pm
Subject:bzr push into mysql-5.5 branch (chuck.bell:3481 to 3482) WL#5710
View as plain text  
 3482 Chuck Bell	2011-07-29
      WL#5710 : enable and disable plugins
      
      This patch adds code to check access to the --mysqld and 
      --my-print-defaults paths if provided.

    modified:
      client/mysql_plugin.c
      mysql-test/r/mysql_plugin.result
      mysql-test/t/mysql_plugin.test
 3481 Saikumar V	2011-07-29
      Fixed one negative test path.

    modified:
      mysql-test/t/mysql_plugin.test
=== modified file 'client/mysql_plugin.c'
--- a/client/mysql_plugin.c	2011-07-28 18:18:07 +0000
+++ b/client/mysql_plugin.c	2011-07-29 15:47:24 +0000
@@ -922,6 +922,18 @@ static int check_access()
             opt_plugin_ini);
     goto exit;
   }
+  if ((error= my_access(opt_mysqld, F_OK)))
+  {
+    fprintf(stderr, "ERROR: Cannot access mysqld path '%s'.\n",
+            opt_mysqld);
+    goto exit;
+  }
+  if ((error= my_access(opt_my_print_defaults, F_OK)))
+  {
+    fprintf(stderr, "ERROR: Cannot access my-print-defaults path '%s'.\n",
+            opt_my_print_defaults);
+    goto exit;
+  }
 
 exit:
   return error;

=== modified file 'mysql-test/r/mysql_plugin.result'
--- a/mysql-test/r/mysql_plugin.result	2011-07-28 18:18:07 +0000
+++ b/mysql-test/r/mysql_plugin.result	2011-07-29 15:47:24 +0000
@@ -49,6 +49,14 @@ ERROR: Cannot access basedir at '/basedi
 #
 ERROR: Cannot read plugin config file daemon_example. File does not exist.
 # 
+# Attempt to use bad paths - mysqld
+#
+ERROR: Cannot access mysqld path '/not/there/at/all'.
+# 
+# Attempt to use bad paths - my-print-defaults
+#
+ERROR: Cannot access my-print-defaults path '/not/there/at/all'.
+# 
 # Missing library
 #
 ERROR: The plugin library is missing or in a different location.

=== modified file 'mysql-test/t/mysql_plugin.test'
--- a/mysql-test/t/mysql_plugin.test	2011-07-29 09:09:16 +0000
+++ b/mysql-test/t/mysql_plugin.test	2011-07-29 15:47:24 +0000
@@ -26,9 +26,12 @@ EOF
 source $MYSQL_TMP_DIR/mysqld.inc;
 remove_file $MYSQL_TMP_DIR/mysqld.inc;
 
-let $MYSQLD_BASEDIR= $MYSQL_BASEDIR/bin;
---mkdir $MYSQLD_BASEDIR/share
---copy_file $MYSQL_BASEDIR/share/english/errmsg.sys $MYSQLD_BASEDIR/share/errmsg.sys
+# Here we need to test : if /bin exists do the following 
+#let $MYSQLD_BASEDIR= $MYSQL_BASEDIR/bin;
+#--mkdir $MYSQLD_BASEDIR/share
+#--copy_file $MYSQL_BASEDIR/share/english/errmsg.sys $MYSQLD_BASEDIR/share/errmsg.sys
+# else use /sql
+let $MYSQLD_BASEDIR= $MYSQL_BASEDIR/sql;
 
 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;
 
@@ -163,6 +166,20 @@ let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN
 --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=$MYSQLD_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=$MYSQLD --my_print_defaults=$MYSQL_MY_PRINT_DEFAULTS --mysqld=/not/there/at/all;
+--error 1,2,256
+--exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1
+
+--echo # 
+--echo # Attempt to use bad paths - my-print-defaults
+--echo #
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=$MYSQLD --my_print_defaults=$MYSQL_MY_PRINT_DEFAULTS --my-print-defaults=/not/there/at/all;
+--error 1,2,256
+--exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1
+
 --echo # 
 --echo # Missing library
 --echo #

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