summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorglynastill2015-04-16 16:24:10 +0000
committerglyn2016-06-01 15:17:02 +0000
commit172c6c539896799ce597ea75250264d7f271b00f (patch)
tree9959fcf8a340ca88a64af505aba3408dccd0817e /check_postgres.pl
parentb1d09afd1d89987b7aa6bab51bde4b264488527b (diff)
Fix "values are not the same" error in replicate_row when repinfo value is a '0'
When check_replicate_row tested for valid values before starting the check, if the actual value returned was 0 it would evaluate to false, resulting in the error: "Cannot test replication: values are not the same" This is resolved by simply checking if the value is defined before assigning it's value a blank string instead.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index 77d532681..61a1d883d 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -6442,11 +6442,11 @@ sub check_replicate_row {
if (!defined $sourcedb) {
ndie msg('rep-norow', "$table.$col");
}
- my $value1 = $info1->{db}[0]{slurp}[0]{c} || '';
+ my $value1 = (defined($info1->{db}[0]{slurp}[0]{c})?$info1->{db}[0]{slurp}[0]{c}:'');
my $numslaves = @{$info1->{db}} - 1;
for my $d ( @{$info1->{db}}[1 .. $numslaves] ) {
- my $value2 = $d->{slurp}[0]{c} || '';
+ my $value2 = (defined($d->{slurp}[0]{c})?$d->{slurp}[0]{c}:'');
if ($value1 ne $value2) {
ndie msg('rep-notsame');
}