1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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 "--"
This commit is contained in:
Bjorn Munch
2011-01-27 14:42:08 +01:00
parent 4e5438ef45
commit 6d28807270
4 changed files with 27 additions and 6 deletions

View File

@ -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