summaryrefslogtreecommitdiff
path: root/mysql-test/lib/My/SafeProcess.pm
diff options
context:
space:
mode:
authorBjorn Munch <bjorn.munch@oracle.com>2011-01-27 14:42:08 +0100
committerBjorn Munch <bjorn.munch@oracle.com>2011-01-27 14:42:08 +0100
commit215efed133075d3d815fffa741ff8bb45b631e4e (patch)
tree11f07df1693583c8bc8424db7032f2ca2d8db580 /mysql-test/lib/My/SafeProcess.pm
parent4bc23a061cef249c36fa6564a2efb1bc7939ba18 (diff)
downloadmariadb-git-215efed133075d3d815fffa741ff8bb45b631e4e.tar.gz
Bug #59489 Enable setting of env. variables for mysqld from mtr
Added --mysqld-env option, propagate via safe_process Simplified: should be safe to set in parent safe_process after it's started Addendum: catch cases of --mysqld-env w/o value, assume env.var name never begins with "--"
Diffstat (limited to 'mysql-test/lib/My/SafeProcess.pm')
-rw-r--r--mysql-test/lib/My/SafeProcess.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm
index f87b7b60bd6..14153982d4e 100644
--- a/mysql-test/lib/My/SafeProcess.pm
+++ b/mysql-test/lib/My/SafeProcess.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -139,6 +139,7 @@ sub new {
my $host = delete($opts{'host'});
my $shutdown = delete($opts{'shutdown'});
my $user_data= delete($opts{'user_data'});
+ my $envs = delete($opts{'envs'});
# if (defined $host) {
# $safe_script= "lib/My/SafeProcess/safe_process_cpcd.pl";
@@ -161,6 +162,13 @@ sub new {
# Point the safe_process at the right parent if running on cygwin
push(@safe_args, "--parent-pid=".Cygwin::pid_to_winpid($$)) if IS_CYGWIN;
+ foreach my $env_var (@$envs) {
+ croak("Missing = in env string") unless $env_var =~ /=/;
+ croak("Env string $env_var seen, probably missing value for --mysqld-env")
+ if $env_var =~ /^--/;
+ push @safe_args, "--env $env_var";
+ }
+
push(@safe_args, "--");
push(@safe_args, $path); # The program safe_process should execute