# This is a patch for orig\DBD-Oracle-1.13 to bring it up to DBD-Oracle-1.13.

# To apply this patch, chdir to you orig\DBD-Oracle-1.13 source directory and enter
#
#     patch -p1 -N < <this-file>

Index: DBD-Oracle-1.13/Makefile.PL
*** orig/DBD-Oracle-1.13/Makefile.PL	Wed Mar 12 15:16:42 2003
--- DBD-Oracle-1.13/Makefile.PL	Wed Mar 12 22:14:27 2003
***************
*** 504,509 ****
--- 504,513 ----
  
  # --- Handle special cases ---
  
+ if ($::opt_g && $os eq "MSWin32" && $Config::Config{cc} eq "cl") {
+    $opts{LDDLFLAGS} = $Config::Config{lddlflags} . ' -debug'
+ }
+ 
  $opts{DEFINE} .= ' -Wall -Wno-comment' if $Config{gccversion} eq 'gcc';
  
  $opts{DEFINE} .= ' -Xa' if $Config{cc} eq 'clcc';	# CenterLine CC
***************
*** 1278,1291 ****
--- 1282,1301 ----
  	local($_) = $self->SUPER::const_cccmd(@_);
  	# If perl Makefile.PL *-g* then switch on debugging
  	if ($::opt_g) {
+ 	   if ($os eq "MSWin32" and $Config::Config{cc} eq 'cl') {
+ 	      s/\s-/ -Zi -/;
+ 	      s/-O1//;
+ 	   } else {
  	    s/\s-O\d?\b//;	# delete optimise option
  	    s/\s-/ -g -/;	# add -g option
+ 	   }
  	}
  	# are we using the non-bundled hpux compiler?
  	if ($os eq "hpux" and $Config::Config{ccflags} =~ /-Aa\b/) {
  	    print "Changing -Aa to -Ae for HP-UX in ccmd.\n"
  	     if s/-Aa\b/-Ae/g;	# allow "long long" in oratypes.h
  	}
+ 
  	$_;
      }
  
***************
*** 1294,1301 ****
  	local($_) = $self->SUPER::cflags(@_);
  	# If perl Makefile.PL *-g* then switch on debugging
  	if ($::opt_g) {
! 	    s/\s-O\d?\b//;	# delete optimise option
! 	    s/\s-/ -g -/;	# add -g option
  	}
  	# are we using the non-bundled hpux compiler?
  	if ($os eq "hpux" and $Config::Config{ccflags} =~ /-Aa\b/) {
--- 1304,1317 ----
  	local($_) = $self->SUPER::cflags(@_);
  	# If perl Makefile.PL *-g* then switch on debugging
  	if ($::opt_g) {
! 	   if ($os eq "MSWin32" and $Config::Config{cc} eq 'cl') {
! 	      s/\s-/ -Zi -/;
! 	      s/-O1//;
! 	      
! 	   } else {
! 	      s/\s-O\d?\b//;	# delete optimise option
!   	      s/\s-/ -g -/;	# add -g option
! 	   }
  	}
  	# are we using the non-bundled hpux compiler?
  	if ($os eq "hpux" and $Config::Config{ccflags} =~ /-Aa\b/) {
Index: DBD-Oracle-1.13/oci7.c
Prereq:  1.15 
*** orig/DBD-Oracle-1.13/oci7.c	Wed Mar 12 15:29:34 2003
--- DBD-Oracle-1.13/oci7.c	Wed Mar 12 22:14:35 2003
***************
*** 21,40 ****
  
  DBISTATE_DECLARE;
  
! static SV *ora_long;
  static SV *ora_trunc;
  static SV *ora_cache;
  static SV *ora_cache_o;		/* for ora_open() cache override */
  
  void
! dbd_init_oci(dbistate)
!     dbistate_t *dbistate;
  {
!     DBISTATE_ASSIGN(dbistate);
!     ora_long     = perl_get_sv("Oraperl::ora_long",      GV_ADDMULTI);
!     ora_trunc    = perl_get_sv("Oraperl::ora_trunc",     GV_ADDMULTI);
!     ora_cache    = perl_get_sv("Oraperl::ora_cache",     GV_ADDMULTI);
!     ora_cache_o  = perl_get_sv("Oraperl::ora_cache_o",   GV_ADDMULTI);
  }
  
  
--- 21,47 ----
  
  DBISTATE_DECLARE;
  
! /* JLU: Looks like these are being moved to imp_drh... */
! #if 0
! static SV *ora_long; 
  static SV *ora_trunc;
  static SV *ora_cache;
  static SV *ora_cache_o;		/* for ora_open() cache override */
+ #endif
+ 
+ void
+    dbd_init_oci(dbistate_t *dbistate)
+ {
+     DBIS = dbistate;
+ }
  
  void
!    dbd_init_oci_drh(imp_drh_t * imp_drh)
  {
!     imp_drh->ora_long    = perl_get_sv("Oraperl::ora_long",      GV_ADDMULTI);
!     imp_drh->ora_trunc   = perl_get_sv("Oraperl::ora_trunc",     GV_ADDMULTI);
!     imp_drh->ora_cache   = perl_get_sv("Oraperl::ora_cache",     GV_ADDMULTI);
!     imp_drh->ora_cache_o = perl_get_sv("Oraperl::ora_cache_o",   GV_ADDMULTI);
  }
  
  
***************
*** 78,83 ****
--- 85,91 ----
      static U32  f_cbufl_max;
  
      D_imp_dbh_from_sth;
+     D_imp_drh_from_dbh;
      I32	long_buflen;
      sb1 *cbuf_ptr;
      int t_cbufl=0;
***************
*** 94,101 ****
      /* ora_trunc is checked at fetch time */
      /* long_buflen:	length for long/longraw (if >0), else 80 (ora app dflt)	*/
      /* Ought to be for COMPAT mode only but was relaxed before LongReadLen existed */
!     long_buflen = (SvOK(ora_long) && SvIV(ora_long)>0)
! 				? SvIV(ora_long) : DBIc_LongReadLen(imp_sth);
      if (long_buflen < 0)		/* trap any sillyness */
  	long_buflen = 80;		/* typical oracle app default	*/
  
--- 102,109 ----
      /* ora_trunc is checked at fetch time */
      /* long_buflen:	length for long/longraw (if >0), else 80 (ora app dflt)	*/
      /* Ought to be for COMPAT mode only but was relaxed before LongReadLen existed */
!     long_buflen = (SvOK(imp_drh->ora_long) && SvIV(imp_drh->ora_long)>0)
! 				? SvIV(imp_drh->ora_long) : DBIc_LongReadLen(imp_sth);
      if (long_buflen < 0)		/* trap any sillyness */
  	long_buflen = 80;		/* typical oracle app default	*/
  
***************
*** 122,129 ****
      }
  
      /* number of rows to cache	*/
!     if      (SvOK(ora_cache_o)) imp_sth->cache_rows = SvIV(ora_cache_o);
!     else if (SvOK(ora_cache))   imp_sth->cache_rows = SvIV(ora_cache);
      else                        imp_sth->cache_rows = imp_dbh->RowCacheSize;
  
      /* Get number of fields and space needed for field names	*/
--- 130,137 ----
      }
  
      /* number of rows to cache	*/
