From: Greg Sabino Mullane Date: Sun, 29 Jun 2014 12:41:20 +0000 (-0400) Subject: Not sure why this code is the way it is, but we need to prevent duplicate entries... X-Git-Tag: 5.1.0~17 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=1fab23f0a05040fd836ad7fe2d55f22ef4a474f1;p=bucardo.git Not sure why this code is the way it is, but we need to prevent duplicate entries, so here's a bandaid. --- diff --git a/bucardo b/bucardo index 4ad6ca8b0..e4bc799fc 100755 --- a/bucardo +++ b/bucardo @@ -3882,14 +3882,16 @@ sub add_herd { eval { @a = @{$goatlist->{relations}{$name}{goat}}; }; + + my $doneit; for my $tmpgoat (@a) { + next if exists $doneit->{$tmpgoat->{id}}; my $db = $tmpgoat->{db}; - my $pri = 0; - $count = $sth->execute($herdname,$pri,$name, $db); - + $count = $sth->execute($herdname,$pri,$name,$db); push @newnames => $name; + $doneit->{$tmpgoat->{id}}++; } }