Description:
The mysqlhotcopy client ignores the client's .my.cnf configuration files.
All of the other clients read .my.cnf (using my_print_defaults if necessary
for script-based programs), so this seems to be an oversight.
The manual (chapter 4) says:
"mysqlhotcopy reads the groups [client] and [mysqlhotcopy] from the option files."
The patch below fixes the problem.
How to repeat:
Add options under [client] in your .my.cnf, then
invoke mysqlhotcopy without username or password options and observe that it does not set them from .my.cnf.
Suggested fix:
*** mysqlhotcopy.orig Wed May 14 18:28:52 2003
--- mysqlhotcopy Mon Jul 7 22:45:24 2003
***************
*** 81,86 ****
--- 81,101 ----
die @_, $OPTIONS;
}
+ ## get defaults from my.cnf, .my.cnf files:
+ my $my_print_defaults = 'my_print_defaults';
+ if ($0 =~ m#/#) {
+ my ($mybindir) = ($0 =~ m#(^.+)/[^/]+$#);
+ $my_print_defaults = "${mybindir}/my_print_defaults"
+ if length($mybindir);
+ }
+ my @defops = `$my_print_defaults client mysqlhotcopy`;
+ if ($?) {
+ warn "Failed to invoke $my_print_defaults, cannot read defaults from files.";
+ } else {
+ chop @defops;
+ splice @ARGV, 0, 0, @defops;
+ }
+
my %opt = (
user => scalar getpwuid($>),
noindices => 0,
Description: The mysqlhotcopy client ignores the client's .my.cnf configuration files. All of the other clients read .my.cnf (using my_print_defaults if necessary for script-based programs), so this seems to be an oversight. The manual (chapter 4) says: "mysqlhotcopy reads the groups [client] and [mysqlhotcopy] from the option files." The patch below fixes the problem. How to repeat: Add options under [client] in your .my.cnf, then invoke mysqlhotcopy without username or password options and observe that it does not set them from .my.cnf. Suggested fix: *** mysqlhotcopy.orig Wed May 14 18:28:52 2003 --- mysqlhotcopy Mon Jul 7 22:45:24 2003 *************** *** 81,86 **** --- 81,101 ---- die @_, $OPTIONS; } + ## get defaults from my.cnf, .my.cnf files: + my $my_print_defaults = 'my_print_defaults'; + if ($0 =~ m#/#) { + my ($mybindir) = ($0 =~ m#(^.+)/[^/]+$#); + $my_print_defaults = "${mybindir}/my_print_defaults" + if length($mybindir); + } + my @defops = `$my_print_defaults client mysqlhotcopy`; + if ($?) { + warn "Failed to invoke $my_print_defaults, cannot read defaults from files."; + } else { + chop @defops; + splice @ARGV, 0, 0, @defops; + } + my %opt = ( user => scalar getpwuid($>), noindices => 0,