#At file:///home/saikumar/work/opt-test/mysql-5.5-wl-5710/ based on revid:chuck.bell@stripped
3485 Saikumar V 2011-08-02
Correct errmsg path to be picked up dynamically rather than static.
modified:
mysql-test/t/mysql_plugin.test
=== modified file 'mysql-test/t/mysql_plugin.test'
--- a/mysql-test/t/mysql_plugin.test 2011-08-01 09:50:59 +0000
+++ b/mysql-test/t/mysql_plugin.test 2011-08-02 13:46:35 +0000
@@ -7,28 +7,38 @@
# Add the datadir, basedir, plugin_dir to the bootstrap command
let $MYSQLD_DATADIR= `select @@datadir`;
let $MYSQL_BASEDIR= `select @@basedir`;
+let $MYSQL_ERRMSG_BASEDIR=`select @@lc_messages_dir`;
-# The mysql_plugin tool expects all executables in "basedir", so they will be copied to it.
-# It also expects a directory structure like in the installed mysql version, so errmsg.sys
-# will be copied to "basedir/share".
--disable_abort_on_error
# The mysql_plugin tool now accepts --mysqld the path to mysqld server,
# the mysqld path is extracted from MYSQLD_BOOTSTRAP_CMD line.
-# The directories differ between Windows and Unix.
+# We also extract the path of MYSQLD_BASEDIR (where mysql exists) and use it for the errmsg file.
+# The directories differ between Windows and Unix but the below perl script
+# will pick as per platform.
+
perl;
+use File::Basename;
my ($mysqld)= split " ", $ENV{MYSQLD_BOOTSTRAP_CMD};
+ my $mysqld_basedir=dirname($mysqld);
open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mysqld.inc") or die;
print FILE "let \$MYSQLD= $mysqld;\n";
+ print FILE "let \$MYSQLD_BASEDIR= $mysqld_basedir;\n";
close FILE;
EOF
+
source $MYSQL_TMP_DIR/mysqld.inc;
remove_file $MYSQL_TMP_DIR/mysqld.inc;
-let $MYSQLD_BASEDIR= $MYSQL_BASEDIR/bin;
+# The mysql_plugin tool expects a directory structure like in the installed mysql version, so errmsg.sys
+# will be copied to "basedir/share", we create and remove this structure.
+
--mkdir $MYSQLD_BASEDIR/share
---copy_file $MYSQL_BASEDIR/share/english/errmsg.sys $MYSQLD_BASEDIR/share/errmsg.sys
+--copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_BASEDIR/share/errmsg.sys
+
+# 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=$MYSQL_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --mysqld=$MYSQLD --my_print_defaults=$MYSQL_MY_PRINT_DEFAULTS;
@@ -239,6 +249,7 @@ EOF
--error 0,1
--remove_file $expect_file
+# Cleanup the share folder in the binary path.
--remove_file $MYSQLD_BASEDIR/share/errmsg.sys
--rmdir $MYSQLD_BASEDIR/share
Attachment: [text/bzr-bundle] bzr/saikumar.v@oracle.com-20110802134635-lj8qqa82zia7uem8.bundle
| Thread |
|---|
| • bzr commit into mysql-5.5 branch (saikumar.v:3485) | Saikumar V | 3 Aug |