Skip to content

Commit 2a11661

Browse files
committed
automerge
2 parents 81dbbd6 + c5d904e commit 2a11661

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

scripts/mysqld_multi.sh

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/perl
22

33
use Getopt::Long;
4-
use POSIX qw(strftime);
4+
use POSIX qw(strftime getcwd);
55

66
$|=1;
77
$VER="2.16";
@@ -295,6 +295,7 @@ sub start_mysqlds()
295295
{
296296
@options = defaults_for_group($groups[$i]);
297297

298+
$basedir_found= 0; # The default
298299
$mysqld_found= 1; # The default
299300
$mysqld_found= 0 if (!length($mysqld));
300301
$com= "$mysqld";
@@ -310,6 +311,14 @@ sub start_mysqlds()
310311
$com= $options[$j];
311312
$mysqld_found= 1;
312313
}
314+
elsif ("--basedir=" eq substr($options[$j], 0, 10))
315+
{
316+
$basedir= $options[$j];
317+
$basedir =~ s/^--basedir=//;
318+
$basedir_found= 1;
319+
$options[$j]= quote_shell_word($options[$j]);
320+
$tmp.= " $options[$j]";
321+
}
313322
else
314323
{
315324
$options[$j]= quote_shell_word($options[$j]);
@@ -337,7 +346,16 @@ sub start_mysqlds()
337346
print "group [$groups[$i]] separately.\n";
338347
exit(1);
339348
}
349+
if ($basedir_found)
350+
{
351+
$curdir=getcwd();
352+
chdir($basedir) or die "Can't change to datadir $basedir";
353+
}
340354
system($com);
355+
if ($basedir_found)
356+
{
357+
chdir($curdir) or die "Can't change back to original dir $curdir";
358+
}
341359
}
342360
if (!$i && !$opt_no_log)
343361
{

0 commit comments

Comments
 (0)