tony2001 Mon Aug 21 16:41:13 2006 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/oci8 oci8.c oci8_collection.c oci8_lob.c
oci8_statement.c php_oci8_int.h
/php-src NEWS
Log:
MFH: fix PECL bug #8112 (OCI8 persistent connections misbehave when Apache
process times out)
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.269.2.16.2.18&r2=1.269.2.16.2.19&diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.269.2.16.2.18
php-src/ext/oci8/oci8.c:1.269.2.16.2.19
--- php-src/ext/oci8/oci8.c:1.269.2.16.2.18 Tue Aug 15 13:08:34 2006
+++ php-src/ext/oci8/oci8.c Mon Aug 21 16:41:12 2006
@@ -26,7 +26,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8.c,v 1.269.2.16.2.18 2006/08/15 13:08:34 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.269.2.16.2.19 2006/08/21 16:41:12 tony2001 Exp $ */
/* TODO
*
* file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty()
with OCI_ATTR_LOBEMPTY
@@ -652,7 +652,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "OCI8 Support", "enabled");
php_info_print_table_row(2, "Version", "1.2.1");
- php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.16.2.18 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.16.2.19 $");
sprintf(buf, "%ld", OCI_G(num_persistent));
php_info_print_table_row(2, "Active Persistent Connections", buf);
@@ -916,14 +916,14 @@
*sqltext = NULL;
*error_offset = 0;
- statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)statement->stmt, OCI_HTYPE_STMT, (text *) sqltext, (ub4 *)0,
OCI_ATTR_STATEMENT, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid
*)statement->stmt, OCI_HTYPE_STMT, (text *) sqltext, (ub4 *)0,
OCI_ATTR_STATEMENT, statement->err));
if (statement->errcode != OCI_SUCCESS) {
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
return 1;
}
- statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)statement->stmt, OCI_HTYPE_STMT, (ub2 *)error_offset, (ub4 *)0,
OCI_ATTR_PARSE_ERROR_OFFSET, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid
*)statement->stmt, OCI_HTYPE_STMT, (ub2 *)error_offset, (ub4 *)0,
OCI_ATTR_PARSE_ERROR_OFFSET, statement->err));
if (statement->errcode != OCI_SUCCESS) {
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
@@ -1014,7 +1014,7 @@
#if HAVE_OCI_ENV_NLS_CREATE
if (charset && *charset) {
- charsetid = PHP_OCI_CALL(OCINlsCharSetNameToId, (OCI_G(env),
charset));
+ PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId,
(OCI_G(env), charset));
if (!charsetid) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid
character set name: %s", charset);
} else {
@@ -1027,7 +1027,7 @@
size_t rsize = 0;
sword result;
- result = PHP_OCI_CALL(OCINlsEnvironmentVariableGet,
(&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize))
+ PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet,
(&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize))
if (result != OCI_SUCCESS) {
charsetid_nls_lang = 0;
}
@@ -1176,18 +1176,18 @@
}
/* create an environment using the character set id, Oracle 9i+ ONLY */
- OCI_G(errcode) = PHP_OCI_CALL(OCIEnvNlsCreate, (&(connection->env),
PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL, connection->charset,
connection->charset));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIEnvNlsCreate,
(&(connection->env), PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL,
connection->charset, connection->charset));
#elif HAVE_OCI_ENV_CREATE
#define PHP_OCI_INIT_FUNC_NAME "OCIEnvCreate"
/* allocate env handle without NLS support */
- OCI_G(errcode) = PHP_OCI_CALL(OCIEnvCreate, (&(connection->env),
PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIEnvCreate, (&(connection->env),
PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL));
#else
#define PHP_OCI_INIT_FUNC_NAME "OCIEnvInit"
/* the simpliest way */
- OCI_G(errcode) = PHP_OCI_CALL(OCIEnvInit, (&(connection->env),
OCI_DEFAULT, 0, NULL));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIEnvInit, (&(connection->env),
OCI_DEFAULT, 0, NULL));
#endif
if (OCI_G(errcode) != OCI_SUCCESS) {
@@ -1205,7 +1205,7 @@
}
/* allocate our server handle {{{ */
- OCI_G(errcode) = PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid
**)&(connection->server), OCI_HTYPE_SERVER, 0, NULL));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env,
(dvoid **)&(connection->server), OCI_HTYPE_SERVER, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1214,7 +1214,7 @@
} /* }}} */
/* attach to the server {{{ */
- OCI_G(errcode) = PHP_OCI_CALL(OCIServerAttach, (connection->server,
OCI_G(err), (text*)dbname, dbname_len, (ub4) OCI_DEFAULT));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerAttach,
(connection->server, OCI_G(err), (text*)dbname, dbname_len, (ub4) OCI_DEFAULT));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1224,7 +1224,7 @@
connection->is_attached = 1;
/* allocate our session handle {{{ */
- OCI_G(errcode) = PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid
**)&(connection->session), OCI_HTYPE_SESSION, 0, NULL));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env,
(dvoid **)&(connection->session), OCI_HTYPE_SESSION, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1233,7 +1233,7 @@
} /* }}} */
/* allocate our private error-handle {{{ */
- OCI_G(errcode) = PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid
**)&(connection->err), OCI_HTYPE_ERROR, 0, NULL));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env,
(dvoid **)&(connection->err), OCI_HTYPE_ERROR, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1242,7 +1242,7 @@
} /* }}} */
/* allocate our service-context {{{ */
- OCI_G(errcode) = PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid
**)&(connection->svc), OCI_HTYPE_SVCCTX, 0, NULL));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env,
(dvoid **)&(connection->svc), OCI_HTYPE_SVCCTX, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1252,7 +1252,7 @@
/* set the username {{{ */
if (username) {
- OCI_G(errcode) = PHP_OCI_CALL(OCIAttrSet, ((dvoid *)
connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) username, (ub4)
username_len, (ub4) OCI_ATTR_USERNAME, OCI_G(err)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *)
connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) username, (ub4)
username_len, (ub4) OCI_ATTR_USERNAME, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1263,7 +1263,7 @@
/* set the password {{{ */
if (password) {
- OCI_G(errcode) = PHP_OCI_CALL(OCIAttrSet, ((dvoid *)
connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) password, (ub4)
password_len, (ub4) OCI_ATTR_PASSWORD, OCI_G(err)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *)
connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) password, (ub4)
password_len, (ub4) OCI_ATTR_PASSWORD, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1273,7 +1273,7 @@
}/* }}} */
/* set the server handle in the service handle {{{ */
- OCI_G(errcode) = PHP_OCI_CALL(OCIAttrSet, (connection->svc,
OCI_HTYPE_SVCCTX, connection->server, 0, OCI_ATTR_SERVER, OCI_G(err)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, (connection->svc,
OCI_HTYPE_SVCCTX, connection->server, 0, OCI_ATTR_SERVER, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1282,7 +1282,7 @@
} /* }}} */
/* set the authentication handle in the service handle {{{ */
- OCI_G(errcode) = PHP_OCI_CALL(OCIAttrSet, (connection->svc,
OCI_HTYPE_SVCCTX, connection->session, 0, OCI_ATTR_SESSION, OCI_G(err)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, (connection->svc,
OCI_HTYPE_SVCCTX, connection->session, 0, OCI_ATTR_SESSION, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1292,7 +1292,7 @@
if (new_password) {
/* try to change password if new one was provided {{{ */
- OCI_G(errcode) = PHP_OCI_CALL(OCIPasswordChange,
(connection->svc, OCI_G(err), (text *)username, username_len, (text *)password,
password_len, (text *)new_password, new_password_len, OCI_AUTH));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPasswordChange,
(connection->svc, OCI_G(err), (text *)username, username_len, (text *)password,
password_len, (text *)new_password, new_password_len, OCI_AUTH));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1300,7 +1300,7 @@
return NULL;
}
- OCI_G(errcode) = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)connection->svc, OCI_HTYPE_SVCCTX, (dvoid *)&(connection->session), (ub4 *)0,
OCI_ATTR_SESSION, OCI_G(err)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid
*)connection->svc, OCI_HTYPE_SVCCTX, (dvoid *)&(connection->session), (ub4 *)0,
OCI_ATTR_SESSION, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1313,19 +1313,19 @@
case OCI_DEFAULT:
#if HAVE_OCI_STMT_PREPARE2
/* statement caching is suported only in Oracle
9+ */
- OCI_G(errcode) = PHP_OCI_CALL(OCISessionBegin,
(connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_RDBMS, (ub4)
OCI_STMT_CACHE));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode),
OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4)
OCI_CRED_RDBMS, (ub4) OCI_STMT_CACHE));
#else
/* others cannot use stmt caching, so we call
OCISessionBegin() with OCI_DEFAULT */
- OCI_G(errcode) = PHP_OCI_CALL(OCISessionBegin,
(connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_RDBMS, (ub4)
OCI_DEFAULT));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode),
OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4)
OCI_CRED_RDBMS, (ub4) OCI_DEFAULT));
#endif
break;
case OCI_SYSDBA:
case OCI_SYSOPER:
default:
if (username_len == 1 && username[0] == '/' &&
password_len == 0) {
- OCI_G(errcode) =
PHP_OCI_CALL(OCISessionBegin, (connection->svc, OCI_G(err),
connection->session, (ub4) OCI_CRED_EXT, (ub4) session_mode));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode),
OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4)
OCI_CRED_EXT, (ub4) session_mode));
} else {
- OCI_G(errcode) =
PHP_OCI_CALL(OCISessionBegin, (connection->svc, OCI_G(err),
connection->session, (ub4) OCI_CRED_RDBMS, (ub4) session_mode));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode),
OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4)
OCI_CRED_RDBMS, (ub4) session_mode));
}
break;
}
@@ -1346,7 +1346,7 @@
if (connection->is_persistent) {
ub4 statement_cache_size = (OCI_G(statement_cache_size) > 0) ?
OCI_G(statement_cache_size) : 0;
- OCI_G(errcode) = PHP_OCI_CALL(OCIAttrSet, ((dvoid *)
connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &statement_cache_size, 0,
(ub4) OCI_ATTR_STMTCACHESIZE, OCI_G(err)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *)
connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &statement_cache_size, 0,
(ub4) OCI_ATTR_STMTCACHESIZE, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1387,11 +1387,11 @@
{
/* OCIPing() crashes Oracle servers older than 10.2 */
#if 0
- OCI_G(errcode) = PHP_OCI_CALL(OCIPing, (connection->svc, OCI_G(err),
OCI_DEFAULT));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPing, (connection->svc,
OCI_G(err), OCI_DEFAULT));
#else
char version[256];
/* use good old OCIServerVersion() by default */
- OCI_G(errcode) = PHP_OCI_CALL(OCIServerVersion, (connection->server,
OCI_G(err), (text*)version, sizeof(version), OCI_HTYPE_SERVER));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerVersion,
(connection->server, OCI_G(err), (text*)version, sizeof(version),
OCI_HTYPE_SERVER));
#endif
if (OCI_G(errcode) == OCI_SUCCESS) {
@@ -1411,7 +1411,7 @@
ub4 ss = 0;
/* get OCI_ATTR_SERVER_STATUS */
- OCI_G(errcode) = PHP_OCI_CALL(OCIAttrGet, ((dvoid *)connection->server,
OCI_HTYPE_SERVER, (dvoid *)&ss, (ub4 *)0, OCI_ATTR_SERVER_STATUS, OCI_G(err)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid
*)connection->server, OCI_HTYPE_SERVER, (dvoid *)&ss, (ub4 *)0,
OCI_ATTR_SERVER_STATUS, OCI_G(err)));
if (OCI_G(errcode) == OCI_SUCCESS && ss == OCI_SERVER_NORMAL) {
return 1;
@@ -1427,7 +1427,7 @@
Rollback connection */
int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC)
{
- connection->errcode = PHP_OCI_CALL(OCITransRollback, (connection->svc,
connection->err, (ub4) 0));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCITransRollback,
(connection->svc, connection->err, (ub4) 0));
connection->needs_commit = 0;
if (connection->errcode != OCI_SUCCESS) {
@@ -1442,7 +1442,7 @@
Commit connection */
int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC)
{
- connection->errcode = PHP_OCI_CALL(OCITransCommit, (connection->svc,
connection->err, (ub4) 0));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCITransCommit,
(connection->svc, connection->err, (ub4) 0));
connection->needs_commit = 0;
if (connection->errcode != OCI_SUCCESS) {
@@ -1458,6 +1458,7 @@
static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC)
{
int result = 0;
+ zend_bool in_call_save = OCI_G(in_call);
if (connection->descriptors) {
zend_hash_destroy(connection->descriptors);
@@ -1514,6 +1515,7 @@
efree(connection);
}
connection = NULL;
+ OCI_G(in_call) = in_call_save;
return result;
} /* }}} */
@@ -1521,7 +1523,7 @@
Change password for the user with the username given */
int php_oci_password_change(php_oci_connection *connection, char *user, int
user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len
TSRMLS_DC)
{
- connection->errcode = PHP_OCI_CALL(OCIPasswordChange, (connection->svc,
connection->err, (text *)user, user_len, (text *)pass_old, pass_old_len, (text
*)pass_new, pass_new_len, OCI_DEFAULT));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIPasswordChange,
(connection->svc, connection->err, (text *)user, user_len, (text *)pass_old,
pass_old_len, (text *)pass_new, pass_new_len, OCI_DEFAULT));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -1537,7 +1539,7 @@
{
char version_buff[256];
- connection->errcode = PHP_OCI_CALL(OCIServerVersion, (connection->svc,
connection->err, (text*)version_buff, sizeof(version_buff), OCI_HTYPE_SVCCTX));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIServerVersion,
(connection->svc, connection->err, (text*)version_buff, sizeof(version_buff),
OCI_HTYPE_SVCCTX));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -1746,7 +1748,7 @@
connection = (php_oci_connection *)le->ptr;
if (connection->used_this_request) {
- if ((PG(connection_status) & PHP_CONNECTION_TIMEOUT)) {
+ if ((PG(connection_status) & PHP_CONNECTION_TIMEOUT) ||
OCI_G(in_call)) {
return 1;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_collection.c?r1=1.5.2.3.2.2&r2=1.5.2.3.2.3&diff_format=u
Index: php-src/ext/oci8/oci8_collection.c
diff -u php-src/ext/oci8/oci8_collection.c:1.5.2.3.2.2
php-src/ext/oci8/oci8_collection.c:1.5.2.3.2.3
--- php-src/ext/oci8/oci8_collection.c:1.5.2.3.2.2 Tue Aug 15 13:08:34 2006
+++ php-src/ext/oci8/oci8_collection.c Mon Aug 21 16:41:13 2006
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_collection.c,v 1.5.2.3.2.2 2006/08/15 13:08:34 tony2001 Exp $ */
+/* $Id: oci8_collection.c,v 1.5.2.3.2.3 2006/08/21 16:41:13 tony2001 Exp $ */
@@ -57,7 +57,7 @@
collection->collection = NULL;
/* get type handle by name */
- connection->errcode = PHP_OCI_CALL(OCITypeByName,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCITypeByName,
(
connection->env,
connection->err,
@@ -79,14 +79,14 @@
}
/* allocate describe handle */
- connection->errcode = PHP_OCI_CALL(OCIHandleAlloc, (connection->env,
(dvoid **) &dschp1, (ub4) OCI_HTYPE_DESCRIBE, (size_t) 0, (dvoid **) 0));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIHandleAlloc,
(connection->env, (dvoid **) &dschp1, (ub4) OCI_HTYPE_DESCRIBE, (size_t) 0,
(dvoid **) 0));
if (connection->errcode) {
goto CLEANUP;
}
/* describe TDO */
- connection->errcode = PHP_OCI_CALL(OCIDescribeAny,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIDescribeAny,
(
connection->svc,
connection->err,
@@ -104,14 +104,14 @@
}
/* get first parameter handle */
- connection->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid *) dschp1, (ub4)
OCI_HTYPE_DESCRIBE, (dvoid *)&parmp1, (ub4 *)0, (ub4)OCI_ATTR_PARAM,
connection->err));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet, ((dvoid *) dschp1,
(ub4) OCI_HTYPE_DESCRIBE, (dvoid *)&parmp1, (ub4 *)0, (ub4)OCI_ATTR_PARAM,
connection->err));
if (connection->errcode) {
goto CLEANUP;
}
/* get the collection type code of the attribute */
- connection->errcode = PHP_OCI_CALL(OCIAttrGet,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet,
(
(dvoid*) parmp1,
(ub4) OCI_DTYPE_PARAM,
@@ -130,7 +130,7 @@
case OCI_TYPECODE_TABLE:
case OCI_TYPECODE_VARRAY:
/* get collection element handle */
- connection->errcode = PHP_OCI_CALL(OCIAttrGet,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet,
(
(dvoid*) parmp1,
(ub4) OCI_DTYPE_PARAM,
@@ -146,7 +146,7 @@
}
/* get REF of the TDO for the type */
- connection->errcode = PHP_OCI_CALL(OCIAttrGet,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet,
(
(dvoid*) parmp2,
(ub4) OCI_DTYPE_PARAM,
@@ -162,7 +162,7 @@
}
/* get the TDO (only header) */
- connection->errcode = PHP_OCI_CALL(OCITypeByRef,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCITypeByRef,
(
connection->env,
connection->err,
@@ -178,7 +178,7 @@
}
/* get typecode */
- connection->errcode = PHP_OCI_CALL(OCIAttrGet,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet,
(
(dvoid*) parmp2,
(ub4) OCI_DTYPE_PARAM,
@@ -200,7 +200,7 @@
}
/* Create object to hold return table */
- connection->errcode = PHP_OCI_CALL(OCIObjectNew,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIObjectNew,
(
connection->env,
connection->err,
@@ -234,7 +234,7 @@
{
php_oci_connection *connection = collection->connection;
- connection->errcode = PHP_OCI_CALL(OCICollSize, (connection->env,
connection->err, collection->collection, (sb4 *)size));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollSize, (connection->env,
connection->err, collection->collection, (sb4 *)size));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -249,7 +249,7 @@
{
php_oci_connection *connection = collection->connection;
- *max = PHP_OCI_CALL(OCICollMax, (connection->env,
collection->collection));
+ PHP_OCI_CALL_RETURN(*max, OCICollMax, (connection->env,
collection->collection));
/* error handling is not necessary here? */
return 0;
@@ -261,7 +261,7 @@
{
php_oci_connection *connection = collection->connection;
- connection->errcode = PHP_OCI_CALL(OCICollTrim, (connection->env,
connection->err, trim_size, collection->collection));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollTrim, (connection->env,
connection->err, trim_size, collection->collection));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -278,7 +278,7 @@
php_oci_connection *connection = collection->connection;
/* append NULL element */
- connection->errcode = PHP_OCI_CALL(OCICollAppend, (connection->env,
connection->err, (dvoid *)0, &null_index, collection->collection));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollAppend,
(connection->env, connection->err, (dvoid *)0, &null_index,
collection->collection));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -296,7 +296,7 @@
php_oci_connection *connection = collection->connection;
/* format and language are NULLs, so format is "DD-MON-YY" and language
is the default language of the session */
- connection->errcode = PHP_OCI_CALL(OCIDateFromText, (connection->err,
date, date_len, NULL, 0, NULL, 0, &oci_date));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText,
(connection->err, date, date_len, NULL, 0, NULL, 0, &oci_date));
if (connection->errcode != OCI_SUCCESS) {
/* failed to convert string to date */
@@ -304,7 +304,7 @@
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCICollAppend,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollAppend,
(
connection->env,
connection->err,
@@ -333,14 +333,14 @@
element_double = zend_strtod(number, NULL);
- connection->errcode = PHP_OCI_CALL(OCINumberFromReal, (connection->err,
&element_double, sizeof(double), &oci_number));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCINumberFromReal,
(connection->err, &element_double, sizeof(double), &oci_number));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCICollAppend,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollAppend,
(
connection->env,
connection->err,
@@ -366,14 +366,14 @@
OCIString *ocistr = (OCIString *)0;
php_oci_connection *connection = collection->connection;
- connection->errcode = PHP_OCI_CALL(OCIStringAssignText,
(connection->env, connection->err, element, element_len, &ocistr));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText,
(connection->env, connection->err, element, element_len, &ocistr));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCICollAppend,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollAppend,
(
connection->env,
connection->err,
@@ -445,7 +445,7 @@
MAKE_STD_ZVAL(*result_element);
ZVAL_NULL(*result_element);
- connection->errcode = PHP_OCI_CALL(OCICollGetElem,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollGetElem,
(
connection->env,
connection->err,
@@ -476,7 +476,7 @@
switch (collection->element_typecode) {
case OCI_TYPECODE_DATE:
- connection->errcode = PHP_OCI_CALL(OCIDateToText,
(connection->err, element, 0, 0, 0, 0, &buff_len, buff));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText,
(connection->err, element, 0, 0, 0, 0, &buff_len, buff));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
@@ -495,7 +495,7 @@
OCIString *oci_string = *(OCIString **)element;
text *str;
- str = (text *)PHP_OCI_CALL(OCIStringPtr,
(connection->env, oci_string));
+ PHP_OCI_CALL_RETURN(str, OCIStringPtr,
(connection->env, oci_string));
if (str) {
ZVAL_STRING(*result_element, str, 1);
@@ -518,7 +518,7 @@
{
double double_number;
- connection->errcode = PHP_OCI_CALL(OCINumberToReal,
(connection->err, (CONST OCINumber *) element, (uword) sizeof(double), (dvoid
*) &double_number));
+ PHP_OCI_CALL_RETURN(connection->errcode,
OCINumberToReal, (connection->err, (CONST OCINumber *) element, (uword)
sizeof(double), (dvoid *) &double_number));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
@@ -549,7 +549,7 @@
php_oci_connection *connection = collection->connection;
/* set NULL element */
- connection->errcode = PHP_OCI_CALL(OCICollAssignElem, (connection->env,
connection->err, (ub4) index, (dvoid *)"", &null_index,
collection->collection));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssignElem,
(connection->env, connection->err, (ub4) index, (dvoid *)"", &null_index,
collection->collection));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -567,7 +567,7 @@
php_oci_connection *connection = collection->connection;
/* format and language are NULLs, so format is "DD-MON-YY" and language
is the default language of the session */
- connection->errcode = PHP_OCI_CALL(OCIDateFromText, (connection->err,
date, date_len, NULL, 0, NULL, 0, &oci_date));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText,
(connection->err, date, date_len, NULL, 0, NULL, 0, &oci_date));
if (connection->errcode != OCI_SUCCESS) {
/* failed to convert string to date */
@@ -575,7 +575,7 @@
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCICollAssignElem,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssignElem,
(
connection->env,
connection->err,
@@ -605,14 +605,14 @@
element_double = zend_strtod(number, NULL);
- connection->errcode = PHP_OCI_CALL(OCINumberFromReal, (connection->err,
&element_double, sizeof(double), &oci_number));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCINumberFromReal,
(connection->err, &element_double, sizeof(double), &oci_number));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCICollAssignElem,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssignElem,
(
connection->env,
connection->err,
@@ -639,14 +639,14 @@
OCIString *ocistr = (OCIString *)0;
php_oci_connection *connection = collection->connection;
- connection->errcode = PHP_OCI_CALL(OCIStringAssignText,
(connection->env, connection->err, element, element_len, &ocistr));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText,
(connection->env, connection->err, element, element_len, &ocistr));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCICollAssignElem,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssignElem,
(
connection->env,
connection->err,
@@ -711,7 +711,7 @@
{
php_oci_connection *connection = collection_dest->connection;
- connection->errcode = PHP_OCI_CALL(OCICollAssign, (connection->env,
connection->err, collection_from->collection, collection_dest->collection));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssign,
(connection->env, connection->err, collection_from->collection,
collection_dest->collection));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -727,7 +727,7 @@
php_oci_connection *connection = collection->connection;
if (collection->collection) {
- connection->errcode = PHP_OCI_CALL(OCIObjectFree,
(connection->env, connection->err, (dvoid *)collection->collection,
(ub2)OCI_OBJECTFREE_FORCE));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIObjectFree,
(connection->env, connection->err, (dvoid *)collection->collection,
(ub2)OCI_OBJECTFREE_FORCE));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode
TSRMLS_CC);
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_lob.c?r1=1.7.2.6.2.4&r2=1.7.2.6.2.5&diff_format=u
Index: php-src/ext/oci8/oci8_lob.c
diff -u php-src/ext/oci8/oci8_lob.c:1.7.2.6.2.4
php-src/ext/oci8/oci8_lob.c:1.7.2.6.2.5
--- php-src/ext/oci8/oci8_lob.c:1.7.2.6.2.4 Tue Aug 15 13:08:34 2006
+++ php-src/ext/oci8/oci8_lob.c Mon Aug 21 16:41:13 2006
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_lob.c,v 1.7.2.6.2.4 2006/08/15 13:08:34 tony2001 Exp $ */
+/* $Id: oci8_lob.c,v 1.7.2.6.2.5 2006/08/21 16:41:13 tony2001 Exp $ */
@@ -70,7 +70,7 @@
descriptor = ecalloc(1, sizeof(php_oci_descriptor));
descriptor->type = type;
- OCI_G(errcode) = PHP_OCI_CALL(OCIDescriptorAlloc, (connection->env,
(dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIDescriptorAlloc,
(connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t)
0, (dvoid **) 0));
if (OCI_G(errcode) != OCI_SUCCESS) {
connection->errcode = php_oci_error(OCI_G(err), OCI_G(errcode)
TSRMLS_CC);
@@ -115,7 +115,7 @@
return 0;
} else {
if (descriptor->type == OCI_DTYPE_FILE) {
- connection->errcode = PHP_OCI_CALL(OCILobFileOpen,
(connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY));
+ PHP_OCI_CALL_RETURN(connection->errcode,
OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor,
OCI_FILE_READONLY));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection,
connection->errcode);
@@ -123,7 +123,7 @@
}
}
- connection->errcode = PHP_OCI_CALL(OCILobGetLength,
(connection->svc, connection->err, descriptor->descriptor, (ub4 *)length));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobGetLength,
(connection->svc, connection->err, descriptor->descriptor, (ub4 *)length));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode
TSRMLS_CC);
@@ -134,7 +134,7 @@
descriptor->lob_size = *length;
if (descriptor->type == OCI_DTYPE_FILE) {
- connection->errcode = PHP_OCI_CALL(OCILobFileClose,
(connection->svc, connection->err, descriptor->descriptor));
+ PHP_OCI_CALL_RETURN(connection->errcode,
OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
@@ -192,7 +192,7 @@
ub4 chunk_size;
if (!descriptor->chunk_size) {
- connection->errcode = PHP_OCI_CALL(OCILobGetChunkSize,
(connection->svc, connection->err, descriptor->descriptor, &chunk_size));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobGetChunkSize,
(connection->svc, connection->err, descriptor->descriptor, &chunk_size));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode
TSRMLS_CC);
@@ -261,7 +261,7 @@
offset = initial_offset;
if (descriptor->type == OCI_DTYPE_FILE) {
- connection->errcode = PHP_OCI_CALL(OCILobFileOpen,
(connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileOpen,
(connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode
TSRMLS_CC);
@@ -273,7 +273,7 @@
else {
ub2 charset_id = 0;
- connection->errcode = PHP_OCI_CALL(OCILobCharSetId,
(connection->env, connection->err, descriptor->descriptor, &charset_id));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobCharSetId,
(connection->env, connection->err, descriptor->descriptor, &charset_id));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode
TSRMLS_CC);
@@ -298,7 +298,7 @@
buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size
TSRMLS_CC); /* use chunk size */
bufp = (ub1 *) ecalloc(1, buffer_size);
- connection->errcode = PHP_OCI_CALL(OCILobRead2,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobRead2,
(
connection->svc,
connection->err,
@@ -331,7 +331,7 @@
buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size
TSRMLS_CC); /* use chunk size */
bufp = (ub1 *) ecalloc(1, buffer_size);
- connection->errcode = PHP_OCI_CALL(OCILobRead,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobRead,
(
connection->svc,
connection->err,
@@ -366,7 +366,7 @@
descriptor->lob_current_position = (int)offset;
if (descriptor->type == OCI_DTYPE_FILE) {
- connection->errcode = PHP_OCI_CALL(OCILobFileClose,
(connection->svc, connection->err, descriptor->descriptor));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileClose,
(connection->svc, connection->err, descriptor->descriptor));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode
TSRMLS_CC);
@@ -408,7 +408,7 @@
offset = descriptor->lob_current_position;
}
- connection->errcode = PHP_OCI_CALL(OCILobWrite,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobWrite,
(
connection->svc,
connection->err,
@@ -463,9 +463,9 @@
}
if (on_off) {
- connection->errcode = PHP_OCI_CALL(OCILobEnableBuffering,
(connection->svc, connection->err, descriptor->descriptor));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobEnableBuffering,
(connection->svc, connection->err, descriptor->descriptor));
} else {
- connection->errcode = PHP_OCI_CALL(OCILobDisableBuffering,
(connection->svc, connection->err, descriptor->descriptor));
+ PHP_OCI_CALL_RETURN(connection->errcode,
OCILobDisableBuffering, (connection->svc, connection->err,
descriptor->descriptor));
}
if (connection->errcode != OCI_SUCCESS) {
@@ -514,7 +514,7 @@
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCILobCopy,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobCopy,
(
connection->svc,
connection->err,
@@ -542,7 +542,7 @@
php_oci_connection *connection = descriptor->connection;
int is_temporary;
- connection->errcode = PHP_OCI_CALL(OCILobClose, (connection->svc,
connection->err, descriptor->descriptor));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobClose, (connection->svc,
connection->err, descriptor->descriptor));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -550,7 +550,7 @@
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCILobIsTemporary,
(connection->env,connection->err, descriptor->descriptor, &is_temporary));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobIsTemporary,
(connection->env,connection->err, descriptor->descriptor, &is_temporary));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -560,7 +560,7 @@
if (is_temporary) {
- connection->errcode = PHP_OCI_CALL(OCILobFreeTemporary,
(connection->svc, connection->err, descriptor->descriptor));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobFreeTemporary,
(connection->svc, connection->err, descriptor->descriptor));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode
TSRMLS_CC);
@@ -600,7 +600,7 @@
return 0;
}
- connection->errcode = PHP_OCI_CALL(OCILobFlushBuffer, (connection->svc,
connection->err, lob, flush_flag));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobFlushBuffer,
(connection->svc, connection->err, lob, flush_flag));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -658,7 +658,7 @@
}
while ((loblen = read(fp, &buf, sizeof(buf))) > 0) {
- connection->errcode = PHP_OCI_CALL(
+ PHP_OCI_CALL_RETURN(connection->errcode,
OCILobWrite,
(
connection->svc,
@@ -710,7 +710,7 @@
return 0;
}
- connection->errcode = PHP_OCI_CALL(OCILobAppend, (connection->svc,
connection->err, lob_dest, lob_from));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobAppend,
(connection->svc, connection->err, lob_dest, lob_from));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -746,7 +746,7 @@
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCILobTrim, (connection->svc,
connection->err, lob, new_lob_length));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobTrim, (connection->svc,
connection->err, lob, new_lob_length));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -780,7 +780,7 @@
length = lob_length;
}
- connection->errcode = PHP_OCI_CALL(OCILobErase, (connection->svc,
connection->err, lob, (ub4 *)&length, offset+1));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobErase, (connection->svc,
connection->err, lob, (ub4 *)&length, offset+1));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -800,7 +800,7 @@
OCILobLocator *first_lob = descriptor_first->descriptor;
OCILobLocator *second_lob = descriptor_second->descriptor;
- connection->errcode = PHP_OCI_CALL(OCILobIsEqual, (connection->env,
first_lob, second_lob, result));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobIsEqual,
(connection->env, first_lob, second_lob, result));
if (connection->errcode) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -834,7 +834,7 @@
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCILobCreateTemporary,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobCreateTemporary,
(
connection->svc,
connection->err,
@@ -853,7 +853,7 @@
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCILobOpen, (connection->svc,
connection->err, lob, OCI_LOB_READWRITE));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobOpen, (connection->svc,
connection->err, lob, OCI_LOB_READWRITE));
if (connection->errcode) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.7.2.14.2.6&r2=1.7.2.14.2.7&diff_format=u
Index: php-src/ext/oci8/oci8_statement.c
diff -u php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.6
php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.7
--- php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.6 Tue Aug 15 13:08:34 2006
+++ php-src/ext/oci8/oci8_statement.c Mon Aug 21 16:41:13 2006
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_statement.c,v 1.7.2.14.2.6 2006/08/15 13:08:34 tony2001 Exp $ */
+/* $Id: oci8_statement.c,v 1.7.2.14.2.7 2006/08/21 16:41:13 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
@@ -62,7 +62,7 @@
if (query_len > 0) {
#if HAVE_OCI_STMT_PREPARE2
- connection->errcode = PHP_OCI_CALL(OCIStmtPrepare2,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIStmtPrepare2,
(
connection->svc,
&(statement->stmt),
@@ -76,7 +76,7 @@
)
);
#else
- connection->errcode = PHP_OCI_CALL(OCIStmtPrepare,
(statement->stmt, connection->err, (text *)query, query_len, OCI_NTV_SYNTAX,
OCI_DEFAULT));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIStmtPrepare,
(statement->stmt, connection->err, (text *)query, query_len, OCI_NTV_SYNTAX,
OCI_DEFAULT));
#endif
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode
TSRMLS_CC);
@@ -129,7 +129,7 @@
return 1;
}
- statement->errcode = PHP_OCI_CALL (OCIAttrSet, (statement->stmt,
OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_MEMORY, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrSet, (statement->stmt,
OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_MEMORY, statement->err));
if (statement->errcode != OCI_SUCCESS) {
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
@@ -138,7 +138,7 @@
}
prefetch = size;
- statement->errcode = PHP_OCI_CALL (OCIAttrSet, (statement->stmt,
OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrSet, (statement->stmt,
OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, statement->err));
if (statement->errcode != OCI_SUCCESS) {
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
@@ -157,7 +157,7 @@
int i;
php_oci_out_column *column;
- statement->errcode = PHP_OCI_CALL(OCIStmtFetch, (statement->stmt,
statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtFetch, (statement->stmt,
statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT));
if ( statement->errcode == OCI_NO_DATA || nrows == 0 ) {
if (statement->last_query == NULL) {
@@ -216,7 +216,7 @@
}
}
- statement->errcode = PHP_OCI_CALL( OCIStmtFetch,
(statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtFetch,
(statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT));
for (i = 0; i < statement->ncolumns; i++) {
column = php_oci_statement_get_column(statement, i + 1,
NULL, 0 TSRMLS_CC);
@@ -318,7 +318,7 @@
if (!statement->stmttype) {
/* get statement type */
- statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement->stmttype, (ub4 *)0,
OCI_ATTR_STMT_TYPE, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid
*)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement->stmttype, (ub4 *)0,
OCI_ATTR_STMT_TYPE, statement->err));
if (statement->errcode != OCI_SUCCESS) {
php_oci_error(statement->err, statement->errcode
TSRMLS_CC);
@@ -342,7 +342,7 @@
}
/* execute statement */
- statement->errcode = PHP_OCI_CALL(OCIStmtExecute,
(statement->connection->svc, statement->stmt, statement->err, iters, 0, NULL,
NULL, mode));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtExecute,
(statement->connection->svc, statement->stmt, statement->err, iters, 0,
NULL, NULL, mode));
if (statement->errcode != OCI_SUCCESS) {
php_oci_error(statement->err, statement->errcode
TSRMLS_CC);
@@ -371,7 +371,7 @@
counter = 1;
/* get number of columns */
- statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)statement->stmt, OCI_HTYPE_STMT, (dvoid *)&colcount, (ub4 *)0,
OCI_ATTR_PARAM_COUNT, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid
*)statement->stmt, OCI_HTYPE_STMT, (dvoid *)&colcount, (ub4 *)0,
OCI_ATTR_PARAM_COUNT, statement->err));
if (statement->errcode != OCI_SUCCESS) {
php_oci_error(statement->err, statement->errcode
TSRMLS_CC);
@@ -393,7 +393,7 @@
outcol->statement = statement;
/* get column */
- statement->errcode = PHP_OCI_CALL(OCIParamGet, ((dvoid
*)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)¶m, counter));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIParamGet,
((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)¶m,
counter));
if (statement->errcode != OCI_SUCCESS) {
php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
@@ -402,7 +402,7 @@
}
/* get column datatype */
- statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_type, (ub4 *)0,
OCI_ATTR_DATA_TYPE, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet,
((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_type, (ub4 *)0,
OCI_ATTR_DATA_TYPE, statement->err));
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
@@ -412,7 +412,7 @@
}
/* get character set form */
- statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_form, (ub4 *)0,
OCI_ATTR_CHARSET_FORM, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet,
((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_form, (ub4 *)0,
OCI_ATTR_CHARSET_FORM, statement->err));
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
@@ -422,7 +422,7 @@
}
/* get character set id */
- statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_id, (ub4 *)0,
OCI_ATTR_CHARSET_ID, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet,
((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_id, (ub4 *)0,
OCI_ATTR_CHARSET_ID, statement->err));
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
@@ -432,7 +432,7 @@
}
/* get size of the column */
- statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_size, (dvoid *)0,
OCI_ATTR_DATA_SIZE, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet,
((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_size, (dvoid *)0,
OCI_ATTR_DATA_SIZE, statement->err));
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
@@ -445,7 +445,7 @@
outcol->retlen = outcol->data_size;
/* get scale of the column */
- statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->scale, (dvoid *)0, OCI_ATTR_SCALE,
statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet,
((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->scale, (dvoid *)0,
OCI_ATTR_SCALE, statement->err));
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
@@ -455,7 +455,7 @@
}
/* get precision of the column */
- statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->precision, (dvoid *)0,
OCI_ATTR_PRECISION, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet,
((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->precision, (dvoid *)0,
OCI_ATTR_PRECISION, statement->err));
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
@@ -465,7 +465,7 @@
}
/* get name of the column */
- statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)param, OCI_DTYPE_PARAM, (dvoid **)&colname, (ub4 *)&outcol->name_len,
(ub4)OCI_ATTR_NAME, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet,
((dvoid *)param, OCI_DTYPE_PARAM, (dvoid **)&colname, (ub4 *)&outcol->name_len,
(ub4)OCI_ATTR_NAME, statement->err));
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
@@ -568,7 +568,7 @@
}
if (dynamic == OCI_DYNAMIC_FETCH) {
- statement->errcode = PHP_OCI_CALL(
+ PHP_OCI_CALL_RETURN(statement->errcode,
OCIDefineByPos,
(
statement->stmt,
/* IN/OUT handle to the requested SQL query */
@@ -586,7 +586,7 @@
);
} else {
- statement->errcode = PHP_OCI_CALL(
+ PHP_OCI_CALL_RETURN(statement->errcode,
OCIDefineByPos,
(
statement->stmt,
/* IN/OUT handle to the requested SQL query */
@@ -742,7 +742,7 @@
memset((void*)buff,0,sizeof(buff));
if ((i < bind->array.old_length) &&
(zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
- connection->errcode =
PHP_OCI_CALL(OCIDateToText, (connection->err, &(((OCIDate
*)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
+
PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err,
&(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
zval_dtor(*entry);
if (connection->errcode !=
OCI_SUCCESS) {
@@ -753,7 +753,7 @@
}
zend_hash_move_forward(hash);
} else {
- connection->errcode =
PHP_OCI_CALL(OCIDateToText, (connection->err, &(((OCIDate
*)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
+
PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err,
&(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
if (connection->errcode !=
OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
add_next_index_null(bind->zval);
@@ -908,7 +908,7 @@
bindp->zval = var;
zval_add_ref(&var);
- statement->errcode = PHP_OCI_CALL(
+ PHP_OCI_CALL_RETURN(statement->errcode,
OCIBindByName,
(
statement->stmt, /* statement handle */
@@ -935,7 +935,7 @@
}
if (mode == OCI_DATA_AT_EXEC) {
- statement->errcode = PHP_OCI_CALL(OCIBindDynamic,
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIBindDynamic,
(
bindp->bind,
statement->err,
@@ -956,7 +956,7 @@
#ifdef PHP_OCI8_HAVE_COLLECTIONS
if (type == SQLT_NTY) {
/* Bind object */
- statement->errcode = PHP_OCI_CALL(OCIBindObject,
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIBindObject,
(
bindp->bind,
statement->err,
@@ -1122,7 +1122,7 @@
*type = 0;
- statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement_type, (ub4 *)0,
OCI_ATTR_STMT_TYPE, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid
*)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement_type, (ub4 *)0,
OCI_ATTR_STMT_TYPE, statement->err));
if (statement->errcode != OCI_SUCCESS) {
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
@@ -1143,7 +1143,7 @@
*numrows = 0;
- statement->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)statement->stmt, OCI_HTYPE_STMT, (ub4 *)&statement_numrows, (ub4 *)0,
OCI_ATTR_ROW_COUNT, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid
*)statement->stmt, OCI_HTYPE_STMT, (ub4 *)&statement_numrows, (ub4 *)0,
OCI_ATTR_ROW_COUNT, statement->err));
if (statement->errcode != OCI_SUCCESS) {
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
@@ -1221,7 +1221,7 @@
bindp->array.type = type;
zval_add_ref(&var);
- statement->errcode = PHP_OCI_CALL(
+ PHP_OCI_CALL_RETURN(statement->errcode,
OCIBindByName,
(
statement->stmt,
@@ -1413,7 +1413,7 @@
if ((i < bind->array.current_length) &&
(zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
convert_to_string_ex(entry);
- connection->errcode = PHP_OCI_CALL(OCIDateFromText,
(connection->err, Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, 0, NULL, 0,
&oci_date));
+ PHP_OCI_CALL_RETURN(connection->errcode,
OCIDateFromText, (connection->err, Z_STRVAL_PP(entry), Z_STRLEN_PP(entry),
NULL, 0, NULL, 0, &oci_date));
if (connection->errcode != OCI_SUCCESS) {
/* failed to convert string to date */
@@ -1427,7 +1427,7 @@
((OCIDate *)bind->array.elements)[i] = oci_date;
zend_hash_move_forward(hash);
} else {
- connection->errcode = PHP_OCI_CALL(OCIDateFromText,
(connection->err, "01-JAN-00", sizeof("01-JAN-00")-1, NULL, 0, NULL, 0,
&oci_date));
+ PHP_OCI_CALL_RETURN(connection->errcode,
OCIDateFromText, (connection->err, "01-JAN-00", sizeof("01-JAN-00")-1, NULL, 0,
NULL, 0, &oci_date));
if (connection->errcode != OCI_SUCCESS) {
/* failed to convert string to date */
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/php_oci8_int.h?r1=1.11.2.6.2.5&r2=1.11.2.6.2.6&diff_format=u
Index: php-src/ext/oci8/php_oci8_int.h
diff -u php-src/ext/oci8/php_oci8_int.h:1.11.2.6.2.5
php-src/ext/oci8/php_oci8_int.h:1.11.2.6.2.6
--- php-src/ext/oci8/php_oci8_int.h:1.11.2.6.2.5 Wed Aug 9 15:24:27 2006
+++ php-src/ext/oci8/php_oci8_int.h Mon Aug 21 16:41:13 2006
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_oci8_int.h,v 1.11.2.6.2.5 2006/08/09 15:24:27 tony2001 Exp $ */
+/* $Id: php_oci8_int.h,v 1.11.2.6.2.6 2006/08/21 16:41:13 tony2001 Exp $ */
#if HAVE_OCI8
# ifndef PHP_OCI8_INT_H
@@ -221,7 +221,17 @@
/* {{{ macros */
#define PHP_OCI_CALL(func, params) \
+ OCI_G(in_call) = 1; \
func params; \
+ OCI_G(in_call) = 0; \
+ if (OCI_G(debug_mode)) { \
+ php_printf ("OCI8 DEBUG: " #func " at (%s:%d) \n", __FILE__,
__LINE__); \
+ }
+
+#define PHP_OCI_CALL_RETURN(__retval, func, params) \
+ OCI_G(in_call) = 1; \
+ __retval = func params; \
+ OCI_G(in_call) = 0; \
if (OCI_G(debug_mode)) { \
php_printf ("OCI8 DEBUG: " #func " at (%s:%d) \n", __FILE__,
__LINE__); \
}
@@ -412,6 +422,8 @@
OCIEnv *env; /* global environment handle */
+ zend_bool in_call;
+
ZEND_END_MODULE_GLOBALS(oci) /* }}} */
#ifdef ZTS
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.210&r2=1.2027.2.547.2.211&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.210 php-src/NEWS:1.2027.2.547.2.211
--- php-src/NEWS:1.2027.2.547.2.210 Sun Aug 20 18:20:07 2006
+++ php-src/NEWS Mon Aug 21 16:41:13 2006
@@ -3,6 +3,8 @@
?? Sep 2006, PHP 5.2.0
- Fixed bug #38524 (strptime() does not initialize the internal date storage
structure). (Ilia)
+- Fixed PECL bug #8112 (OCI8 persistent connections misbehave when Apache
+ process times out). (Tony)
17 Aug 2006, PHP 5.2.0RC2
- Increased default memory limit to 16 megabytes to accommodate for a more
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php