cvs: php4 /ext/oci8 oci8.c

From: Date: Mon, 17 Sep 2001 20:52:32 +0000
Subject: cvs: php4 /ext/oci8 oci8.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-7449@lists.php.net to get a copy of this message
dbenson Mon Sep 17 16:52:32 2001 EDT Modified files: /php4/ext/oci8 oci8.c Log: Change duration of temporary lobs to avoid leakage of temporary lob space (dbenson). Index: php4/ext/oci8/oci8.c diff -u php4/ext/oci8/oci8.c:1.155 php4/ext/oci8/oci8.c:1.156 --- php4/ext/oci8/oci8.c:1.155 Sun Sep 16 17:53:58 2001 +++ php4/ext/oci8/oci8.c Mon Sep 17 16:52:31 2001 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8.c,v 1.155 2001/09/16 21:53:58 asautins Exp $ */ +/* $Id: oci8.c,v 1.156 2001/09/17 20:52:31 dbenson Exp $ */ /* TODO list: * @@ -620,7 +620,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "OCI8 Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.155 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.156 $"); #ifndef PHP_WIN32 php_info_print_table_row(2, "Oracle Version", PHP_OCI8_VERSION ); php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DIR ); @@ -3336,8 +3336,8 @@ OCI_DEFAULT, OCI_DEFAULT, OCI_TEMP_CLOB, - TRUE, - OCI_DURATION_SESSION)); + OCI_ATTR_NOCACHE, + OCI_DURATION_STATEMENT)); if (connection->error) { oci_error(connection->pError, "OCILobCreateTemporary", connection->error); @@ -3361,7 +3361,7 @@ loblen = (*var)->value.str.len; if (loblen < 1) { - php_error(E_WARNING, "Cannot save a lob wich size is less than 1 byte"); + php_error(E_WARNING, "Cannot save a lob that is less than 1 byte"); RETURN_FALSE; } @@ -3400,6 +3400,7 @@ OCILobLocator *mylob; oci_connection *connection; oci_descriptor *descriptor; + int is_temporary; if ((id = getThis()) != 0) { inx = _oci_get_ocidesc(id,&descriptor TSRMLS_CC); @@ -3424,6 +3425,26 @@ RETURN_FALSE; } + connection->error = + OCILobIsTemporary(OCI(pEnv), + connection->pError, + mylob, + &is_temporary); + if (is_temporary) { + connection->error = + OCILobFreeTemporary(connection->pServiceContext, + connection->pError, + mylob); + + if (connection->error) { + oci_error(connection->pError, "OCILobFreeTemporary", + connection->error); + oci_handle_error(connection, connection->error); + RETURN_FALSE; + } + oci_debug("oci_lob_free_temporary: descr=%d",inx); + } + oci_debug("oci_close_lob: descr=%d",inx); RETURN_TRUE; } @@ -5100,8 +5121,8 @@ } switch(coll->coll_typecode) { + case OCI_TYPECODE_TABLE: case OCI_TYPECODE_VARRAY: - case OCI_TYPECODE_TABLE: CALL_OCI_RETURN(connection->error, OCIAttrGet( (dvoid*) parmp1, (ub4) OCI_DTYPE_PARAM,

« previous php.cvs (#7449) next »