From 172c6c539896799ce597ea75250264d7f271b00f Mon Sep 17 00:00:00 2001 From: glynastill Date: Thu, 16 Apr 2015 17:24:10 +0100 Subject: [PATCH] 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. --- check_postgres.pl | 4 ++-- 1 file 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'); } -- 2.30.2