Commit 56e6a0ab authored by Magnus Svensson's avatar Magnus Svensson

Bug#39972 mysql-test-run.pl: Confusing error message under special conditions

 - Fix problem with for example ./mtr --timer, caused by new version of "Getopt::Long"
 - Evaluating the "$opt" variable as a string, returns the name of the parameter
   to be modified instead of "Getopt::Long::Callback" which is the class name
parent 37e91acc
...@@ -45,10 +45,13 @@ our $reorder= 1; ...@@ -45,10 +45,13 @@ our $reorder= 1;
sub collect_option { sub collect_option {
my ($opt, $value)= @_; my ($opt, $value)= @_;
# Evaluate $opt as string to use "Getopt::Long::Callback legacy API"
my $opt_name = "$opt";
# Convert - to _ in option name # Convert - to _ in option name
$opt =~ s/-/_/g; $opt_name =~ s/-/_/g;
no strict 'refs'; no strict 'refs';
${$opt}= $value; ${$opt_name}= $value;
} }
use File::Basename; use File::Basename;
......
...@@ -44,12 +44,13 @@ our $timer= 1; ...@@ -44,12 +44,13 @@ our $timer= 1;
sub report_option { sub report_option {
my ($opt, $value)= @_; my ($opt, $value)= @_;
# Evaluate $opt as string to use "Getopt::Long::Callback legacy API"
my $opt_name = "$opt";
# Convert - to _ in option name # Convert - to _ in option name
$opt =~ s/-/_/g; $opt_name =~ s/-/_/g;
no strict 'refs'; no strict 'refs';
${$opt}= $value; ${$opt_name}= $value;
#print $name, " setting $opt to ", (defined $value? $value : "undef") ,"\n";
} }
sub _name { sub _name {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment