CVS update: php3/functions
| From: | thies | Date: | Mon, 05 Apr 1999 18:24:45 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-4930@lists.php.net to get a copy of this message | ||
Date: Monday April 5, 1999 @ 14:24
Author: thies
Update of /repository/php3/functions
In directory asf:/u/temp/cvs-serv2829
Modified Files:
oci8.c
Log Message:
fixed bug with returning of NULL columns....
this does NOT fix #1276 (to come tomorrow;-)
Index: php3/functions/oci8.c
diff -c php3/functions/oci8.c:1.70 php3/functions/oci8.c:1.71
*** php3/functions/oci8.c:1.70 Tue Mar 30 05:20:15 1999
--- php3/functions/oci8.c Mon Apr 5 14:24:44 1999
***************
*** 33,39 ****
#define OCI8_USE_EMALLOC 0 /* set this to 1 if you want to use the php memory manager! */
! /* $Id: oci8.c,v 1.70 1999/03/30 10:20:15 thies Exp $ */
/* TODO list:
*
--- 33,39 ----
#define OCI8_USE_EMALLOC 0 /* set this to 1 if you want to use the php memory manager! */
! /* $Id: oci8.c,v 1.71 1999/04/05 18:24:44 thies Exp $ */
/* TODO list:
*
***************
*** 443,450 ****
}
/* }}} */
- /* {{{ extension-internal functions */
-
/* {{{ debug malloc/realloc/free */
#if OCI8_USE_EMALLOC
--- 443,448 ----
***************
*** 785,791 ****
if (pval->type == IS_STRING) {
for (i = 0; i < statement->ncolumns; i++) {
outcol = oci8_get_col(statement, i + 1, 0, func);
! if (outcol == NULL || outcol->indicator == -1) {
continue;
} else if (((int) outcol->name_len == pval->value.str.len)
&& (!
strncmp(outcol->name,pval->value.str.val,pval->value.str.len))) {
--- 783,789 ----
if (pval->type == IS_STRING) {
for (i = 0; i < statement->ncolumns; i++) {
outcol = oci8_get_col(statement, i + 1, 0, func);
! if (outcol == NULL) {
continue;
} else if (((int) outcol->name_len == pval->value.str.len)
&& (!
strncmp(outcol->name,pval->value.str.val,pval->value.str.len))) {
***************
*** 1654,1665 ****
}
/* }}} */
! /* {{{ oci8_do_connect()
! Connect to an Oracle database and log on. returns a new session.
*/
static int oci8_detach(oci8_server *server)
{
}
/* }}} */
--- 1652,1663 ----
}
/* }}} */
! /* {{{ oci8_detach()
*/
static int oci8_detach(oci8_server *server)
{
+ return 0;
}
/* }}} */
***************
*** 1714,1720 ****
if (persistent) {
list_entry *le;
! if (_php3_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==SUCCESS)
{ /* got you!!! */
if (le->type != OCI8_GLOBAL(php3_oci8_module).le_pconn) {
goto CLEANUP;
}
--- 1712,1720 ----
if (persistent) {
list_entry *le;
! if (_php3_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==SUCCESS)
{
! /* got you!!! */
!
if (le->type != OCI8_GLOBAL(php3_oci8_module).le_pconn) {
goto CLEANUP;
}
***************
*** 1729,1740 ****
RETURN_LONG(connection->id);
} else {
! if (OCI8_GLOBAL(php3_oci8_module).max_links!=-1 &&
OCI8_GLOBAL(php3_oci8_module).num_links>=OCI8_GLOBAL(php3_oci8_module).max_links) {
php3_error(E_WARNING,"OCI8: Too many open links
(%d)",OCI8_GLOBAL(php3_oci8_module).num_links);
goto CLEANUP;
}
! if (OCI8_GLOBAL(php3_oci8_module).max_persistent!=-1 &&
OCI8_GLOBAL(php3_oci8_module).num_persistent>=OCI8_GLOBAL(php3_oci8_module).max_persistent) {
! php3_error(E_WARNING,"OCI8: Too many open persistent links
(%d)",OCI8_GLOBAL(php3_oci8_module).num_persistent);
goto CLEANUP;
}
--- 1729,1743 ----
RETURN_LONG(connection->id);
} else {
! if (OCI8_GLOBAL(php3_oci8_module).max_links!=-1 &&
! OCI8_GLOBAL(php3_oci8_module).num_links>=OCI8_GLOBAL(php3_oci8_module).max_links) {
php3_error(E_WARNING,"OCI8: Too many open links
(%d)",OCI8_GLOBAL(php3_oci8_module).num_links);
goto CLEANUP;
}
! if (OCI8_GLOBAL(php3_oci8_module).max_persistent!=-1 &&
! OCI8_GLOBAL(php3_oci8_module).num_persistent>=OCI8_GLOBAL(php3_oci8_module).max_persistent)
{
! php3_error(E_WARNING,"OCI8: Too many open persistent links (%d)",
! OCI8_GLOBAL(php3_oci8_module).num_persistent);
goto CLEANUP;
}
***************
*** 1768,1804 ****
OCIHandleAlloc(connection->pEnv, (dvoid **)&connection->pServer, OCI_HTYPE_SERVER, 0,
NULL);
OCIHandleAlloc(connection->pEnv, (dvoid **)&connection->pSession, OCI_HTYPE_SESSION, 0,
NULL);
! error = OCIServerAttach(connection->pServer,connection->pError,dbname,dbname_len, (ub4)
OCI_DEFAULT);
if (error) {
oci8_error(connection->pError, "OCIServerAttach", error);
RETURN_FALSE;
}
! error = OCIAttrSet((dvoid *) connection->pSession,(ub4) OCI_HTYPE_SESSION, (dvoid *) username,
(ub4) username_len, (ub4) OCI_ATTR_USERNAME, connection->pError);
if (error) {
oci8_error(connection->pError, "OCIAttrSet OCI_ATTR_USERNAME", error);
goto CLEANUP;
}
! error = OCIAttrSet((dvoid *) connection->pSession,(ub4) OCI_HTYPE_SESSION, (dvoid *) password,
(ub4) password_len, (ub4) OCI_ATTR_PASSWORD, connection->pError);
if (error) {
oci8_error(connection->pError, "OCIAttrSet OCI_ATTR_PASSWORD", error);
goto CLEANUP;
}
! error = OCIAttrSet((dvoid *)connection->pServiceContext, (ub4) OCI_HTYPE_SVCCTX,(dvoid *)
connection->pServer, (ub4) 0, (ub4) OCI_ATTR_SERVER, connection->pError);
if (error) {
oci8_error(connection->pError, "OCIAttrSet OCI_ATTR_SERVER", error);
goto CLEANUP;
}
! error =
OCISessionBegin(connection->pServiceContext,connection->pError,connection->pSession, (ub4)
OCI_CRED_RDBMS, (ub4) OCI_DEFAULT);
if (error) {
oci8_error(connection->pError, "OCISessionBegin", error);
goto CLEANUP;
}
! error = OCIAttrSet((dvoid *)connection->pServiceContext,(ub4) OCI_HTYPE_SVCCTX, (dvoid *)
connection->pSession, (ub4) 0, (ub4) OCI_ATTR_SESSION, connection->pError);
if (error) {
oci8_error(connection->pError, "OCIAttrSet OCI_ATTR_SESSION", error);
goto CLEANUP;
--- 1771,1835 ----
OCIHandleAlloc(connection->pEnv, (dvoid **)&connection->pServer, OCI_HTYPE_SERVER, 0,
NULL);
OCIHandleAlloc(connection->pEnv, (dvoid **)&connection->pSession, OCI_HTYPE_SESSION, 0,
NULL);
! error = OCIServerAttach(connection->pServer,
! connection->pError,
! dbname,
! dbname_len,
! (ub4) OCI_DEFAULT);
if (error) {
oci8_error(connection->pError, "OCIServerAttach", error);
RETURN_FALSE;
}
! error = OCIAttrSet((dvoid *) connection->pSession,
! (ub4) OCI_HTYPE_SESSION,
! (dvoid *) username,
! (ub4) username_len,
! (ub4) OCI_ATTR_USERNAME,
! connection->pError);
if (error) {
oci8_error(connection->pError, "OCIAttrSet OCI_ATTR_USERNAME", error);
goto CLEANUP;
}
! error = OCIAttrSet((dvoid *) connection->pSession,
! (ub4) OCI_HTYPE_SESSION,
! (dvoid *) password,
! (ub4) password_len,
! (ub4) OCI_ATTR_PASSWORD,
! connection->pError);
if (error) {
oci8_error(connection->pError, "OCIAttrSet OCI_ATTR_PASSWORD", error);
goto CLEANUP;
}
! error = OCIAttrSet((dvoid *)connection->pServiceContext,
! (ub4) OCI_HTYPE_SVCCTX,
! (dvoid *) connection->pServer,
! (ub4) 0,
! (ub4) OCI_ATTR_SERVER,
! connection->pError);
if (error) {
oci8_error(connection->pError, "OCIAttrSet OCI_ATTR_SERVER", error);
goto CLEANUP;
}
! error = OCISessionBegin(connection->pServiceContext,
! connection->pError,
! connection->pSession,
! (ub4) OCI_CRED_RDBMS,
! (ub4) OCI_DEFAULT);
if (error) {
oci8_error(connection->pError, "OCISessionBegin", error);
goto CLEANUP;
}
! error = OCIAttrSet((dvoid *)connection->pServiceContext,
! (ub4) OCI_HTYPE_SVCCTX,
! (dvoid *) connection->pSession,
! (ub4) 0,
! (ub4) OCI_ATTR_SESSION,
! connection->pError);
if (error) {
oci8_error(connection->pError, "OCIAttrSet OCI_ATTR_SESSION", error);
goto CLEANUP;
***************
*** 1827,1833 ****
new_le.type = OCI8_GLOBAL(php3_oci8_module).le_pconn;
new_le.ptr = connection;
! if (_php3_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le,
sizeof(list_entry), NULL)==FAILURE) {
/* XXX close connection here */
goto CLEANUP;
}
--- 1858,1865 ----
new_le.type = OCI8_GLOBAL(php3_oci8_module).le_pconn;
new_le.ptr = connection;
! if (_php3_hash_update(plist, hashed_details, hashed_details_length+1,
! (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) {
/* XXX close connection here */
goto CLEANUP;
}
--
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