On 26/02/09 16:38, John Scoles wrote:
[snip]


If there is no danger then go ahead and patch and I will put it in the next release candidate RC4

Further investigation shows that there is less to be done to DBD:Oracle
than I had feared. Most of the compilation warnings for DBD::Oracle
come from the expansion of two DBI macros - DBIc_ACTIVE_off and
DBIc_ACTIVE_on. These warnings cannot be fixed by changing DBD::Oracle.

The new warnings from the compilation of calls of PerlIO_printf have
revealed a small number of type errors in DBD::Oracle itself, and one
actual bug. (The bug is that the tracing of OCIStmtGetPieceInfo fails
to dereference the 8th argument, which is a pointer to output data.)

I have attached a patch against 1.23-RC3 to fix these little problems.
I am confident that all it does is safe on both 32-bit and 64-bit
platforms. On my platform (Oracle 10g - SLES 10 sp 2 x86-64) RC3
passes all its tests both with and without the patch. With the patch,
it compiles without warnings - *except* those which come from the two
DBI macros mentioned above.

--
Charles Jardine - Computing Service, University of Cambridge
[email protected]    Tel: +44 1223 334506, Fax: +44 1223 334679
diff -r -u dbd_Oracle_123_RC3/dbdimp.c dbd_Oracle_123_RC3.patched/dbdimp.c
--- dbd_Oracle_123_RC3/dbdimp.c 2009-02-20 20:10:15.000000000 +0000
+++ dbd_Oracle_123_RC3.patched/dbdimp.c 2009-02-27 14:42:11.476693623 +0000
@@ -1079,7 +1079,7 @@
 bufp = SvPV(source, len);
 
        if (DBIS->debug >=3 || dbd_verbose >= 3 )
