On Mon, Oct 17, 2005 at 05:41:20PM +0100, Tim Bunce wrote:
> On Mon, Oct 17, 2005 at 08:24:17AM -0400, Eric Lenio wrote:
> > On Mon, Oct 17, 2005 at 11:50:22AM +0100, Tim Bunce wrote:
> > > On Sat, Oct 15, 2005 at 11:02:42PM -0400, Eric Lenio wrote:
> > > > On Fri, Oct 14, 2005 at 10:09:17PM +0100, Tim Bunce wrote:
> > > > > 
> > > > > Here's an off-the-top-of-my-head patch, totally untested and barely
> > > > > thought about, but it seems plausible...
> > > > > 
> > > > > Index: oci8.c
> > > > > ===================================================================
> > > > > --- oci8.c      (revision 1086)
> > > > > +++ oci8.c      (working copy)
> > > > > @@ -1223,9 +1223,9 @@
> > > > >                 /* FALLTHRU */
> > > > >         case  96:                               /* CHAR         */
> > > > >                 fbh->disize = fbh->dbsize;
> > > > > +               fbh->prec   = fbh->disize;
> > > > >                 if (CS_IS_UTF8(fbh->csid)) 
> > > > >                     fbh->disize = fbh->dbsize * 4;
> > > > > -               fbh->prec   = fbh->disize;
> > > > >                 break;
> > > > >         case  23:                               /* RAW          */
> > > > >                 fbh->disize = fbh->dbsize * 2;
> > > > > 
> > > > > Let me know if the test suite runs clean with this.
> > > > 
> > > > Tim yes the test suite does run clean, including using the additional
> > > > test I had made for t/20select.t.  Do you need any further information
> > > > from me on this?
> > > 
> > > No, thanks, but if you've got some time I'd appreciate more patches to
> > > extend the test suite further...
> > 
> > Sure thing...  do you want tests around $sth->{PRECISION} in general, or 
> > tests
> > specific to this patch?
> 
> Feel free to add tests for anything and everything that takes your fancy!
> 

Tim, I added 3 new tests around $sth->{PRECISION} in the attached diff
file (originally from DBD::Oracle 1.16).  This tests an integer column
(PRECISION of 38 in my environment), a character column (PRECISION of
10), and a date column (PRECISION of 75).

One thing I'm not sure of:  are these tests valid across all OS's and
Oracle environments?  If anyone can try these tests out on non-Solaris
systems (with Oracle 9.2.0.4) that would be great.  Or point out the
flaws in this approach to test, and I can try to amend the patch.

Eric.
--- t/20select.t.orig   Tue Oct 25 23:49:50 2005
+++ t/20select.t        Wed Oct 26 09:55:01 2005
@@ -54,7 +54,7 @@
 my $sz = 8;
 
 my $tests = 2;
-my $tests_per_set = 11;
+my $tests_per_set = 14;
 $tests += @test_sets * $tests_per_set;
 print "1..$tests\n";
 
@@ -107,6 +107,13 @@
   ok(0, $tmp->[2][1] =~ m/$data2/,
      cdif($tmp->[2][1], $data2, "Len ".length($tmp->[2][1])) );
   
+  # 10/25/2005 lenio: adding tests around $sth->{PRECISION}:
+  # 1st column, an integer, should have PRECISION of 38
+  ok(0, $sth->{PRECISION}->[0] == 38);
+  # 2nd column, character type, should have PRECISION of 10
+  ok(0, $sth->{PRECISION}->[1] == 10);
+  # 3rd column, date type, should have PRECISION of 75
+  ok(0, $sth->{PRECISION}->[2] == 75);
   
 } # end of run_select_tests
 

Reply via email to