Re: ANNOUNCE: DBD::Oracle 1.22 Release Candidate 1

Martin Evans <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Organization Easysoft Limited
Message-ID <[email protected]>
Martin Evans wrote:
> Fails to compile for me with one instant client:
> 
> oci8.c: In function 'oci_mode':
> oci8.c:242: error: 'OCI_SUPPRESS_NLS_VALIDATION' undeclared (first use 
> in this function)
> oci8.c:242: error: (Each undeclared identifier is reported only once
> oci8.c:242: error: for each function it appears in.)
> make: *** [oci8.o] Error 1
> 
> Release 10.2.0.1.0 for Linux.
> 
> Shame, because this is what my application is using. I've commented the 
> offending line out for now and will get back to you on Monday as to how 
> it goes.
> 
> Also, I introduced an error in my last patch:
> 
> line 25 of t/10general.t uses BAILOUT and it should be BAIL_OUT
> 
> Also, t/20select fails on this instant client - still looking in to this.

This is down to:

data_diff saying:
a: UTF8 on, ASCII, 10 characters 10 bytes
b: UTF8 off, ASCII, 10 characters 10 bytes
Strings contain the same sequence of characters

I think this may be because my database is utf8 and although the data 
inserted is plain ascii ("1234567890" and "2bcdefabcd") when they are 
retrieved they come back with the utf8 flag on. I think it needs the 
following change:

--- 20select.t	(revision 11588)
+++ 20select.t	(working copy)
@@ -135,15 +135,15 @@
        $sth->{ChopBlanks} = 1;
        ok($tmp = $sth->fetchall_arrayref, 'fetchall');
        my $dif;
-      $dif = DBI::data_diff($tmp->[0][1], $data0);
-      ok(!$dif, 'first row matches');
-      diag($dif) if $dif;
-      $dif = DBI::data_diff($tmp->[1][1], $data1);
-      ok(!$dif, 'second row matches');
-      diag($dif) if $dif;
-      $dif = DBI::data_diff($tmp->[2][1], $data2);
-      ok(!$dif, 'third row matches');
-      diag($dif) if $dif;
+      if ($utf8_test) {
+          $dif = DBI::data_diff($tmp->[0][1], $data0);
+          ok(!defined($dif) || $dif eq '', 'first row matches');
+          diag($dif) if $dif;
+      } else {
+          is($tmp->[0][1], $data0, 'first row matches');
+      }
+      is($tmp->[1][1], $data1, 'second row matches');
+      is($tmp->[2][1], $data2, 'third row matches');
    }
  } # end of run_select_tests

This was my fault - sorry about that.

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.