Merge lp:~tplavcic/percona-server/bug1314596-5.6 into lp:percona-server/5.6

Proposed by Tomislav Plavcic
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 600
Proposed branch: lp:~tplavcic/percona-server/bug1314596-5.6
Merge into: lp:percona-server/5.6
Diff against target: 155 lines (+67/-71)
1 file modified
scripts/mysql_install_db.pl.in (+67/-71)
To merge this branch: bzr merge lp:~tplavcic/percona-server/bug1314596-5.6
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+221055@code.launchpad.net

Description of the change

Defined the variable $cnfext in mysql_install_db
Fixed warning Useless use of a constant in void context in mysql_install_db

This has little effect to what was done before and what is currently working - it just does that the warnings do not appear to the user (bug:1318874) when running the mysql_install_db script.
Before this blocks were disabled for running by this perl commands:
<<'CONFIGFILE_BUG1225189';
[code block]
CONFIGFILE_BUG1225189
which produce the warnings to the user.
I have just commented those blocks and left initial definition of $cnfext variable to run as in upstream code.
Upstream bug is not resolved yet so don't want to delete those block completely.

This was tested by installing from binary tarball - if log is needed can be send.

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/mysql_install_db.pl.in'
2--- scripts/mysql_install_db.pl.in 2014-05-04 12:42:22 +0000
3+++ scripts/mysql_install_db.pl.in 2014-05-27 09:59:19 +0000
4@@ -451,50 +451,46 @@
5 -x $print_defaults or -f "$print_defaults.exe"
6 or cannot_find_file($print_defaults);
7
8-# fix for: https://bugs.launchpad.net/percona-server/+bug/1314596
9-# should be removed later
10-my $cnfext = ( $^O =~ m/^(MSWin32|cygwin)$/ ) ? "ini" : "cnf";
11-
12-<<'CONFIGFILE_BUG1225189';
13-my $config_file;
14-my $copy_cfg_file;
15-
16-# ----------------------------------------------------------------------
17-# This will be the default config file
18-# ----------------------------------------------------------------------
19-
20-my $cnfext = ( $^O =~ m/^(MSWin32|cygwin)$/ ) ? "ini" : "cnf";
21-
22-$config_file= "$basedir/my.$cnfext";
23-
24-my $cfg_template= find_in_basedir($opt,"file","my-default.$cnfext",
25- ".", "share","share/mysql","support-files");
26--e $cfg_template or cannot_find_file("my-default.$cnfext");
27-
28-$copy_cfg_file= $config_file;
29-my $failed_write_cfg= 0;
30-if (-e $copy_cfg_file)
31-{
32- $copy_cfg_file =~ s/my.$cnfext/my-new.$cnfext/;
33- # Too early to print warning here, the user may not notice
34-}
35-open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");
36-if (open (CFG, "> $copy_cfg_file"))
37-{
38- while (<TEMPL>)
39- {
40- # Remove lines beginning with # *** which are template comments
41- print CFG $_ unless /^# \*\*\*/;
42- }
43- close CFG;
44-}
45-else
46-{
47- warning($opt,"Could not write to config file $copy_cfg_file: $!");
48- $failed_write_cfg= 1;
49-}
50-close TEMPL;
51-CONFIGFILE_BUG1225189
52+# Next block is commented because of bug1225189
53+# Except for the line that defines variable $cnfext which is needed
54+# my $config_file;
55+# my $copy_cfg_file;
56+
57+# # ----------------------------------------------------------------------
58+# # This will be the default config file
59+# # ----------------------------------------------------------------------
60+
61+my $cnfext = ( $^O =~ m/^(MSWin32|cygwin)$/ ) ? "ini" : "cnf";
62+
63+# $config_file= "$basedir/my.$cnfext";
64+
65+# my $cfg_template= find_in_basedir($opt,"file","my-default.$cnfext",
66+# ".", "share","share/mysql","support-files");
67+# -e $cfg_template or cannot_find_file("my-default.$cnfext");
68+
69+# $copy_cfg_file= $config_file;
70+# my $failed_write_cfg= 0;
71+# if (-e $copy_cfg_file)
72+# {
73+# $copy_cfg_file =~ s/my.$cnfext/my-new.$cnfext/;
74+# # Too early to print warning here, the user may not notice
75+# }
76+# open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");
77+# if (open (CFG, "> $copy_cfg_file"))
78+# {
79+# while (<TEMPL>)
80+# {
81+# # Remove lines beginning with # *** which are template comments
82+# print CFG $_ unless /^# \*\*\*/;
83+# }
84+# close CFG;
85+# }
86+# else
87+# {
88+# warning($opt,"Could not write to config file $copy_cfg_file: $!");
89+# $failed_write_cfg= 1;
90+# }
91+# close TEMPL;
92
93 # ----------------------------------------------------------------------
94 # Now we can get arguments from the groups [mysqld] and [mysql_install_db]
95@@ -885,33 +881,33 @@
96 "Support Percona by buying support at",
97 " http://www.percona.com/products/mysql-support");
98
99-<<'CONFIGFILE_BUG1225189';
100- if ($copy_cfg_file eq $config_file and !$failed_write_cfg)
101- {
102- report($opt,
103- "New default config file was created as $config_file and",
104- "will be used by default by the server when you start it.",
105- "You may edit this file to change server settings");
106- }
107- elsif ($failed_write_cfg)
108- {
109- warning($opt,
110- "Could not copy config file template $cfg_template to",
111- "$copy_cfg_file, may not have access rights to do so.",
112- "You may want to copy the file manually, or create your own,",
113- "it will then be used by default by the server when you start it.");
114- }
115- else
116- {
117- warning($opt,
118- "Found existing config file $config_file on the system.",
119- "Because this file might be in use, it was not replaced,",
120- "but was used in bootstrap (unless you used --defaults-file)",
121- "and when you later start the server.",
122- "The new default config file was created as $copy_cfg_file,",
123- "please compare it with your file and take the changes you need.");
124- }
125-CONFIGFILE_BUG1225189
126+# Next block is commented because of bug1225189
127+# if ($copy_cfg_file eq $config_file and !$failed_write_cfg)
128+# {
129+# report($opt,
130+# "New default config file was created as $config_file and",
131+# "will be used by default by the server when you start it.",
132+# "You may edit this file to change server settings");
133+# }
134+# elsif ($failed_write_cfg)
135+# {
136+# warning($opt,
137+# "Could not copy config file template $cfg_template to",
138+# "$copy_cfg_file, may not have access rights to do so.",
139+# "You may want to copy the file manually, or create your own,",
140+# "it will then be used by default by the server when you start it.");
141+# }
142+# else
143+# {
144+# warning($opt,
145+# "Found existing config file $config_file on the system.",
146+# "Because this file might be in use, it was not replaced,",
147+# "but was used in bootstrap (unless you used --defaults-file)",
148+# "and when you later start the server.",
149+# "The new default config file was created as $copy_cfg_file,",
150+# "please compare it with your file and take the changes you need.");
151+# }
152+
153 foreach my $cfg ( "/etc/my.$cnfext", "/etc/mysql/my.$cnfext" )
154 {
155 check_sys_cfg_file ($opt, $cfg);

Subscribers

People subscribed via source and target branches