~muzazzi/ius/mysql56

« back to all changes in this revision

Viewing changes to SOURCES/mysql-install-db-bug-68318.patch

  • Committer: Andrew Garner
  • Date: 2013-02-10 05:39:43 UTC
  • Revision ID: muzazzi@gmail.com-20130210053943-cqr2rebdd8bb879q
fix bug 68318 in mysql_install_db

mysql_install_db in 5.6 has the quirky behavior of
always creating a file in /usr/my.cnf. This removes
this misbehavior from the script.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
 
2
index 30bff5a..309ec13 100644
 
3
--- a/scripts/mysql_install_db.pl.in
 
4
+++ b/scripts/mysql_install_db.pl.in
 
5
@@ -421,35 +421,6 @@ if ( ! $print_defaults )
 
6
 -x $print_defaults or -f "$print_defaults.exe"
 
7
   or cannot_find_file($print_defaults);
 
8
 
 
9
-my $config_file;
 
10
-my $copy_cfg_file;
 
11
-
 
12
-# ----------------------------------------------------------------------
 
13
-# This will be the default config file
 
14
-# ----------------------------------------------------------------------
 
15
-
 
16
-$config_file= "$basedir/my.cnf";
 
17
-
 
18
-my $cfg_template= find_in_basedir($opt,"file","my-default.cnf",
 
19
-                                 "share","share/mysql","support-files");
 
20
--e $cfg_template or cannot_find_file("my-default.cnf");
 
21
-
 
22
-$copy_cfg_file= $config_file;
 
23
-if (-e $copy_cfg_file)
 
24
-{
 
25
-  $copy_cfg_file =~ s/my.cnf/my-new.cnf/;
 
26
-  # Too early to print warning here, the user may not notice
 
27
-}
 
28
-open (TEMPL, $cfg_template) or error("Could not open config template");
 
29
-open (CFG, "> $copy_cfg_file") or error("Could not open config file");
 
30
-while (<TEMPL>)
 
31
-{
 
32
-  # Remove lines beginning with # *** which are template comments
 
33
-  print CFG $_ unless /^# \*\*\*/;
 
34
-}
 
35
-close CFG;
 
36
-close TEMPL;
 
37
-
 
38
 # ----------------------------------------------------------------------
 
39
 # Now we can get arguments from the groups [mysqld] and [mysql_install_db]
 
40
 # in the my.cfg file, then re-run to merge with command line arguments.
 
41
@@ -460,13 +431,9 @@ if ( $opt->{'defaults-file'} )
 
42
 {
 
43
   $print_def_file= $opt->{'defaults-file'};
 
44
 }
 
45
-else
 
46
-{
 
47
-  $print_def_file= $config_file;
 
48
-}
 
49
 
 
50
 my @default_options;
 
51
-my $cmd = quote_options($print_defaults,"--defaults-file=$print_def_file",
 
52
+my $cmd = quote_options($print_defaults,"--defaults-file=$print_def_file" if $print_def_file,
 
53
                         "mysqld","mysql_install_db");
 
54
 open(PIPE, "$cmd |") or error($opt,"can't run $cmd: $!");
 
55
 while ( <PIPE> )
 
56
@@ -838,23 +805,6 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") )
 
57
            "",
 
58
            "Support MySQL by buying support/licenses at http://shop.mysql.com");
 
59
 
 
60
-    if ($copy_cfg_file eq $config_file)
 
61
-    {
 
62
-      report($opt,
 
63
-            "New default config file was created as $config_file and",
 
64
-            "will be used by default by the server when you start it.",
 
65
-            "You may edit this file to change server settings");
 
66
-    }
 
67
-    else
 
68
-    {
 
69
-      warning($opt,
 
70
-             "Found existing config file $config_file on the system.",
 
71
-             "Because this file might be in use, it was not replaced,",
 
72
-             "but was used in bootstrap (unless you used --defaults-file)",
 
73
-             "and when you later start the server.",
 
74
-             "The new default config file was created as $copy_cfg_file,",
 
75
-             "please compare it with your file and take the changes you need.");
 
76
-    }
 
77
     foreach my $cfg ( "/etc/my.cnf", "/etc/mysql/my.cnf" )
 
78
     {
 
79
       check_sys_cfg_file ($opt, $cfg);