[Bucardo-general] [SOLVED] b5 / pg84 : "arguments of row IN must all be row expressions"
Greg Sabino Mullane
greg at endpoint.com
Wed Sep 26 03:51:56 UTC 2012
On Wed, Sep 19, 2012 at 04:26:15PM -0400, Bill McGonigle wrote:
...
> I didn't quite figure out the code but I got far enough to
> understand what was happening.
I just committed what I hope is a fix for this at:
558fa58b4de813db40ce71fa8f398c60d090b7ee
What was happening is that we store the primary keys in a scalar
with \0 as the separator. When we split them apart inside of
delete_rows (as well as other places), we were using the normal
form of Perl's split, which ignores trailing empty delimeters.
This is a crappy default, and solved by adding a negative limit
to the split calls. So, an empty string second-of-two primary key
was generating this:
$key = 'foobar\0';
Which was then split apart to form the values:
join ',' => map { s/\'/''/go; s{\\}{\\\\}; qq{'$_'}; } split '\0' => $key;
This returned ('foobar'), rather than 9'foobar','')
The new code is:
join ',' => map { s/\'/''/go; s{\\}{\\\\}; qq{'$_'}; } split '\0', $key, -1;
Give it a whirl and let us know if this fixes it please.
--
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 0x14964AC8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20120925/81261f4d/attachment.sig>
More information about the Bucardo-general
mailing list