MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:June 19 2009 12:52pm
Subject:bzr commit into mysql-5.0-bugteam branch (joro:2778) Bug#36654
View as plain text  
#At file:///Users/kgeorge/mysql/work/B36654-5.0-bugteam/ based on revid:alexey.kopytov@stripped

 2778 Georgi Kodinov	2009-06-19
      Bug #36654: mysqld_multi cannot start instances with different versions 
      occasionally.
      
      mysql_multi can call mysqld_safe. In doing this it's not changing the 
      current working directory. This may cause confusion in the case where 
      mysqld_multi is handling instances of servers of different versions 
      and the current working directory is the installation directory of one 
      of these servers.
      
      Fixed by enhancing the meaning of basedir in [mysqldN] sections of 
      mysqld_multi. If specified, mysqld_multi will change the current 
      working directory to the basedir directory before starting the server 
      in mysqld_multi ... start ... and then change it back to what it was.
     @ scripts/mysqld_multi.sh
        Bug #36654: optionally preserve, change and restore the cwd when 
        starting server instances

    modified:
      scripts/mysqld_multi.sh
=== modified file 'scripts/mysqld_multi.sh'
--- a/scripts/mysqld_multi.sh	2009-04-02 15:29:28 +0000
+++ b/scripts/mysqld_multi.sh	2009-06-19 12:52:20 +0000
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 
 use Getopt::Long;
-use POSIX qw(strftime);
+use POSIX qw(strftime getcwd);
 
 $|=1;
 $VER="2.16";
@@ -295,6 +295,7 @@ sub start_mysqlds()
   {
     @options = defaults_for_group($groups[$i]);
 
+    $basedir_found= 0; # The default
     $mysqld_found= 1; # The default
     $mysqld_found= 0 if (!length($mysqld));
     $com= "$mysqld";
@@ -310,6 +311,14 @@ sub start_mysqlds()
 	$com= $options[$j];
         $mysqld_found= 1;
       }
+      elsif ("--basedir=" eq substr($options[$j], 0, 10))
+      {
+        $basedir= $options[$j];
+        $basedir =~ s/^--basedir=//;
+        $basedir_found= 1;
+        $options[$j]= quote_shell_word($options[$j]);
+        $tmp.= " $options[$j]";
+      }
       else
       {
 	$options[$j]= quote_shell_word($options[$j]);
@@ -337,7 +346,16 @@ sub start_mysqlds()
       print "group [$groups[$i]] separately.\n";
       exit(1);
     }
+    if ($basedir_found)
+    {
+      $curdir=getcwd();
+      chdir($basedir) or die "Can't change to datadir $basedir";
+    }
     system($com);
+    if ($basedir_found)
+    {
+      chdir($curdir) or die "Can't change back to original dir $curdir";
+    }
   }
   if (!$i && !$opt_no_log)
   {


Attachment: [text/bzr-bundle] bzr/joro@sun.com-20090619125220-yfisq2tjvwuznxvu.bundle
Thread
bzr commit into mysql-5.0-bugteam branch (joro:2778) Bug#36654Georgi Kodinov19 Jun