On Fri, Mar 14, 2003 at 08:31:29AM +0100, Steffen Goeldner wrote:
> Tim Bunce wrote:
> > 
> > Thanks for the feedback.
> > 
> > I've put an updated release candidate here:
> > 
> >   http://homepage.eircom.net/~timbunce/DBD-Oracle-1.13-20030313gamma.tar.gz
> > 
> > Any feedback most welcome. Assuming there are no significant problems
> > I'll probably release this tomorrow.
> 
> I encountered two problems:
> 
>  - dbdimp.c 245: Undefined symbol 'PERL_MAGIC_shared_scalar' in function 
> ora_db_login6
>  - Unresolved external '_SvLOCK'
> 
> on that platform:
> 
> Summary of my perl5 (revision 5 version 6 subversion 1) configuration:
>   Platform:
>     osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread

Umm, they didn't show up on my 5.8.0 sun4-solaris-thread-multi system.

Doing find . -type f | xargs grep SvLOCK on perl5.6.1 finds:

./Changes:             rename totally bletcherous SvLOCK() thingy (doesn't do what the 
name suggests anyway)
./intrpvar.h:PERLVAR(Isv_lock_mutex,    perl_mutex)     /* mutex for SvLOCK macro */

whereas on 5.8.1 it finds:

./Changes:             rename totally bletcherous SvLOCK() thingy (doesn't do what the 
name suggests anyway)
./Changes:        Log: rename totally bletcherous SvLOCK() thingy (doesn't do what the 
name suggests anyway)
./intrpvar.h:PERLVAR(Isv_lock_mutex,    perl_mutex)     /* mutex for SvLOCK macro */
./pod/perlapi.pod:=item SvLOCK
./pod/perlapi.pod:      void    SvLOCK(SV* sv)
./pod/perltoc.pod:SvGETMAGIC, SvLOCK, SvSETMAGIC, SvSetMagicSV, SvSetMagicSV_nosteal,
./pp.c:    SvLOCK(sv);
./sv.h:=for apidoc Am|void|SvLOCK|SV* sv
./sv.h:#define SvLOCK(sv) CALL_FPTR(PL_lockhook)(aTHX_ sv)

The SvLOCK and PERL_MAGIC_shared_scalar are used by the thread-shared
dbh logic, so I'll just change the '#ifdef USE_ITHREADS' to
USE_ITHREADS && PERL_MAGIC_shared_scalar. I think that'll be fine.

I've attached a patch and I'd be grateful if you, or anyone else,
could test it for me.

Thanks.

Tim.
*** dbdimp.c    2003/03/13 14:28:50     1.74
--- dbdimp.c    2003/03/14 09:59:10
***************
*** 217,235 ****
  {
      dTHR;
      sword status;
!     SV **       shared_dbh_priv_svp ;
!     SV *        shared_dbh_priv_sv ;
      shared_sv * shared_dbh_ssv = NULL ;
      imp_dbh_t * shared_dbh     = NULL ;
!     STRLEN            shared_dbh_len  = 0 ;
!     SV **svp;
  #ifdef OCI_V8_SYNTAX
      struct OCIExtProcContext *this_ctx;
  #endif
      D_imp_drh_from_dbh;
  
!       
! #ifdef USE_ITHREADS
      shared_dbh_priv_svp = (DBD_ATTRIB_OK(attr)?hv_fetch((HV*)SvRV(attr), 
"ora_dbh_share", 13, 0):NULL) ;
      shared_dbh_priv_sv = shared_dbh_priv_svp?*shared_dbh_priv_svp:NULL ;
  
--- 217,237 ----
  {
      dTHR;
      sword status;
!     SV **svp;
      shared_sv * shared_dbh_ssv = NULL ;
      imp_dbh_t * shared_dbh     = NULL ;
! #if defined(USE_ITHREADS) && defined(PERL_MAGIC_shared_scalar)
!     SV **       shared_dbh_priv_svp ;
!     SV *        shared_dbh_priv_sv ;
!     STRLEN    shared_dbh_len  = 0 ;
! #endif
  #ifdef OCI_V8_SYNTAX
      struct OCIExtProcContext *this_ctx;
  #endif
      D_imp_drh_from_dbh;
  
! 
! #if defined(USE_ITHREADS) && defined(PERL_MAGIC_shared_scalar)
      shared_dbh_priv_svp = (DBD_ATTRIB_OK(attr)?hv_fetch((HV*)SvRV(attr), 
"ora_dbh_share", 13, 0):NULL) ;
      shared_dbh_priv_sv = shared_dbh_priv_svp?*shared_dbh_priv_svp:NULL ;
  
***************
*** 462,468 ****
      DBIc_ACTIVE_on(imp_dbh);  /* call disconnect before freeing       */
      imp_dbh->ph_type = 1;     /* SQLT_CHR "(ORANET TYPE) character string" */
  
! #ifdef USE_ITHREADS
      if (shared_dbh_ssv && !shared_dbh) {
        /* much of this could be replaced with a single sv_setpvn() */
        SvUPGRADE(shared_dbh_priv_sv, SVt_PV) ;
--- 464,470 ----
      DBIc_ACTIVE_on(imp_dbh);  /* call disconnect before freeing       */
      imp_dbh->ph_type = 1;     /* SQLT_CHR "(ORANET TYPE) character string" */
  
! #if defined(USE_ITHREADS) && defined(PERL_MAGIC_shared_scalar)
      if (shared_dbh_ssv && !shared_dbh) {
        /* much of this could be replaced with a single sv_setpvn() */
        SvUPGRADE(shared_dbh_priv_sv, SVt_PV) ;
***************
*** 554,560 ****
      dTHR;
      int refcnt = 1 ;
  
! #ifdef USE_ITHREADS
      if (DBIc_IMPSET(imp_dbh) && imp_dbh->shared_dbh) {
            SvLOCK (imp_dbh->shared_dbh_priv_sv) ;
            refcnt = imp_dbh -> shared_dbh -> refcnt ;
--- 556,562 ----
      dTHR;
      int refcnt = 1 ;
  
! #if defined(USE_ITHREADS) && defined(PERL_MAGIC_shared_scalar)
      if (DBIc_IMPSET(imp_dbh) && imp_dbh->shared_dbh) {
            SvLOCK (imp_dbh->shared_dbh_priv_sv) ;
            refcnt = imp_dbh -> shared_dbh -> refcnt ;
***************
*** 600,606 ****
      dTHX ;    
      int refcnt = 1 ;
        
! #ifdef USE_ITHREADS
        if (DBIc_IMPSET(imp_dbh) && imp_dbh->shared_dbh) {
                SvLOCK (imp_dbh->shared_dbh_priv_sv) ;
                refcnt = imp_dbh -> shared_dbh -> refcnt-- ;
--- 602,608 ----
      dTHX ;    
      int refcnt = 1 ;
        
! #if defined(USE_ITHREADS) && defined(PERL_MAGIC_shared_scalar)
        if (DBIc_IMPSET(imp_dbh) && imp_dbh->shared_dbh) {
                SvLOCK (imp_dbh->shared_dbh_priv_sv) ;
                refcnt = imp_dbh -> shared_dbh -> refcnt-- ;

Reply via email to