Merge fix-1086018-pt-config-diff-wsrep_provider_options.

This commit is contained in:
Daniel Nichter
2013-03-12 09:29:18 -06:00
4 changed files with 158 additions and 2 deletions

View File

@@ -2784,9 +2784,33 @@ 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 $vars->{wsrep_provider_options};
}
return;
}
sub _parse_config_output {
my ( %args ) = @_;
my @required_args = qw(output TextResultSetParser);
@@ -2829,7 +2853,7 @@ sub _parse_config_output {
vars => $vars,
);
}
return (
format => $format,
vars => $vars,