Fix for 1086018: pt-config-diff needs to parse wsrep_provider_options

This commit is contained in:
Brian Fraser
2013-03-05 11:27:56 -03:00
parent ba315c3353
commit d8701a3f3e
3 changed files with 52 additions and 3 deletions

View File

@@ -121,9 +121,34 @@ sub _parse_config {
die "Unknown config source";
}
handle_special_vars(\%config_data);
return %config_data;
}
sub handle_special_vars {
my ($config_data) = @_;
if ( $config_data->{vars}->{wsrep_provider_options} ) {
my $vars = $config_data->{vars};
my $dupes = $config_data->{duplicate_vars};
for my $wpo ( $vars->{wsrep_provider_options}, @{$dupes->{wsrep_provider_options} || [] } ) {
my %opts = $wpo =~ /(\S+)\s*=\s*(\S*)(?:;|;?$)/g;
while ( my ($var, $val) = each %opts ) {
$val =~ s/;$//;
if ( exists $vars->{$var} ) {
push @{$dupes->{$var} ||= []}, $val;
}
$vars->{$var} = $val;
}
}
# Delete from vars, but not from dupes, since we still want that
delete $vars->{wsrep_provider_options};
}
return;
}
sub _parse_config_output {
my ( %args ) = @_;
my @required_args = qw(output TextResultSetParser);
@@ -166,7 +191,7 @@ sub _parse_config_output {
vars => $vars,
);
}
return (
format => $format,
vars => $vars,