CVS update: php3/functions

From: Date: Mon, 22 Feb 1999 12:35:07 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-4245@lists.php.net to get a copy of this message
Date: Monday February 22, 1999 @ 7:35 Author: thies Update of /repository/php3/functions In directory asf:/u/temp/cvs-serv29861 Modified Files: oci8.c Log Message: added workaround for truncated values (this seems to be a bug in oracle!). Index: php3/functions/oci8.c diff -c php3/functions/oci8.c:1.60 php3/functions/oci8.c:1.61 *** php3/functions/oci8.c:1.60 Mon Feb 22 07:21:37 1999 --- php3/functions/oci8.c Mon Feb 22 07:35:07 1999 *************** *** 32,38 **** +----------------------------------------------------------------------+ */ ! /* $Id: oci8.c,v 1.60 1999/02/22 12:21:37 thies Exp $ */ #include "php.h" #include "internal_functions.h" --- 32,38 ---- +----------------------------------------------------------------------+ */ ! /* $Id: oci8.c,v 1.61 1999/02/22 12:35:07 thies Exp $ */ #include "php.h" #include "internal_functions.h" *************** *** 67,72 **** --- 67,73 ---- * - remove all XXXs * - clean up and documentation * - OCINewContext function. + * - there seems to be a bug in OCI where it returns ORA-01406 (value truncated) - whereby it isn't (search for 01406 in the source) */ /* {{{ thread safety stuff */ *************** *** 703,710 **** --- 704,713 ---- ub4 loblen; char *buffer; + /* oci8_debug("oci8_make_pval: %s,rlen = %d,storage_size4 = %d,size2 = %d,indicator %d, retcode = %d", column->name,column->rlen,column->storage_size4,column->size2,column->indicator,column->retcode); + */ memset(value,0,sizeof(pval)); *************** *** 748,756 **** } } else { switch (column->retcode) { ! case 1406: /* truncated value */ ! oci8_debug("%s: truncated column %s", func,column->name); ! size = column->indicator; break; case 0: /* intact value */ --- 751,759 ---- } } else { switch (column->retcode) { ! case 1406: /* ORA-01406 XXX truncated value */ ! /* this seems to be a BUG in oracle oci8_debug("%s: truncated column %s", func,column->name); */ ! size = column->indicator; /* when value is truncated indicator contains the lenght */ break; case 0: /* intact value */ *************** *** 1084,1091 **** if ((column->define) && (! column->is_descr)) { pval = column->define->pval; ! ! pval->value.str.len = column->rlen; pval->value.str.val[ pval->value.str.len ] = 0; } } --- 1087,1099 ---- if ((column->define) && (! column->is_descr)) { pval = column->define->pval; ! ! if (column->retcode == 1406) { /*XXX ORA-1406 truncated value */ ! pval->value.str.len = column->indicator; /* when value is truncated indicator contains the lenght */ ! } else { ! pval->value.str.len = column->rlen; ! } ! pval->value.str.val[ pval->value.str.len ] = 0; } } *************** *** 1270,1277 **** --- 1278,1287 ---- *rcodep = &outcol->retcode; *piecep = OCI_ONE_PIECE; + /* oci8_debug("oci8_define_callback: %s,*bufpp = %x,**alenp = %d,**indpp = %d, **rcodep= %d, *piecep = %d", outcol->name,*bufpp,**alenp,**(ub2**)indpp,**rcodep,*piecep); + */ return OCI_CONTINUE; } -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#4245) next »