-               PerlIO_printf(DBILOGFP, " creating xml from string that is %d 
long\n",len);
+               PerlIO_printf(DBILOGFP, " creating xml from string that is %lu 
long\n",(unsigned long)len);
 
        if(len > MAX_OCISTRING_LEN) {
                src_type = OCI_XMLTYPE_CREATE_CLOB;
@@ -1568,16 +1568,16 @@
                        phs->array_lengths[i]=itemlen+1; /* Zero byte */
                        if (trace_level >= 3 || dbd_verbose >= 3 ){
                        PerlIO_printf(DBILOGFP, 
"dbd_rebind_ph_varchar2_table(): "
-                               "Copying length=%d array[%d]='%s'.\n",
-                               itemlen,i,str);
+                               "Copying length=%lu array[%d]='%s'.\n",
+                               (unsigned long)itemlen,i,str);
                        }
                }else{
                        /* Mark NULL */
                        phs->array_indicators[i]=1;
                        if (trace_level >= 3 || dbd_verbose >= 3 ){
                        PerlIO_printf(DBILOGFP, 
"dbd_rebind_ph_varchar2_table(): "
-                               "Copying length=%d array[%d]=NULL (length==0 or 
! str) .\n",
-                               itemlen,i);
+                               "Copying length=%lu array[%d]=NULL (length==0 
or ! str) .\n",
+                               (unsigned long)itemlen,i);
                        }
                }
                }else{
@@ -1609,8 +1609,8 @@
        }
        OCIBindArrayOfStruct_log_stat(phs->bndhp, imp_sth->errhp,
                (unsigned)phs->maxlen,  /* Skip parameter for the next data 
value */
-               sizeof (OCIInd),                /* Skip parameter for the next 
indicator value */
-               sizeof(unsigned short), /* Skip parameter for the next actual 
length value */
+               (unsigned)sizeof (OCIInd),      /* Skip parameter for the next 
indicator value */
+               (unsigned)sizeof(unsigned short), /* Skip parameter for the 
next actual length value */
                0,                                        /* Skip parameter for 
the next column-level error code */
                status);
        if (status != OCI_SUCCESS) {
@@ -2018,8 +2018,8 @@
        }
        OCIBindArrayOfStruct_log_stat(phs->bndhp, imp_sth->errhp,
                (unsigned)phs->maxlen,  /* Skip parameter for the next data 
value */
-               sizeof (OCIInd),                /* Skip parameter for the next 
indicator value */
-               sizeof(unsigned short), /* Skip parameter for the next actual 
length value */
+               (unsigned)sizeof (OCIInd),      /* Skip parameter for the next 
indicator value */
+               (unsigned)sizeof(unsigned short), /* Skip parameter for the 
next actual length value */
                0,                                        /* Skip parameter for 
the next column-level error code */
                status);
        if (status != OCI_SUCCESS) {
Only in dbd_Oracle_123_RC3.patched: dbdpatch
diff -r -u dbd_Oracle_123_RC3/oci8.c dbd_Oracle_123_RC3.patched/oci8.c
--- dbd_Oracle_123_RC3/oci8.c   2009-02-20 19:47:11.000000000 +0000
+++ dbd_Oracle_123_RC3.patched/oci8.c   2009-02-27 13:48:56.533623658 +0000
@@ -3751,7 +3751,7 @@
                phs_t *phs;
                SV **phs_svp = hv_fetch(imp_sth->all_params_hv, 
fbh->name,strlen(fbh->name), 0);
                if (!phs_svp)
-                       croak("panic: LOB refetch for '%s' param (%ld) - name 
not found",fbh->name,i+1);
+                       croak("panic: LOB refetch for '%s' param (%d) - name 
not found",fbh->name,i+1);
                phs = (phs_t*)(void*)SvPVX(*phs_svp);
                fbh->special = phs;
                if (DBIS->debug >= 3 || dbd_verbose >= 3 )
diff -r -u dbd_Oracle_123_RC3/ocitrace.h dbd_Oracle_123_RC3.patched/ocitrace.h
--- dbd_Oracle_123_RC3/ocitrace.h       2009-01-16 12:35:47.000000000 +0000
+++ dbd_Oracle_123_RC3.patched/ocitrace.h       2009-02-27 15:18:11.108036701 
+0000
@@ -51,7 +51,7 @@
        (DBD_OCI_TRACEON) \
                        ? PerlIO_printf(DBD_OCI_TRACEFP,\
                                 
"%sOCIStmtGetPieceInfo_log_stat(%p,%p,%u)=%s\n",\
-                                OciTp, (void*)errhp,fbh,(unsigned 
int)piece,oci_status_name(stat)),stat \
+                                OciTp, 
(void*)errhp,fbh,*piece,oci_status_name(stat)),stat \
        : stat
 
 
@@ -222,8 +222,8 @@
        stat = OCINlsEnvironmentVariableGet(    valp, size, item, charset, 
rsizep ); \
        (DBD_OCI_TRACEON) \
        ?       PerlIO_printf(DBD_OCI_TRACEFP,\
-                "%sNlsEnvironmentVariableGet(%d,%d,%d,%d,%d)=%s\n",\
-                OciTp, *valp, size, item, charset, *rsizep, 
oci_status_name(stat)),stat \
+                "%sNlsEnvironmentVariableGet(%d,%lu,%d,%d,%lu)=%s\n",\
+                OciTp, *valp, ul_t(size), item, charset, ul_t(*rsizep), 
oci_status_name(stat)),stat \
        : stat
 
 /* added by lab */
@@ -464,9 +464,9 @@
        stat=OCIServerAttach( imp_dbh->srvhp, imp_dbh->errhp,           \
                (text*)dbname, (sb4)strlen(dbname), md);                        
        \
        (DBD_OCI_TRACEON) ? PerlIO_printf(DBD_OCI_TRACEFP,                      
\
-               "%sServerAttach(%p, %p, \"%s\", %d, mode=%s,%lu)=%s\n",         
        \
+               "%sServerAttach(%p, %p, \"%s\", %lu, mode=%s,%lu)=%s\n",        
                \
                OciTp, (void*)imp_dbh->srvhp,(void*)imp_dbh->errhp, dbname,     
\
-               strlen(dbname), 
oci_mode(md),ul_t(md),oci_status_name(stat)),stat : stat
+               ul_t(strlen(dbname)), 
oci_mode(md),ul_t(md),oci_status_name(stat)),stat : stat
 
 #define OCIStmtExecute_log_stat(sv,st,eh,i,ro,si,so,md,stat)                   
\
        stat=OCIStmtExecute(sv,st,eh,i,ro,si,so,md);                    \

Reply via email to