develooper Front page | perl.dbd.oracle.changes | Postings from April 2012

[svn:dbd-oracle] r15280 - in dbd-oracle/trunk: . t

From:
mjevans
Date:
April 22, 2012 01:08
Subject:
[svn:dbd-oracle] r15280 - in dbd-oracle/trunk: . t
Message ID:
20120422080836.EA6F2184B0A@xx12.develooper.com
Author: mjevans
Date: Sun Apr 22 01:08:34 2012
New Revision: 15280

Modified:
   dbd-oracle/trunk/Changes
   dbd-oracle/trunk/Oracle.xs
   dbd-oracle/trunk/dbdimp.c
   dbd-oracle/trunk/t/51scroll.t

Log:
Fixed rt 76695
minor debug change


Modified: dbd-oracle/trunk/Changes
==============================================================================
--- dbd-oracle/trunk/Changes	(original)
+++ dbd-oracle/trunk/Changes	Sun Apr 22 01:08:34 2012
@@ -1,5 +1,16 @@
 Revision history for DBD::Oracle
 
+NEXT
+ [BUG FIXES]
+
+ - Fixed 76695 - offset passed to ora_fetch_scroll should not affect
+   normal fetches (Martin J. Evans)
+
+ [MISCELLANEOUS]
+
+ - minor change to confusing debug output for input parameters
+   (Martin J. Evans)
+
 1.43_00   2012-03-30
 
  [BUG FIXES]

Modified: dbd-oracle/trunk/Oracle.xs
==============================================================================
--- dbd-oracle/trunk/Oracle.xs	(original)
+++ dbd-oracle/trunk/Oracle.xs	Sun Apr 22 01:08:34 2012
@@ -160,6 +160,7 @@
  	imp_sth->fetch_orient=fetch_orient;
 	imp_sth->fetch_offset=fetch_offset;
 	av = dbd_st_fetch(sth,imp_sth);
+    imp_sth->fetch_offset = 1;                  /* default back to 1 for fetch */
 	ST(0) = (av) ? sv_2mortal(newRV((SV *)av)) : &PL_sv_undef;
 }
 

Modified: dbd-oracle/trunk/dbdimp.c
==============================================================================
--- dbd-oracle/trunk/dbdimp.c	(original)
+++ dbd-oracle/trunk/dbdimp.c	Sun Apr 22 01:08:34 2012
@@ -2662,14 +2662,13 @@
 	phs->alen = value_len + phs->alen_incnull;
 
 	if (DBIc_DBISTATE(imp_sth)->debug >= 3 || dbd_verbose >= 3 ) {
-		UV neatsvpvlen = (UV)DBIc_DBISTATE(imp_sth)->neatsvpvlen;
+		/*UV neatsvpvlen = (UV)DBIc_DBISTATE(imp_sth)->neatsvpvlen;*/
 		char *val = neatsvpv(phs->sv,10);
 		PerlIO_printf(
             DBIc_LOGPIO(imp_sth),
-            "dbd_rebind_ph_char() (2): bind %s <== '%.*s' (size %ld/%ld, "
+            "dbd_rebind_ph_char() (2): bind %s <== %.1000s (size %ld/%ld, "
             "otype %d(%s), indp %d, at_exec %d)\n",
 			phs->name,
-			(int)(phs->alen > neatsvpvlen ? neatsvpvlen : phs->alen),
 			(phs->progv) ?  val: "",
 			(long)phs->alen, (long)phs->maxlen,
             phs->ftype,sql_typecode_name(phs->ftype), phs->indp, at_exec);

Modified: dbd-oracle/trunk/t/51scroll.t
==============================================================================
--- dbd-oracle/trunk/t/51scroll.t	(original)
+++ dbd-oracle/trunk/t/51scroll.t	Sun Apr 22 01:08:34 2012
@@ -24,7 +24,7 @@
                                                AutoCommit=>1,
                                                PrintError => 0 })};
 if ($dbh) {
-    plan tests => 32;
+    plan tests => 34;
 } else {
     plan skip_all => "Unable to connect to Oracle";
 }
@@ -34,7 +34,7 @@
 isa_ok($dbh, "DBI::db");
 
 my $table = table();
-
+#drop_table($dbh);
 
 $dbh->do(qq{
 	CREATE TABLE $table (
@@ -113,6 +113,14 @@
 
 cmp_ok($sth->ora_scroll_position(), '==', 1, '... we should get the 1 for the ora_scroll_position');
 
+# now fetch forward 2 places then just call fetch
+# it should give us the 4th rcord and not the 5th
+
+$value =  $sth->ora_fetch_scroll(OCI_FETCH_RELATIVE,2);
+is($value->[0], 3, '... we should get the 3rd record');
+($value) = $sth->fetchrow;
+is($value, 4, '... we should get the 4th record');
+
 $sth->finish();
 drop_table($dbh);
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About