diff options
author | unknown <jani@ua141d10.elisa.omakaista.fi> | 2005-04-26 16:16:38 +0300 |
---|---|---|
committer | unknown <jani@ua141d10.elisa.omakaista.fi> | 2005-04-26 16:16:38 +0300 |
commit | 5ac5febb1d0c4e311c6abb46ec06645ef91885d0 (patch) | |
tree | c3450c83b6bc085b3bef1ec9c815097eb57b0fb5 /scripts | |
parent | f50739e1aa01e03ed41533b17d1da91223da4834 (diff) | |
download | mariadb-git-5ac5febb1d0c4e311c6abb46ec06645ef91885d0.tar.gz |
Fixed Bug#6221, "mysqld_multi doesn't read the init_connect
option in my.cnf correctly"
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysqld_multi.sh | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index e4895ae4bef..8c363836a25 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,7 +4,7 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.13"; +$VER="2.14"; $opt_config_file = undef(); $opt_example = 0; @@ -160,6 +160,31 @@ sub main } #### +#### Quote option argument. Add double quotes around the argument +#### and escape the following: $, \, " +#### This function is needed, because my_print_defaults drops possible +#### quotes, single or double, from in front of an argument and from +#### the end. +#### + +sub quote_opt_arg +{ + my ($option)= @_; + + if ($option =~ m/(\-\-[a-zA-Z0-9\_\-]+)=(.*)/) + { + $option= $1; + $arg= $2; + $arg=~ s/\\/\\\\/g; # Escape escape character first to avoid doubling. + $arg=~ s/\$/\\\$/g; + $arg=~ s/\"/\\\"/g; + $arg= "\"" . $arg . "\""; + $option= $option . "=" . $arg; + } + return $option; +} + +#### #### Init log file. Check for appropriate place for log file, in the following #### order my_print_defaults mysqld datadir, @datadir@, /var/log, /tmp #### @@ -293,6 +318,7 @@ sub start_mysqlds() else { $options[$j]=~ s/;/\\;/g; + $options[$j]= quote_opt_arg($options[$j]); $tmp.= " $options[$j]"; } } |