[Bucardo-general] Slash bug
Gabriel Weinberg
yegg at alum.mit.edu
Sat May 14 23:58:09 UTC 2011
I found a bug when there is a slash in a text value id. Here is a test case.
It halts the sync in its tracks.
createdb testa
createdb testb
create table test (id varchar(100) primary key);
bucardo_ctl add database testa name=testa
bucardo_ctl add database testb name=testb
bucardo_ctl add table test db=testa
bucardo_ctl add herd test_herd test
bucardo_ctl add sync test_sync source=test_herd targetdb=testb status=active
type=pushdelta
testa=# insert into test (id) values ('slash\\');
testa=# select * from test;
id
--------
slash\
(1 row)
(5606) [Sat May 14 19:53:33 2011] MCP Warning! Disconnect failed Caught a
SIGPIPE at /usr/local/lib/perl5/site_perl/5.8.9/Bucardo.pm line 650
(5630) [Sat May 14 19:54:45 2011] KID Warning! Aborting due to exception
for public.test:? Error was DBD::Pg::db do failed: ERROR: unterminated
quoted string at or near "'slash\')"\nLINE 1: DELE\
TE FROM public.test WHERE id IN ('slash\')\n
^ at /usr/local/lib/perl5/site_perl/5.8.9/Bucardo.pm line 4901.
(5630) [Sat May 14 19:54:45 2011] KID Kid exiting at cleanup_kid. Reason:
DBD::Pg::db do failed: ERROR: unterminated quoted string at or near
"'slash\')"
LINE 1: DELETE FROM public.test WHERE id IN ('slash\')
^ at
/usr/local/lib/perl5/site_perl/5.8.9/Bucardo.pm line 4901. at
/usr/local/lib/perl5/site_perl/5.8.9/Bucardo.pm line 4975.
main error: none source error: none target error: 7 States://42601
(5620) [Sat May 14 19:54:46 2011] CTL Warning! Kid 5630 seems to have died.
Sync "test_sync"
(5952) [Sat May 14 19:55:08 2011] KID Warning! Aborting due to exception
for public.test:? Error was DBD::Pg::db do failed: ERROR: unterminated
quoted string at or near "'slash\')"\nLINE 1: DELE\
TE FROM public.test WHERE id IN ('slash\')\n
^ at /usr/local/lib/perl5/site_perl/5.8.9/Bucardo.pm line 4901.
(5952) [Sat May 14 19:55:08 2011] KID Kid exiting at cleanup_kid. Reason:
DBD::Pg::db do failed: ERROR: unterminated quoted string at or near
"'slash\')"
LINE 1: DELETE FROM public.test WHERE id IN ('slash\')
^ at
/usr/local/lib/perl5/site_perl/5.8.9/Bucardo.pm line 4901. at
/usr/local/lib/perl5/site_perl/5.8.9/Bucardo.pm line 4975.
main error: none source error: none target error: 7 States://42601
(5620) [Sat May 14 19:55:16 2011] CTL Warning! Kid 5952 seems to have died.
Sync "test_sync"
(5985) [Sat May 14 19:55:39 2011] KID Warning! Aborting due to exception
for public.test:? Error was DBD::Pg::db do failed: ERROR: unterminated
quoted string at or near "'slash\')"\nLINE 1: DELE\
TE FROM public.test WHERE id IN ('slash\')\n
^ at /usr/local/lib/perl5/site_perl/5.8.9/Bucardo.pm line 4901.
(5985) [Sat May 14 19:55:39 2011] KID Kid exiting at cleanup_kid. Reason:
DBD::Pg::db do failed: ERROR: unterminated quoted string at or near
"'slash\')"
LINE 1: DELETE FROM public.test WHERE id IN ('slash\')
^ at
/usr/local/lib/perl5/site_perl/5.8.9/Bucardo.pm line 4901. at
/usr/local/lib/perl5/site_perl/5.8.9/Bucardo.pm line 4975.
main error: none source error: none target error: 7 States://42601
(5620) [Sat May 14 19:55:46 2011] CTL Warning! Kid 5985 seems to have died.
Sync "test_sync"
bucardo_ctl status test_sync
Days back: 3 User: bucardo Database: bucardo
======================================================================
Sync name: test_sync
Current state: idle (PID = 5620)
Type: pushdelta
Source herd/database: test_herd / testa
Target database: testb
Tables in sync: 1
Last good: 4m 10s (time to run: 0s)
Last good time: May 14, 2011 19:53:37 Target: testb
Ins/Upd/Del: 0 / 0 / 0
Last bad: 2m 8s (time to run: 0s)
Last bad time: May 14, 2011 19:55:39 Target: testb
Latest bad reason: DBD::Pg::db do failed: ERROR: unterminated quoted string
at or near "'slash\')"
LINE 1: DELETE FROM public.test WHERE id IN ('slash\')
^ at
/usr/local/lib/perl5/site_perl/5.8.9/Bucardo.pm line 4901. at
/usr/local/lib/perl5/site_perl/5.8.9/Bucardo.pm line 4975.
main error: none source error: none target error: 7
States://42601
PID file: /var/run/bucardo/bucardo.ctl.sync.test_sync.pid
PID file created: Sat May 14 19:53:36 2011
Status: active
Limitdbs: 0
Priority: 0
Checktime: none
Overdue time: 00:00:00
Expired time: 00:00:00
Stayalive: yes Kidsalive: yes
Rebuild index: 0 Do_listen: no
Ping: yes Makedelta: no
Onetimecopy: 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20110514/1fb3742a/attachment.html
More information about the Bucardo-general
mailing list