summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorDavid E. Wheeler2013-09-24 23:22:44 +0000
committerDavid E. Wheeler2013-09-24 23:22:44 +0000
commit726e040ef82b9a6fce90664a0ae5c5b80b162e62 (patch)
tree65aca59aceb8fb4c0c4e148c6ba9c14e5a7a6d7b /check_postgres.pl
parentf1b9f98cdc9cdbc511403fc26829f9efb1e229fd (diff)
Eliminate some "Use of uninitialized value" warnings.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl24
1 files changed, 14 insertions, 10 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index 571989624..4dd84552b 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -6146,6 +6146,7 @@ sub check_replicate_row {
for my $d (@{$info2->{db}}) {
$slave++;
my $value2 = $d->{slurp}[0]{c};
+ no warnings 'uninitialized';
if ($value1 ne $value2) {
ndie msg('rep-notsame');
}
@@ -6156,16 +6157,19 @@ sub check_replicate_row {
}
my ($update,$newval);
- if ($value1 eq $val1) {
- $update = $update2;
- $newval = $val2;
- }
- elsif ($value1 eq $val2) {
- $update = $update1;
- $newval = $val1;
- }
- else {
- ndie msg('rep-wrongvals', $value1, $val1, $val2);
+ UNINITOK: {
+ no warnings 'uninitialized';
+ if ($value1 eq $val1) {
+ $update = $update2;
+ $newval = $val2;
+ }
+ elsif ($value1 eq $val2) {
+ $update = $update1;
+ $newval = $val1;
+ }
+ else {
+ ndie msg('rep-wrongvals', $value1, $val1, $val2);
+ }
}
$info1 = run_command($update, { dbnumber => 1, failok => 1 } );