Fix wrong search before inserting to bucardo_delta_targets.
authorGreg Sabino Mullane <greg@endpoint.com>
Sat, 19 Oct 2013 01:41:56 +0000 (21:41 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Sat, 19 Oct 2013 01:41:56 +0000 (21:41 -0400)
This would explain the large number of rows seen in that table in the wild!

bucardo.schema

index ee8dfc3147ee3b30b5d496326ade69880c7aed1a..383369ccb9e1998b3840abf2d2d072eef7e7d968 100644 (file)
@@ -1535,9 +1535,9 @@ END;
                 my ($relkind,$oid) = @{$sth->fetchall_arrayref()->[0]};
                 next if $relkind ne 'r';
 
-                my $count = $sthc->execute($oid,$syncname);
+                my $count = $sthc->execute($oid,"dbgroup $info->{dbs}");
                 $sthc->finish();
-                if ($count != 1) {
+                if ($count < 1) {
                     $stha->execute($oid,"dbgroup $info->{dbs}");
                     $dbh->commit();
                 }