[Bucardo-general] Patch: Broken "Latest" Conflict Resolution
Benjamin Allen
bsa at lanl.gov
Fri Mar 13 04:38:44 UTC 2009
I attached the patch as my email client or the mailing list mangled
the copy-and-pasted code in the previous email.
Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_latest_conflict.patch
Type: application/octet-stream
Size: 1459 bytes
Desc: not available
Url : https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20090313/9f3287e2/attachment.obj
-------------- next part --------------
On Mar 13, 2009, at 12:31 AM, Benjamin Allen wrote:
> The code in Bucardo.pm that does "latest" conflict resolution is
> broken by calling the execute method on $sth{sc_latest_src} and
> $sth{sc_latest_tgt} which are unblessed objects. The proper objects to
> use are $sth{sc_latest_src}{$g->{pkcols}} and $sth{sc_latest_tgt}{$g-
>> {pkcols}} respectively as those are what the earlier DBI prepares
> are set to.
>
> Original Error:
> Can't call method "execute" on unblessed reference at /usr/local/lib/
> perl5/site_perl/5.8.9/Bucardo.pm line 4678.
>
> diff --git a/Bucardo.pm b/Bucardo.pm
> index 87fcce9..7162343 100644
> --- a/Bucardo.pm
> +++ b/Bucardo.pm
> @@ -4675,19 +4675,19 @@ sub start_kid {
>
> $sth{sc_latest_tgt}{$g->{pkcols}} = $targetdbh->prepare($SQL);
> }
> if ($g-
>> {pkcols} > 1) {
> -
> $sth{sc_latest_src}->execute($g->{oid},@{$info1->{$pkval}
> {BUCARDO_PKVALS}});
> +
> $sth{sc_latest_src}{$g->{pkcols}}->execute($g->{oid},@{$info1-
> >{$pkval}
> {BUCARDO_PKVALS}});
> }
> else {
> -
> $sth{sc_latest_src}->execute($g->{oid},$pkval);
> +
> $sth{sc_latest_src}{$g->{pkcols}}->execute($g->{oid},$pkval);
> }
> - my $srctime =
> $sth{sc_latest_src}->fetchall_arrayref()->[0][0];
> + my $srctime =
> $sth{sc_latest_src}{$g->{pkcols}}->fetchall_arrayref()->[0][0];
> if ($g-
>> {pkcols} > 1) {
> -
> $sth{sc_latest_tgt}->execute($toid,@{$info2->{$pkval}
> {BUCARDO_PKVALS}});
> +
> $sth{sc_latest_tgt}{$g->{pkcols}}->execute($toid,@{$info2->{$pkval}
> {BUCARDO_PKVALS}});
> }
> else {
> -
> $sth{sc_latest_tgt}->execute($toid,$pkval);
> +
> $sth{sc_latest_tgt}{$g->{pkcols}}->execute($toid,$pkval);
> }
> - my $tgttime =
> $sth{sc_latest_tgt}->fetchall_arrayref()->[0][0];
> + my $tgttime =
> $sth{sc_latest_tgt}{$g->{pkcols}}->fetchall_arrayref()->[0][0];
> $self-
>> glog(qq{Delta source time: $srctime Target time: $tgttime});
> $info1-
>> {$pkval}{BUCARDO_ACTION} = $srctime >= $tgttime ? 1 : 2;
> } ## end 'latest'
>
>
> Side note, I think as Greg mentioned before, a bug tracker website
> would be useful for this project now that community involvement has
> grown significantly.
>
> Regards,
>
> Ben Allen
>
> _______________________________________________
> Bucardo-general mailing list
> Bucardo-general at bucardo.org
> https://mail.endcrypt.com/mailman/listinfo/bucardo-general
Ben Allen
System Administrator
Influenza Sequence Database
Los Alamos National Laboratory
More information about the Bucardo-general
mailing list