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
=== modified file 'scripts/mysql_install_db.pl.in'
--- scripts/mysql_install_db.pl.in 2014-05-04 12:42:22 +0000
+++ scripts/mysql_install_db.pl.in 2014-05-27 09:59:19 +0000
@@ -451,50 +451,46 @@
451-x $print_defaults or -f "$print_defaults.exe"451-x $print_defaults or -f "$print_defaults.exe"
452 or cannot_find_file($print_defaults);452 or cannot_find_file($print_defaults);
453453
454# fix for: https://bugs.launchpad.net/percona-server/+bug/1314596454# Next block is commented because of bug1225189
455# should be removed later455# Except for the line that defines variable $cnfext which is needed
456my $cnfext = ( $^O =~ m/^(MSWin32|cygwin)$/ ) ? "ini" : "cnf";456# my $config_file;
457457# my $copy_cfg_file;
458<<'CONFIGFILE_BUG1225189';458
459my $config_file;459# # ----------------------------------------------------------------------
460my $copy_cfg_file;460# # This will be the default config file
461461# # ----------------------------------------------------------------------
462# ----------------------------------------------------------------------462
463# This will be the default config file463my $cnfext = ( $^O =~ m/^(MSWin32|cygwin)$/ ) ? "ini" : "cnf";
464# ----------------------------------------------------------------------464
465465# $config_file= "$basedir/my.$cnfext";
466my $cnfext = ( $^O =~ m/^(MSWin32|cygwin)$/ ) ? "ini" : "cnf";466
467467# my $cfg_template= find_in_basedir($opt,"file","my-default.$cnfext",
468$config_file= "$basedir/my.$cnfext";468# ".", "share","share/mysql","support-files");
469469# -e $cfg_template or cannot_find_file("my-default.$cnfext");
470my $cfg_template= find_in_basedir($opt,"file","my-default.$cnfext",470
471 ".", "share","share/mysql","support-files");471# $copy_cfg_file= $config_file;
472-e $cfg_template or cannot_find_file("my-default.$cnfext");472# my $failed_write_cfg= 0;
473473# if (-e $copy_cfg_file)
474$copy_cfg_file= $config_file;474# {
475my $failed_write_cfg= 0;475# $copy_cfg_file =~ s/my.$cnfext/my-new.$cnfext/;
476if (-e $copy_cfg_file)476# # Too early to print warning here, the user may not notice
477{477# }
478 $copy_cfg_file =~ s/my.$cnfext/my-new.$cnfext/;478# open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");
479 # Too early to print warning here, the user may not notice479# if (open (CFG, "> $copy_cfg_file"))
480}480# {
481open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");481# while (<TEMPL>)
482if (open (CFG, "> $copy_cfg_file"))482# {
483{483# # Remove lines beginning with # *** which are template comments
484 while (<TEMPL>)484# print CFG $_ unless /^# \*\*\*/;
485 {485# }
486 # Remove lines beginning with # *** which are template comments486# close CFG;
487 print CFG $_ unless /^# \*\*\*/;487# }
488 }488# else
489 close CFG;489# {
490}490# warning($opt,"Could not write to config file $copy_cfg_file: $!");
491else491# $failed_write_cfg= 1;
492{492# }
493 warning($opt,"Could not write to config file $copy_cfg_file: $!");493# close TEMPL;
494 $failed_write_cfg= 1;
495}
496close TEMPL;
497CONFIGFILE_BUG1225189
498494
499# ----------------------------------------------------------------------495# ----------------------------------------------------------------------
500# Now we can get arguments from the groups [mysqld] and [mysql_install_db]496# Now we can get arguments from the groups [mysqld] and [mysql_install_db]
@@ -885,33 +881,33 @@
885 "Support Percona by buying support at",881 "Support Percona by buying support at",
886 " http://www.percona.com/products/mysql-support");882 " http://www.percona.com/products/mysql-support");
887883
888<<'CONFIGFILE_BUG1225189';884# Next block is commented because of bug1225189
889 if ($copy_cfg_file eq $config_file and !$failed_write_cfg)885# if ($copy_cfg_file eq $config_file and !$failed_write_cfg)
890 {886# {
891 report($opt,887# report($opt,
892 "New default config file was created as $config_file and",888# "New default config file was created as $config_file and",
893 "will be used by default by the server when you start it.",889# "will be used by default by the server when you start it.",
894 "You may edit this file to change server settings");890# "You may edit this file to change server settings");
895 }891# }
896 elsif ($failed_write_cfg)892# elsif ($failed_write_cfg)
897 {893# {
898 warning($opt,894# warning($opt,
899 "Could not copy config file template $cfg_template to",895# "Could not copy config file template $cfg_template to",
900 "$copy_cfg_file, may not have access rights to do so.",896# "$copy_cfg_file, may not have access rights to do so.",
901 "You may want to copy the file manually, or create your own,",897# "You may want to copy the file manually, or create your own,",
902 "it will then be used by default by the server when you start it.");898# "it will then be used by default by the server when you start it.");
903 }899# }
904 else900# else
905 {901# {
906 warning($opt,902# warning($opt,
907 "Found existing config file $config_file on the system.",903# "Found existing config file $config_file on the system.",
908 "Because this file might be in use, it was not replaced,",904# "Because this file might be in use, it was not replaced,",
909 "but was used in bootstrap (unless you used --defaults-file)",905# "but was used in bootstrap (unless you used --defaults-file)",
910 "and when you later start the server.",906# "and when you later start the server.",
911 "The new default config file was created as $copy_cfg_file,",907# "The new default config file was created as $copy_cfg_file,",
912 "please compare it with your file and take the changes you need.");908# "please compare it with your file and take the changes you need.");
913 }909# }
914CONFIGFILE_BUG1225189910
915 foreach my $cfg ( "/etc/my.$cnfext", "/etc/mysql/my.$cnfext" )911 foreach my $cfg ( "/etc/my.$cnfext", "/etc/mysql/my.$cnfext" )
916 {912 {
917 check_sys_cfg_file ($opt, $cfg);913 check_sys_cfg_file ($opt, $cfg);

Subscribers

People subscribed via source and target branches