From bcd813c168fa8a17d130d6ffc80e877f4a019634 Mon Sep 17 00:00:00 2001 From: byterock Date: Fri, 17 Dec 2010 17:10:57 +0000 Subject: [PATCH] Fix for rt.cpan.org Ticket #=42842 Test 31lob fails with 64-bit Instant Client by John Scoles Mostly changes some long, int and UV to ub2 to account for 64 bit boxes Does not break anything in 32bit and will fix tthe lob length problem in 64 bit git-svn-id: http://svn.perl.org/modules/dbd-oracle/trunk@14589 50811bd7-b8ce-0310-adc1-d9db26280581 --- Oracle.h | 2 +- dbdimp.c | 2 +- dbdimp.h | 2 +- oci8.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Oracle.h b/Oracle.h index c02ad4c9..8713ee40 100644 --- a/Oracle.h +++ b/Oracle.h @@ -92,7 +92,7 @@ int dbd_describe _((SV *sth, imp_sth_t *imp_sth)); ub4 ora_blob_read_piece _((SV *sth, imp_sth_t *imp_sth, imp_fbh_t *fbh, SV *dest_sv, long offset, UV len, long destoffset)); ub4 ora_blob_read_mb_piece _((SV *sth, imp_sth_t *imp_sth, imp_fbh_t *fbh, SV *dest_sv, - long offset, UV len, long destoffset)); + long offset, ub4 len, long destoffset)); /* Oracle types */ #define ORA_VARCHAR2 1 diff --git a/dbdimp.c b/dbdimp.c index fac19b2f..78a761e0 100644 --- a/dbdimp.c +++ b/dbdimp.c @@ -296,7 +296,7 @@ fb_ary_cb_alloc(ub4 piece_size, ub4 max_len, int size) /* and setup the pointers in the head fb_ary struct */ Newz(42, fb_ary, sizeof(fb_ary_t), fb_ary_t); Newz(42, fb_ary->abuf, size * piece_size, ub1); - Newz(42, fb_ary->cb_abuf, size * max_len, ub1); + Newz(42, fb_ary->cb_abuf, size * max_len, ub2); Newz(42, fb_ary->aindp,(unsigned)size,sb2); Newz(42, fb_ary->arlen,(unsigned)size,ub2); Newz(42, fb_ary->arcode,(unsigned)size,ub2); diff --git a/dbdimp.h b/dbdimp.h index c08b10c4..e3aeef14 100644 --- a/dbdimp.h +++ b/dbdimp.h @@ -147,7 +147,7 @@ struct fb_ary_st { /* field buffer array EXPERIMENTAL */ ub4 piece_count;/*# of pieces retrieved*/ sb2 *aindp; /* null/trunc indicator variable */ ub1 *abuf; /* data buffer (points to sv data) */ - ub1 *cb_abuf; /*yet another buffer for picewise callbacks this means I only need to allocate memory once a prepare rather than at each fetch*/ + ub2 *cb_abuf; /*yet another buffer for picewise callbacks this means I only need to allocate memory once a prepare rather than at each fetch*/ ub2 *arlen; /* length of returned data */ ub2 *arcode; /* field level error status */ }; diff --git a/oci8.c b/oci8.c index 7a6701e2..634f5519 100644 --- a/oci8.c +++ b/oci8.c @@ -19,7 +19,7 @@ DBISTATE_DECLARE; -int describe_obj_by_tdo(SV *sth,imp_sth_t *imp_sth,fbh_obj_t *obj,int level ); +int describe_obj_by_tdo(SV *sth,imp_sth_t *imp_sth,fbh_obj_t *obj,ub2 level ); int dump_struct(imp_sth_t *imp_sth,fbh_obj_t *obj,int level); @@ -1553,7 +1553,7 @@ dbd_rebind_ph_lob(SV *sth, imp_sth_t *imp_sth, phs_t *phs) #ifdef UTF8_SUPPORT ub4 ora_blob_read_mb_piece(SV *sth, imp_sth_t *imp_sth, imp_fbh_t *fbh, - SV *dest_sv, long offset, UV len, long destoffset) + SV *dest_sv, long offset, ub4 len, long destoffset) { dTHX; ub4 loblen = 0; @@ -2851,7 +2851,7 @@ describe_obj(SV *sth,imp_sth_t *imp_sth,OCIParam *parm,fbh_obj_t *obj,int level } int -describe_obj_by_tdo(SV *sth,imp_sth_t *imp_sth,fbh_obj_t *obj,int level ) { +describe_obj_by_tdo(SV *sth,imp_sth_t *imp_sth,fbh_obj_t *obj,ub2 level ) { dTHX; sword status; text *type_name, *schema_name;