!     if      (SvOK(imp_drh->ora_cache_o)) imp_sth->cache_rows = SvIV(imp_drh->ora_cache_o);
!     else if (SvOK(imp_drh->ora_cache))   imp_sth->cache_rows = SvIV(imp_drh->ora_cache);
      else                        imp_sth->cache_rows = imp_dbh->RowCacheSize;
  
      /* Get number of fields and space needed for field names	*/
***************
*** 308,313 ****
--- 316,323 ----
      int err = 0;
      int i;
      AV *av;
+     D_imp_dbh_from_sth;
+     D_imp_drh_from_dbh;
  
      if (!imp_sth->in_cache) {	/* refill cache if empty	*/
  	int previous_rpc;
***************
*** 377,383 ****
  	if (rc == 1406 && OTYPE_IS_LONG(fbh->ftype)) {
  	    /* We have a LONG field which has been truncated.		*/
  	    int oraperl = DBIc_COMPAT(imp_sth);
! 	    if (DBIc_has(imp_sth,DBIcf_LongTruncOk) || (oraperl && SvIV(ora_trunc))) {
  		/* user says truncation is ok */
  		/* Oraperl recorded the truncation in ora_errno so we	*/
  		/* so also but only for Oraperl mode handles.		*/
--- 387,393 ----
  	if (rc == 1406 && OTYPE_IS_LONG(fbh->ftype)) {
  	    /* We have a LONG field which has been truncated.		*/
  	    int oraperl = DBIc_COMPAT(imp_sth);
! 	    if (DBIc_has(imp_sth,DBIcf_LongTruncOk) || (oraperl && SvIV(imp_drh->ora_trunc))) {
  		/* user says truncation is ok */
  		/* Oraperl recorded the truncation in ora_errno so we	*/
  		/* so also but only for Oraperl mode handles.		*/
Index: DBD-Oracle-1.13/t/cursor.t
*** orig/DBD-Oracle-1.13/t/cursor.t	Wed Mar 12 19:12:53 2003
--- DBD-Oracle-1.13/t/cursor.t	Wed Mar 12 22:21:32 2003
***************
*** 21,27 ****
  $| = 1;
  
  my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
! my $dbh = DBI->connect('', $dbuser, '', 'Oracle');
  
  unless($dbh) {
  	warn "Unable to connect to Oracle ($DBI::errstr)\nTests skipped.\n";
--- 21,27 ----
  $| = 1;
  
  my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
! my $dbh = DBI->connect('dbi:Oracle:', $dbuser, '');
  
  unless($dbh) {
  	warn "Unable to connect to Oracle ($DBI::errstr)\nTests skipped.\n";
***************
*** 29,34 ****
--- 29,38 ----
  	exit 0;
  }
  
+ if ( DBD::Oracle::ORA_OCI() < 8 ) {
+    print "1..0 # Skipped: oci 7 not supported\n";
+    exit 0;
+ }
  # ORA-00900: invalid SQL statement
  # ORA-06553: PLS-213: package STANDARD not accessible
  my $tst = $dbh->prepare(q{declare foo char(50); begin RAISE INVALID_NUMBER; end;});


End of Patch.
