List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:October 9 2012 11:12am
Subject:bzr push into mysql-5.6-wl6055 branch (bjorn.munch:4383 to 4385) Bug#14735440
View as plain text  
 4385 Bjorn Munch	2012-10-09
      Bug #14735440 WRONG WARNING MESSAGES SHOWN WHEN MYSQL_INSTALL_DB IS RUN
        Changed wording slightly, just sdaying /etc/my.cnf (or whatever) will be used

    modified:
      scripts/mysql_install_db.pl.in
 4384 Bjorn Munch	2012-10-09
      Bug #14735448 NEW MY.CNF NOT CREATED WHEN --DEFAULTS-FILE IS USED WITH MYSQL_INSTALL_DB
        Changed the behaviour so the new default file is always created

    modified:
      scripts/mysql_install_db.pl.in
 4383 Bjorn Munch	2012-10-08
      Force new build

=== modified file 'scripts/mysql_install_db.pl.in'
--- a/scripts/mysql_install_db.pl.in	2012-10-08 09:18:50 +0000
+++ b/scripts/mysql_install_db.pl.in	2012-10-09 11:09:29 +0000
@@ -419,46 +419,49 @@ if ( ! $print_defaults )
 my $config_file;
 my $copy_cfg_file;
 
-if ( $opt->{'defaults-file'} )
-{
-  $config_file= $opt->{'defaults-file'};
-}
-else
-{
 # ----------------------------------------------------------------------
 # This will be the default config file
 # ----------------------------------------------------------------------
 
-  $config_file= "$basedir/my.cnf";
+$config_file= "$basedir/my.cnf";
 
-  my $cfg_template= find_in_basedir($opt,"file","my-default.cnf",
+my $cfg_template= find_in_basedir($opt,"file","my-default.cnf",
 				  "share","share/mysql","support-files");
-  -e $cfg_template or cannot_find_file("my-default.cnf");
+-e $cfg_template or cannot_find_file("my-default.cnf");
 
-  $copy_cfg_file= $config_file;
-  if (-e $copy_cfg_file)
-  {
-    $copy_cfg_file =~ s/my.cnf/my-new.cnf/;
-    # Too early to print warning here, the user may not notice
-  }
-  open (TEMPL, $cfg_template) or error("Could not open config template");
-  open (CFG, "> $copy_cfg_file") or error("Could not open config file");
-  while (<TEMPL>)
-  {
-    # Remove lines beginning with # *** which are template comments
-    print CFG $_ unless /^# \*\*\*/;
-  }
-  close CFG;
-  close TEMPL;
+$copy_cfg_file= $config_file;
+if (-e $copy_cfg_file)
+{
+  $copy_cfg_file =~ s/my.cnf/my-new.cnf/;
+  # Too early to print warning here, the user may not notice
+}
+open (TEMPL, $cfg_template) or error("Could not open config template");
+open (CFG, "> $copy_cfg_file") or error("Could not open config file");
+while (<TEMPL>)
+{
+  # Remove lines beginning with # *** which are template comments
+  print CFG $_ unless /^# \*\*\*/;
 }
+close CFG;
+close TEMPL;
 
 # ----------------------------------------------------------------------
 # Now we can get arguments from the groups [mysqld] and [mysql_install_db]
 # in the my.cfg file, then re-run to merge with command line arguments.
 # ----------------------------------------------------------------------
 
+my $print_def_file;
+if ( $opt->{'defaults-file'} )
+{
+  $config_file= $opt->{'defaults-file'};
+}
+else
+{
+  $print_def_file= $config_file;
+}
+
 my @default_options;
-my $cmd = quote_options($print_defaults,"--defaults-file=$config_file",
+my $cmd = quote_options($print_defaults,"--defaults-file=$print_def_file",
                         "mysqld","mysql_install_db");
 open(PIPE, "$cmd |") or error($opt,"can't run $cmd: $!");
 while ( <PIPE> )
@@ -620,15 +623,16 @@ push(@args, "--user=$opt->{user}") if $o
 
 # FIXME use --init-file instead of --bootstrap ?!
 
-my $defaults_option;
+my $defaults_option = "";
 if ( $opt->{'no-defaults'} )
 {
   $defaults_option= "--no-defaults";
 }
-else
+elsif ( $opt->{'defaults-file'} )
 {
-  $defaults_option= "--defaults-file=$config_file";
+  $defaults_option= "--defaults-file=$opt->{'defaults-file'}";
 }
+
 my $defaults_extra= "--defaults-extra-file=$opt->{'defaults-extra-file'}"
   if $opt->{'defaults-extra-file'};
 
@@ -795,24 +799,22 @@ if ( open(PIPE, "| $mysqld_install_cmd_l
            "",
            "Support MySQL by buying support/licenses at http://shop.mysql.com");
 
-    unless ( $opt->{'defaults-file'} )
+    if ($copy_cfg_file eq $config_file)
+    {
+      report($opt,
+	     "New default config file was created as $config_file and",
+	     "will be used by default by the server when you start it.",
+	     "You may edit this file to change server settings");
+    }
+    else
     {
-      if ($copy_cfg_file eq $config_file)
-      {
-	report($opt,
-	       "New default config file was created as $config_file and",
-	       "will be used by the server when you start it.",
-	       "You may edit this file to change server settings");
-      }
-      else
-      {
-	warning($opt,
-		"Found existing config file $config_file on the system.",
-		"Because this file might be in use, it was not replaced,",
-		"but was used in bootstrap and when you later start the server",
-		"The new default config file was created as $copy_cfg_file,",
-	        "please compare it with your file and take the changes you need.");
-      }
+      warning($opt,
+	      "Found existing config file $config_file on the system.",
+	      "Because this file might be in use, it was not replaced,",
+	      "but was used in bootstrap (unless you used --defaults-file)",
+	      "and when you later start the server.",
+	      "The new default config file was created as $copy_cfg_file,",
+	      "please compare it with your file and take the changes you need.");
     }
     foreach my $cfg ( "/etc/my.cnf", "/etc/mysql/my.cnf" )
     {
@@ -863,7 +865,7 @@ sub check_sys_cfg_file
   {
     warning($opt,
 	    "Default config file $fname exists on the system",
-	    "This takes precendence over the installed $config_file",
+	    "This file will be read by default by the MySQL server",
 	    "If you do not want to use this, either remove it, or use the",
 	    "--defaults-file argument to mysqld_safe when starting the server");
   }

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.6-wl6055 branch (bjorn.munch:4383 to 4385) Bug#14735440Bjorn Munch9 Oct