Author: theory
Date: Mon Nov 22 21:22:25 2010
New Revision: 14550

Modified:
   DBD-Pg/trunk/Changes
   DBD-Pg/trunk/t/06bytea.t

Log:
Oops. Under hex output format, DBD::Pg should convert it to binary. My
mistake. The tests fail, though; I assume that this is because of the work
that Greg has been doing on proper UTF-8 support. True?



Modified: DBD-Pg/trunk/Changes
==============================================================================
--- DBD-Pg/trunk/Changes        (original)
+++ DBD-Pg/trunk/Changes        Mon Nov 22 21:22:25 2010
@@ -6,8 +6,6 @@
     environment variable lacks a database specification.
   - Fix algorithm for skiping tests in t/06bytea.t when running on a version
     of PostgreSQL lower than 9.0.
-  - Fix failing tests in t/06bytea.t when running on PostgreSQL 9.0 or later
-    and using hexadecimal binary format.
 
 2.17.2 Released November 21, 2010 (subversion r14542)
 

Modified: DBD-Pg/trunk/t/06bytea.t
==============================================================================
--- DBD-Pg/trunk/t/06bytea.t    (original)
+++ DBD-Pg/trunk/t/06bytea.t    Mon Nov 22 21:22:25 2010
@@ -70,33 +70,22 @@
     $sth = $dbh->prepare(q{SELECT bytetest FROM dbd_pg_test WHERE id=?});
     $sth->execute(400);
     my $byte = $sth->fetchall_arrayref()->[0][0];
-    my $exp = $output eq 'hex'
-        ? 'x61615c62625c63635c5c3064645c'
-        : 'aa\bb\cc\\\0dd\\';
-    is ($byte, $exp, $t);
+    is ($byte, 'aa\bb\cc\\\0dd\\', $t);
 
     $t='Received correct text from BYTEA column with quote';
     $t.=" ($output output)" if $output;
     $sth->execute(402);
     $byte = $sth->fetchall_arrayref()->[0][0];
-    is ($byte, ($output eq 'hex' ? 'x27' : '\''), $t);
+    is ($byte, '\'', $t);
 
     $t='Ensure proper handling of high bit characters';
     $t.=" ($output output)" if $output;
     $sth->execute(403);
     ($binary_in) = $sth->fetchrow_array();
-    if ($output eq 'hex') {
-        my $hex = 'x' . unpack 'H*', $binary_out;
-        is $binary_in, $hex, $t;
-        $sth->execute(404);
-        ($binary_in) = $sth->fetchrow_array();
-        is $binary_in, $hex, $t;
-    } else {
-        ok ($binary_in eq $binary_out, $t);
-        $sth->execute(404);
-        ($binary_in) = $sth->fetchrow_array();
-        ok ($binary_in eq $binary_out, $t);
-    }
+    cmp_ok $binary_in, 'eq', $binary_out, $t;
+    $sth->execute(404);
+    ($binary_in) = $sth->fetchrow_array();
+    ok ($binary_in eq $binary_out, $t);
 
     $t='quote properly handles bytea strings';
     $t.=" ($output output)" if $output;

Reply via email to