CVS update: php3/functions

From: Date: Fri, 19 Feb 1999 14:26:50 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-4158@lists.php.net to get a copy of this message
Date: Friday February 19, 1999 @ 9:26 Author: thies Update of /repository/php3/functions In directory asf:/u/temp/cvs-serv24499 Modified Files: oci8.c php3_oci8.h Log Message: added define-cache Index: php3/functions/oci8.c diff -c php3/functions/oci8.c:1.57 php3/functions/oci8.c:1.58 *** php3/functions/oci8.c:1.57 Fri Feb 19 09:00:01 1999 --- php3/functions/oci8.c Fri Feb 19 09:26:49 1999 *************** *** 32,38 **** +----------------------------------------------------------------------+ */ ! /* $Id: oci8.c,v 1.57 1999/02/19 14:00:01 thies Exp $ */ #include "php.h" #include "internal_functions.h" --- 32,38 ---- +----------------------------------------------------------------------+ */ ! /* $Id: oci8.c,v 1.58 1999/02/19 14:26:49 thies Exp $ */ #include "php.h" #include "internal_functions.h" *************** *** 65,71 **** * - persistend connections * - NULLS (retcode/indicator) needs some more work for describing & binding * - remove all XXXs - * - defining of Descriptors * - clean up and documentation * - OCINewContext function. */ --- 65,70 ---- *************** *** 1216,1227 **** pval = define->pval; convert_to_string(pval); ! /* do some smart caching here */ ! if (pval->value.str.val && (pval->value.str.val!=undefined_variable_string) && (pval->value.str.val!=empty_string)) { ! efree(define->pval->value.str.val); ! } ! pval->value.str.val = emalloc(outcol->storage_size4); outcol->data = pval->value.str.val; } else if (! outcol->data) { outcol->data = (text *) emalloc(outcol->storage_size4); --- 1215,1235 ---- pval = define->pval; convert_to_string(pval); ! if (pval->value.str.val) { ! if ((pval->value.str.val==undefined_variable_string) || (pval->value.str.val==empty_string)) { ! /* value was empty -> allocate it... */ ! pval->value.str.val = 0; ! } else if (pval->value.str.val != define->data) { ! /* value has changed - and is maybe too small -> reallocate it! */ ! efree(pval->value.str.val); ! pval->value.str.val = 0; ! } ! } ! if (pval->value.str.val == 0) { ! pval->value.str.val = emalloc(outcol->storage_size4); ! define->data = pval->value.str.val; ! } outcol->data = pval->value.str.val; } else if (! outcol->data) { outcol->data = (text *) emalloc(outcol->storage_size4); *************** *** 1243,1305 **** *piecep = OCI_ONE_PIECE; return OCI_CONTINUE; - - #if 0 - - switch (outcol->type) - case SQLT_RSET: /* ref. cursor XXX NYI */ - break; - - case SQLT_RDD: /* ROWID */ - case SQLT_BLOB: /* binary LOB */ - case SQLT_CLOB: /* character LOB */ - case SQLT_BFILE: /* binary file LOB */ - outcol->is_descr = 1; - - if (define) { - if (_php3_hash_find(define->pval->value.ht, "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { - php3_error(E_WARNING, "unable to find my descriptor property"); - break; - } - - if (_php3_hash_index_find(statement->conn->descriptors, tmp->value.lval, (void **)&pdescr) == FAILURE) { - php3_error(E_WARNING, "unable to find my descriptor"); - break; - } - } else { - if (outcol->type == SQLT_BFILE) { - descr.type = OCI_DTYPE_FILE; - } else if (outcol->type == SQLT_RDD ) { - descr.type = OCI_DTYPE_ROWID; - } else { - descr.type = OCI_DTYPE_LOB; - } - - OCIDescriptorAlloc(statement->conn->pEnv,(dvoid *)&(descr.ocidescr), descr.type, (size_t) 0, (dvoid **) 0); - - _php3_hash_index_update(statement->conn->descriptors, - statement->conn->descriptors_count,&descr,sizeof(oci8_descriptor),(void **)&pdescr); - - outcol->data = (void *)(void *) statement->conn->descriptors_count++; - - oci8_debug("OCIExecute: new descriptor for %d -> %x",outcol->data,descr.ocidescr); - } - - define_type = outcol->type; - - def_error = OCIDefineByPos(statement->pStmt, - (OCIDefine **)&outcol->pDefine, - statement->pError, - counter, - (dvoid *)&(pdescr->ocidescr), - (sb4)-1, - define_type, - (dvoid *)&outcol->indicator, - (ub2 *)&outcol->rlen, - (ub2 *)&outcol->retcode, - OCI_DEFAULT); - break; - #endif } /* }}} */ --- 1251,1256 ---- Index: php3/functions/php3_oci8.h diff -c php3/functions/php3_oci8.h:1.30 php3/functions/php3_oci8.h:1.31 *** php3/functions/php3_oci8.h:1.30 Fri Feb 19 09:00:02 1999 --- php3/functions/php3_oci8.h Fri Feb 19 09:26:50 1999 *************** *** 79,86 **** text *name; ub4 name_len; ub4 type; ! text *data; /* for pval cache */ ! int size; /* for pval cache */ } oci8_define; --- 79,85 ---- text *name; ub4 name_len; ub4 type; ! char *data; /* for pval cache */ } oci8_define; -- 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 (#4158) next »