Package: release.debian.org Severity: normal User: [email protected] Usertags: pu
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dear release team, the version of libdbd-pg-perl in Lenny (2.8.7-1) has a regression in the handling of high bit characters. Cf. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=554489 http://rt.cpan.org/Public/Bug/Display.html?id=39390 The bug was fixed upstream and in Debian with 2.10.6[-1]. I propose to include a newer version of libdbd-pg-perl in the next Lenny point release with the patch for this problem. The change in the code is a 1-line-change (or even a 15-character-change :)), the rest are some additional tests for the fix which I've also tested in a Lenny chroot with and without postgresql installed. Find attached a debdiff for the proposed upload to stable. Please advice on how to proceed. Thanks in advanve, gregor -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkr2DIoACgkQOzKYnQDzz+RwegCg72u0cOvmk3h1JAepoPS1u+fz 0s4AnR+F2b2RBrJZPvyXJqV6np2n5nQi =04g7 -----END PGP SIGNATURE-----
diff -u libdbd-pg-perl-2.8.7/debian/changelog libdbd-pg-perl-2.8.7/debian/changelog --- libdbd-pg-perl-2.8.7/debian/changelog +++ libdbd-pg-perl-2.8.7/debian/changelog @@ -1,3 +1,11 @@ +libdbd-pg-perl (2.8.7-1+lenny1) stable; urgency=low + + * Upload to stable-proposed-updates. + * Add patch to fix problem with high bit characters; thanks to Bryce Nesbitt + for bug report, tests and the final patch (closes: #554489). + + -- gregor herrmann <[email protected]> Sun, 08 Nov 2009 00:55:30 +0100 + libdbd-pg-perl (2.8.7-1) unstable; urgency=low * New upstream release. only in patch2: unchanged: --- libdbd-pg-perl-2.8.7.orig/quote.c +++ libdbd-pg-perl-2.8.7/quote.c @@ -205,7 +205,7 @@ *result++ = '\\'; } else if (*string < 0x20 || *string > 0x7e) { - (void) snprintf((char *)result, 6, "\\\\%03o", *string++); + (void) snprintf((char *)result, 6, "\\\\%03o", (unsigned char)*string++); result += 5; } else { only in patch2: unchanged: --- libdbd-pg-perl-2.8.7.orig/t/06bytea.t +++ libdbd-pg-perl-2.8.7/t/06bytea.t @@ -17,7 +17,7 @@ if (! defined $dbh) { plan skip_all => 'Connection to database failed, cannot continue testing'; } -plan tests => 7; +plan tests => 11; isnt ($dbh, undef, 'Connect to database for bytea testing'); @@ -28,6 +28,7 @@ my ($sth, $t); +################################################################# $sth = $dbh->prepare(q{INSERT INTO dbd_pg_test (id,bytetest) VALUES (?,?)}); $t='bytea insert test with string containing null and backslashes'; @@ -40,6 +41,15 @@ $t='bytea (second) insert test with string containing a single quote'; ok ($sth->execute(402, '\''), $t); +my ($binary_in, $binary_out); +$t='store binary data in BYTEA column'; +for(my $i=0; $i<256; $i++) { $binary_out .= chr($i); } +$sth->{pg_server_prepare} = 0; +ok ($sth->execute(403, $binary_out), $t); +$sth->{pg_server_prepare} = 1; +ok ($sth->execute(404, $binary_out), $t); + +################################################################# $t='Received correct text from BYTEA column with backslashes'; $sth = $dbh->prepare(q{SELECT bytetest FROM dbd_pg_test WHERE id=?}); $sth->execute(400); @@ -51,6 +61,16 @@ $byte = $sth->fetchall_arrayref()->[0][0]; is ($byte, '\'', $t); +$t='compare binary data in bytea row 403'; +$sth->execute(403); +($binary_in) = $sth->fetchrow_array(); +ok ($binary_in eq $binary_out, $t); +$t='compare binary data in bytea row 404'; +$sth->execute(404); +($binary_in) = $sth->fetchrow_array(); +ok ($binary_in eq $binary_out, $t); + +################################################################# $t='quote properly handles bytea strings'; my $string = "abc\123\\def\0ghi"; my $result = $dbh->quote($string, { pg_type => PG_BYTEA });

