[Bucardo-general] How to skip a failing command ?

Kiriakos Tsourapas ktsour at gmail.com
Mon Jul 11 11:52:22 UTC 2011


Dear Greg, I don't think we are looking at the same file.

Mine does not have this line :
> $safepkval =~ s{\\}{\\\\}go;


I am attaching my file.
I have quoted the places where I have made changes and it works fine now.
(look for ESCAPE_FIX in the file)

I have not made the last change you suggested, since the files are not the same...
If you want me to try something different, please tell me what you need me to change in order to test.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bucardo.pm
Type: text/x-perl-script
Size: 216115 bytes
Desc: not available
Url : https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20110711/62b19340/attachment-0001.bin 
-------------- next part --------------



Bucardo has been a life-safer for us and I am glad I can contribute in this way.


Best regards,
Kiriakos


On Jul 10, 2011, at 19:02, Greg Sabino Mullane wrote:

> On Tue, Jul 05, 2011 at 12:26:30PM +0300, Kiriakos Tsourapas wrote:
>> Without knowing perl, I made the following change :
>> 
>> if ($g->{pkcols} > 1) {
>>  $list .= sprintf '(%s),' => join ',' => map { s{\\}{\\\\}; qq{$_}; } @$row;
>> }
> 
> Ah, I think I found the bug, and it won't require the change above. 
> @$row comes from @srcdelete, which in turn is populated by @pkvals. That array 
> is already escaped like so:
> 
> for my $pk (@{$info1->{$pkval}{BUCARDO_PKVALS}}) {
>  if ($g->{pkeytype}[0] =~ /int$/o) {
>    push @safepk => $pk;
>  }
>  else {
>    (my $safepkval = $pk) =~ s/\'/''/go;
>    $safepkval =~ s{\\}{\\\\}go;
>    push @safepk => qq{'$safepkval'};
>  }
> }
> 
> However, at some point the data type normalizations were removed, so that 
> it is now possible to have a pkeytype of 'int4', which I suspect is what 
> is happening here. Try changing the regex in that line like so:
> 
>  if ($g->{pkeytype}[0] =~ /int\d?$/o) {
> 
> Two places need changing: line 5491 and line 5503. Here's the diff:
> 
> diff --git a/Bucardo.pm b/Bucardo.pm
> index 5ca9bc6..3488bbc 100644
> --- a/Bucardo.pm
> +++ b/Bucardo.pm
> @@ -5488,7 +5488,7 @@ sub start_kid {
>                     ## We are manually building lists, so we may need to escape the pkeys
>                     my @safepk;
>                     if ($g->{pkcols} <= 1) {
> -                        if ($g->{pkeytype}[0] =~ /int$/o) {
> +                        if ($g->{pkeytype}[0] =~ /int\d?$/o) {
>                             push @safepk => $pkval;
>                         }
>                         else {
> @@ -5500,7 +5500,7 @@ sub start_kid {
>                     else {
>                         $x=0;
>                         for my $pk (@{$info1->{$pkval}{BUCARDO_PKVALS}}) {
> -                            if ($g->{pkeytype}[0] =~ /int$/o) {
> +                            if ($g->{pkeytype}[0] =~ /int\d?$/o) {
>                                 push @safepk => $pk;
>                             }
>                             else {
> 
> I'll spin up a version 4.4.6 with this fix shortly. Thanks for the original 
> report and persisting with feedback.
> 
> -- 
> Greg Sabino Mullane greg at endpoint.com
> End Point Corporation
> PGP Key: 0x14964AC8



More information about the Bucardo-general mailing list