r46900 - in /branches/lenny/libdbd-pg-perl: debian/changelog quote.c t/06bytea.t

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Sun Nov 8 00:12:54 UTC 2009


Author: gregoa
Date: Sun Nov  8 00:12:45 2009
New Revision: 46900

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=46900
Log:
prepare upload to stable-proposed-updates

Modified:
    branches/lenny/libdbd-pg-perl/debian/changelog
    branches/lenny/libdbd-pg-perl/quote.c
    branches/lenny/libdbd-pg-perl/t/06bytea.t

Modified: branches/lenny/libdbd-pg-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/lenny/libdbd-pg-perl/debian/changelog?rev=46900&op=diff
==============================================================================
--- branches/lenny/libdbd-pg-perl/debian/changelog (original)
+++ branches/lenny/libdbd-pg-perl/debian/changelog Sun Nov  8 00:12:45 2009
@@ -1,3 +1,11 @@
+libdbd-pg-perl (2.8.7-1+lenny1) UNRELEASED; 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 <gregoa at debian.org>  Sun, 08 Nov 2009 00:55:30 +0100
+
 libdbd-pg-perl (2.8.7-1) unstable; urgency=low
 
   * New upstream release.

Modified: branches/lenny/libdbd-pg-perl/quote.c
URL: http://svn.debian.org/wsvn/pkg-perl/branches/lenny/libdbd-pg-perl/quote.c?rev=46900&op=diff
==============================================================================
--- branches/lenny/libdbd-pg-perl/quote.c (original)
+++ branches/lenny/libdbd-pg-perl/quote.c Sun Nov  8 00:12:45 2009
@@ -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 {

Modified: branches/lenny/libdbd-pg-perl/t/06bytea.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/lenny/libdbd-pg-perl/t/06bytea.t?rev=46900&op=diff
==============================================================================
--- branches/lenny/libdbd-pg-perl/t/06bytea.t (original)
+++ branches/lenny/libdbd-pg-perl/t/06bytea.t Sun Nov  8 00:12:45 2009
@@ -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 });




More information about the Pkg-perl-cvs-commits mailing list