sixd Tue Mar 25 02:25:03 2008 UTC
Modified files:
/php-src/ext/oci8 config.m4 config.w32 oci8.c oci8_collection.c
oci8_interface.c oci8_lob.c oci8_statement.c
php_oci8.h php_oci8_int.h
/php-src/ext/oci8/tests drcp_cclass1.phpt drcp_connect1.phpt
/php-src/main build-defs.h.in
Log:
oci8: Sync with 5.3 - version macro updates and DRCP tweaks
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/config.m4?r1=1.72&r2=1.73&diff_format=u
Index: php-src/ext/oci8/config.m4
diff -u php-src/ext/oci8/config.m4:1.72 php-src/ext/oci8/config.m4:1.73
--- php-src/ext/oci8/config.m4:1.72 Wed Jan 16 00:33:26 2008
+++ php-src/ext/oci8/config.m4 Tue Mar 25 02:25:02 2008
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.72 2008/01/16 00:33:26 sixd Exp $
+dnl $Id: config.m4,v 1.73 2008/03/25 02:25:02 sixd Exp $
dnl
if test -z "$SED"; then
@@ -214,7 +214,6 @@
9.0)
PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD)
- AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])
dnl These functions are only available in version >= 9.2
PHP_CHECK_LIBRARY(clntsh, OCIEnvNlsCreate,
@@ -256,7 +255,6 @@
11.1|10.1)
PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD)
- AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])
AC_DEFINE(HAVE_OCI_ENV_NLS_CREATE,1,[ ])
AC_DEFINE(HAVE_OCI_ENV_CREATE,1,[ ])
AC_DEFINE(HAVE_OCI_STMT_PREPARE2,1,[ ])
@@ -376,7 +374,6 @@
esac
AC_DEFINE(HAVE_OCI_INSTANT_CLIENT,1,[ ])
- AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])
AC_DEFINE(HAVE_OCI_ENV_NLS_CREATE,1,[ ])
AC_DEFINE(HAVE_OCI_ENV_CREATE,1,[ ])
AC_DEFINE(HAVE_OCI_STMT_PREPARE2,1,[ ])
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/config.w32?r1=1.8&r2=1.9&diff_format=u
Index: php-src/ext/oci8/config.w32
diff -u php-src/ext/oci8/config.w32:1.8 php-src/ext/oci8/config.w32:1.9
--- php-src/ext/oci8/config.w32:1.8 Mon May 22 04:17:24 2006
+++ php-src/ext/oci8/config.w32 Tue Mar 25 02:25:02 2008
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.8 2006/05/22 04:17:24 tony2001 Exp $
+// $Id: config.w32,v 1.9 2008/03/25 02:25:02 sixd Exp $
// vim:ft=javascript
ARG_WITH("oci8", "OCI8 support", "no");
@@ -13,7 +13,6 @@
AC_DEFINE('HAVE_OCI8', 1);
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
- AC_DEFINE('HAVE_OCI8_ATTR_STATEMENT', 1);
AC_DEFINE('HAVE_OCI_ENV_NLS_CREATE', 1);
AC_DEFINE('HAVE_OCI_ENV_CREATE', 1);
AC_DEFINE('HAVE_OCI_STMT_PREPARE2', 1);
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.345&r2=1.346&diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.345 php-src/ext/oci8/oci8.c:1.346
--- php-src/ext/oci8/oci8.c:1.345 Wed Mar 12 01:25:13 2008
+++ php-src/ext/oci8/oci8.c Tue Mar 25 02:25:02 2008
@@ -26,7 +26,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8.c,v 1.345 2008/03/12 01:25:13 sixd Exp $ */
+/* $Id: oci8.c,v 1.346 2008/03/25 02:25:02 sixd Exp $ */
/* TODO
*
* file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty()
with OCI_ATTR_LOBEMPTY
@@ -622,6 +622,7 @@
OCI_G(debug_mode) = 0; /* start "fresh" */
OCI_G(num_links) = OCI_G(num_persistent);
OCI_G(errcode) = 0;
+ OCI_G(request_shutdown) = 0;
return SUCCESS;
}
@@ -645,6 +646,9 @@
PHP_RSHUTDOWN_FUNCTION(oci)
{
+ /* Set this to indicate request shutdown for all further processing */
+ OCI_G(request_shutdown) = 1;
+
#ifdef ZTS
zend_hash_apply_with_argument(&EG(regular_list), (apply_func_arg_t)
php_oci_list_helper, (void *)le_descriptor TSRMLS_CC);
#ifdef PHP_OCI8_HAVE_COLLECTIONS
@@ -655,7 +659,7 @@
}
#endif
- /* check persistent connections and do the necessary actions if needed
*/
+ /* check persistent connections and do the necessary actions if needed.
If persistent_helper is unable to process a pconnection because of a refcount,
the processing would happen from np-destructor which is called when refcount
goes to zero - php_oci_pconnection_list_np_dtor*/
zend_hash_apply(&EG(persistent_list), (apply_func_t)
php_oci_persistent_helper TSRMLS_CC);
#ifdef ZTS
@@ -672,8 +676,8 @@
php_info_print_table_start();
php_info_print_table_row(2, "OCI8 Support", "enabled");
- php_info_print_table_row(2, "Version", "1.3.1 Beta");
- php_info_print_table_row(2, "Revision", "$Revision: 1.345 $");
+ php_info_print_table_row(2, "Version", PHP_OCI8_VERSION);
+ php_info_print_table_row(2, "Revision", "$Revision: 1.346 $");
snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent));
php_info_print_table_row(2, "Active Persistent Connections", buf);
@@ -681,7 +685,7 @@
php_info_print_table_row(2, "Active Connections", buf);
#if !defined(PHP_WIN32) && !defined(HAVE_OCI_INSTANT_CLIENT)
- php_info_print_table_row(2, "Oracle Version", PHP_OCI8_VERSION );
+ php_info_print_table_row(2, "Oracle Version", PHP_OCI8_ORACLE_VERSION );
php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DIR );
php_info_print_table_row(2, "Libraries Used", PHP_OCI8_SHARED_LIBADD );
#else
@@ -742,10 +746,37 @@
{
php_oci_connection *connection = (php_oci_connection *)entry->ptr;
- /* If it is a bad connection, clean it up. This is the sole purpose of
this dtor. We should ideally do a hash_del also, but this scenario is currently
not possible. */
- if (connection && !connection->is_open && !connection->is_stub) {
- php_oci_connection_close(connection TSRMLS_CC);
- OCI_G(num_persistent)--;
+ /* We currently handle only session-pool using connections. TODO:
Handle non-sessionpool connections as well */
+ if (connection && connection->using_spool && !connection->is_stub) {
+ zend_rsrc_list_entry *le;
+
+ if (!connection->is_open) {
+ /* Remove the hash entry if present */
+ if ((zend_hash_find(&EG(persistent_list),
connection->hash_key, connection->hash_key_len + 1, (void **) &le)== SUCCESS)
&& (le->type == le_pconnection) && (le->ptr == connection)) {
+ zend_hash_del(&EG(persistent_list),
connection->hash_key, connection->hash_key_len + 1);
+ }
+ else {
+ php_oci_connection_close(connection TSRMLS_CC);
+ }
+ OCI_G(num_persistent)--;
+
+ if (OCI_G(debug_mode)) {
+ php_printf ("OCI8 DEBUG L1: np_dtor cleaning
up: (%p) at (%s:%d) \n", connection, __FILE__, __LINE__);
+ }
+ }
+ else if (OCI_G(request_shutdown)){
+ /* Release the connection to underlying pool - same
steps
+ * as the persistent helper. If we do this
+ * unconditionally, we would change existing behavior
+ * regarding out-of-scope pconnects. In future, we can
+ * enable this through a new flag
+ */
+ php_oci_connection_release(connection TSRMLS_CC);
+
+ if (OCI_G(debug_mode)) {
+ php_printf ("OCI8 DEBUG L1: np_dtor releasing:
(%p) at (%s:%d) \n", connection, __FILE__, __LINE__);
+ }
+ }
}
} /* }}} */
@@ -975,7 +1006,6 @@
return error_code;
} /* }}} */
-#ifdef HAVE_OCI8_ATTR_STATEMENT
/* {{{ php_oci_fetch_sqltext_offset()
Compute offset in the SQL statement */
int php_oci_fetch_sqltext_offset(php_oci_statement *statement, zstr *sqltext,
ub2 *error_offset TSRMLS_DC)
@@ -992,19 +1022,20 @@
}
if (statement->errcode != OCI_SUCCESS) {
- php_oci_error(statement->err, statement->errcode TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
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);
+ statement->errcode = php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
return 0;
} /* }}} */
-#endif
/* {{{ php_oci_do_connect()
Connect wrapper */
@@ -1243,33 +1274,32 @@
}
}
/* server died */
- connection->is_open = 0;
- connection->used_this_request = 1;
-
- /* Connection is no more part of the
persistent list */
- free(connection->hash_key);
- connection->hash_key = NULL;
- connection->hash_key_len = 0;
-
- /* We have to do a hash_del but need to
preserve the resource if there is a positive refcount. Set the data pointer in
the list entry to NULL */
- if (zend_list_find(connection->rsrc_id,
&rsrc_type)) {
- le->ptr = NULL;
- }
-
- zend_hash_del(&EG(persistent_list),
hashed_details.c, hashed_details.len+1);
- connection = NULL;
- goto open;
} else {
/* we do not ping non-persistent
connections */
smart_str_free_ex(&hashed_details, 0);
zend_list_addref(connection->rsrc_id);
return connection;
}
+ } /* is_open is true? */
+
+ /* Server died - connection not usable. The
is_open=true can also fall through to here, if ping fails */
+ if (persistent){
+ int rsrc_type;
+
+ connection->is_open = 0;
+ connection->used_this_request = 1;
+
+ /* We have to do a hash_del but need to
preserve the resource if there is a positive refcount. Set the data pointer in
the list entry to NULL */
+ if (connection ==
zend_list_find(connection->rsrc_id, &rsrc_type)) {
+ le->ptr = NULL;
+ }
+
+ zend_hash_del(&EG(persistent_list),
hashed_details.c, hashed_details.len+1);
} else {
zend_hash_del(&EG(regular_list),
hashed_details.c, hashed_details.len+1);
- connection = NULL;
- goto open;
}
+
+ connection = NULL;
} else if (found) {
/* found something, but it's not a connection, delete
it */
if (persistent) {
@@ -1279,7 +1309,6 @@
}
}
}
-open:
/* Check if we have reached max_persistent. If so, try to remove a few
* timed-out connections. As a last resort, return a non-persistent
connection.
@@ -1461,7 +1490,7 @@
connection->needs_commit = 0;
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -1476,7 +1505,7 @@
connection->needs_commit = 0;
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -1639,7 +1668,7 @@
PHP_OCI_CALL_RETURN(connection->errcode, OCIPasswordChange,
(connection->svc, connection->err, (text *)user.s, USTR_BYTES(type, user_len),
(text *)pass_old.s, USTR_BYTES(type, pass_old_len), (text *)pass_new.s,
USTR_BYTES(type, pass_new_len), OCI_DEFAULT));
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -1656,7 +1685,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -1878,6 +1907,7 @@
{
time_t timestamp;
php_oci_connection *connection;
+ int rsrc_type;
timestamp = time(NULL);
@@ -1885,7 +1915,17 @@
if (le->type == le_pconnection) {
connection = (php_oci_connection *)le->ptr;
- if (connection->used_this_request) {
+ if (connection->using_spool && (connection ==
zend_list_find(connection->rsrc_id, &rsrc_type)) && rsrc_type ==
le_pconnection){
+ /* Do nothing - keep the connection as some one is
referring to it. TODO: We should ideally have this for non-session_pool
connections as well */
+ if (OCI_G(debug_mode)) {
+ php_printf ("OCI8 DEBUG L1: persistent_helper
skipping : (%p) at (%s:%d) \n", connection, __FILE__, __LINE__);
+ }
+ }
+ else if (connection->used_this_request) {
+ if (OCI_G(debug_mode)) {
+ php_printf ("OCI8 DEBUG L1: persistent_helper
processing : (%p stub=%d) at (%s:%d) \n", connection, connection->is_stub,
__FILE__, __LINE__);
+ }
+
if ((PG(connection_status) & PHP_CONNECTION_TIMEOUT) ||
OCI_G(in_call)) {
return ZEND_HASH_APPLY_REMOVE;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_collection.c?r1=1.17&r2=1.18&diff_format=u
Index: php-src/ext/oci8/oci8_collection.c
diff -u php-src/ext/oci8/oci8_collection.c:1.17
php-src/ext/oci8/oci8_collection.c:1.18
--- php-src/ext/oci8/oci8_collection.c:1.17 Fri Feb 15 23:49:21 2008
+++ php-src/ext/oci8/oci8_collection.c Tue Mar 25 02:25:02 2008
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_collection.c,v 1.17 2008/02/15 23:49:21 sixd Exp $ */
+/* $Id: oci8_collection.c,v 1.18 2008/03/25 02:25:02 sixd Exp $ */
@@ -230,7 +230,8 @@
/* free the describe handle (Bug #44113) */
PHP_OCI_CALL(OCIHandleFree, ((dvoid *) dschp1,
OCI_HTYPE_DESCRIBE));
}
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
php_oci_collection_close(collection TSRMLS_CC);
return NULL;
} /* }}} */
@@ -244,7 +245,8 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
return 0;
@@ -271,7 +273,8 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
return 0;
@@ -288,7 +291,8 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
return 0;
@@ -307,7 +311,8 @@
if (connection->errcode != OCI_SUCCESS) {
/* failed to convert string to date */
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -322,7 +327,8 @@
);
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -347,7 +353,8 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -362,7 +369,8 @@
);
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -380,7 +388,8 @@
PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText,
(connection->env, connection->err, (CONST oratext *)element.s,
TEXT_BYTES(element_len), &ocistr));
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -395,7 +404,8 @@
);
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -469,7 +479,8 @@
);
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
FREE_ZVAL(*result_element);
return 1;
}
@@ -490,7 +501,8 @@
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);
+ connection->errcode =
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection,
connection->errcode);
FREE_ZVAL(*result_element);
return 1;
}
@@ -544,7 +556,8 @@
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);
+ connection->errcode =
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection,
connection->errcode);
FREE_ZVAL(*result_element);
return 1;
}
@@ -575,7 +588,8 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
return 0;
@@ -594,7 +608,8 @@
if (connection->errcode != OCI_SUCCESS) {
/* failed to convert string to date */
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -610,7 +625,8 @@
);
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -635,7 +651,8 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -651,7 +668,8 @@
);
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -669,7 +687,8 @@
PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText,
(connection->env, connection->err, (CONST oratext *)element.s,
TEXT_BYTES(element_len), &ocistr));
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -685,7 +704,8 @@
);
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -741,7 +761,8 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
return 0;
@@ -757,7 +778,8 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
}
}
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_interface.c?r1=1.36&r2=1.37&diff_format=u
Index: php-src/ext/oci8/oci8_interface.c
diff -u php-src/ext/oci8/oci8_interface.c:1.36
php-src/ext/oci8/oci8_interface.c:1.37
--- php-src/ext/oci8/oci8_interface.c:1.36 Mon Feb 25 23:49:51 2008
+++ php-src/ext/oci8/oci8_interface.c Tue Mar 25 02:25:02 2008
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_interface.c,v 1.36 2008/02/25 23:49:51 sixd Exp $ */
+/* $Id: oci8_interface.c,v 1.37 2008/03/25 02:25:02 sixd Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1637,10 +1637,8 @@
sb4 errcode = 0;
sword error = OCI_SUCCESS;
dvoid *errh = NULL;
-#ifdef HAVE_OCI8_ATTR_STATEMENT
ub2 error_offset = 0;
zstr sqltext = NULL_ZSTR;
-#endif
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) ==
FAILURE) {
return;
@@ -1653,11 +1651,9 @@
errh = statement->err;
error = statement->errcode;
-#ifdef HAVE_OCI8_ATTR_STATEMENT
if (php_oci_fetch_sqltext_offset(statement, &sqltext,
&error_offset TSRMLS_CC)) {
RETURN_FALSE;
}
-#endif
goto go_out;
}
@@ -1695,14 +1691,12 @@
array_init(return_value);
add_ascii_assoc_long(return_value, "code", errcode);
add_ascii_assoc_text(return_value, "message", ZSTR((char
*)errbuf), 0);
-#ifdef HAVE_OCI8_ATTR_STATEMENT
add_ascii_assoc_long(return_value, "offset", error_offset);
if (sqltext.v) {
add_ascii_assoc_text(return_value, "sqltext", sqltext,
1);
} else {
add_ascii_assoc_ascii_string(return_value, "sqltext",
"", 1);
}
-#endif
} else {
RETURN_FALSE;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_lob.c?r1=1.34&r2=1.35&diff_format=u
Index: php-src/ext/oci8/oci8_lob.c
diff -u php-src/ext/oci8/oci8_lob.c:1.34 php-src/ext/oci8/oci8_lob.c:1.35
--- php-src/ext/oci8/oci8_lob.c:1.34 Mon Feb 25 23:49:51 2008
+++ php-src/ext/oci8/oci8_lob.c Tue Mar 25 02:25:02 2008
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_lob.c,v 1.34 2008/02/25 23:49:51 sixd Exp $ */
+/* $Id: oci8_lob.c,v 1.35 2008/03/25 02:25:02 sixd Exp $ */
@@ -118,7 +118,7 @@
if (descriptor->type == OCI_DTYPE_FILE) {
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);
+ connection->errcode =
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection,
connection->errcode);
return 1;
}
@@ -127,7 +127,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -138,7 +138,7 @@
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);
+ connection->errcode =
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection,
connection->errcode);
return 1;
}
@@ -215,7 +215,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return read_length; /* we have to return original
length here */
}
@@ -286,7 +286,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -300,7 +300,7 @@
PHP_OCI_CALL_RETURN(connection->errcode, OCINlsNumericInfoGet,
(connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ));
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode
TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -379,7 +379,7 @@
#endif
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
if (data->s) {
efree(data->s);
@@ -395,7 +395,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
if (data->s) {
efree(data->s);
@@ -462,7 +462,7 @@
);
if (connection->errcode) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
*bytes_written = 0;
return 1;
@@ -505,7 +505,7 @@
}
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -563,7 +563,7 @@
);
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -582,7 +582,7 @@
}
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -604,7 +604,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -613,7 +613,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -654,7 +654,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -734,7 +734,7 @@
);
if (connection->errcode != OCI_SUCCESS) {
- php_oci_error(connection->err, connection->errcode
TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
close(fp);
return 1;
@@ -770,7 +770,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -806,7 +806,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -840,7 +840,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -860,7 +860,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -904,7 +904,7 @@
);
if (connection->errcode) {
- php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -912,7 +912,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -945,7 +945,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.55&r2=1.56&diff_format=u
Index: php-src/ext/oci8/oci8_statement.c
diff -u php-src/ext/oci8/oci8_statement.c:1.55
php-src/ext/oci8/oci8_statement.c:1.56
--- php-src/ext/oci8/oci8_statement.c:1.55 Tue Mar 4 21:45:55 2008
+++ php-src/ext/oci8/oci8_statement.c Tue Mar 25 02:25:02 2008
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_statement.c,v 1.55 2008/03/04 21:45:55 sixd Exp $ */
+/* $Id: oci8_statement.c,v 1.56 2008/03/25 02:25:02 sixd Exp $ */
#ifdef HAVE_CONFIG_H
@@ -79,7 +79,7 @@
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);
+ connection->errcode = php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
#if HAVE_OCI_STMT_PREPARE2
PHP_OCI_CALL(OCIStmtRelease, (statement->stmt,
statement->err, NULL, 0, statement->errcode ? OCI_STRLS_CACHE_DELETE :
OCI_DEFAULT));
@@ -137,7 +137,7 @@
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);
+ statement->errcode = php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -270,7 +270,7 @@
return 0;
}
- php_oci_error(statement->err, statement->errcode TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, statement->errcode
TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
statement->has_data = 0;
@@ -417,7 +417,7 @@
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);
+ statement->errcode = php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 1;
}
@@ -441,7 +441,7 @@
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);
+ statement->errcode = php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 1;
}
@@ -470,7 +470,7 @@
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);
+ statement->errcode = php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 1;
}
@@ -490,7 +490,7 @@
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);
+ statement->errcode =
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 1;
}
@@ -500,7 +500,7 @@
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
- php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
+ statement->errcode =
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 1;
}
@@ -510,7 +510,7 @@
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
- php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
+ statement->errcode =
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 1;
}
@@ -520,7 +520,7 @@
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
- php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
+ statement->errcode =
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 1;
}
@@ -530,7 +530,7 @@
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
- php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
+ statement->errcode =
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 1;
}
@@ -543,7 +543,7 @@
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
- php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
+ statement->errcode =
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 1;
}
@@ -553,7 +553,7 @@
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
- php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
+ statement->errcode =
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 1;
}
@@ -563,7 +563,7 @@
if (statement->errcode != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param,
OCI_DTYPE_PARAM));
- php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
+ statement->errcode =
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 1;
}
@@ -665,17 +665,17 @@
PHP_OCI_CALL_RETURN(statement->errcode,
OCIDefineByPos,
(
- statement->stmt,
/* IN/OUT handle to the requested SQL query */
- (OCIDefine
**)&outcol->oci_define, /* IN/OUT pointer to a pointer to a define
handle */
- statement->err,
/* IN/OUT An error handle */
- counter,
/* IN position in the select list */
- (dvoid *)NULL,
/* IN/OUT pointer to a buffer */
- outcol->storage_size4,
/* IN The size of each valuep buffer in bytes */
- define_type,
/* IN The data type */
- (dvoid *)&outcol->indicator,
/* IN pointer to an indicator variable or arr */
- (ub2 *)NULL,
/* IN/OUT Pointer to array of length of data fetched */
- (ub2 *)NULL,
/* OUT Pointer to array of column-level return codes */
- OCI_DYNAMIC_FETCH
/* IN mode (OCI_DEFAULT, OCI_DYNAMIC_FETCH) */
+ statement->stmt,
/* IN/OUT handle to the requested SQL
query */
+ (OCIDefine
**)&outcol->oci_define, /* IN/OUT pointer to a pointer to
a define handle */
+ statement->err,
/* IN/OUT An error handle */
+ counter,
/* IN position in the
select list */
+ (dvoid *)NULL,
/* IN/OUT pointer to a buffer */
+ outcol->storage_size4,
/* IN The size of each valuep buffer in
bytes */
+ define_type,
/* IN The data type */
+ (dvoid *)&outcol->indicator,
/* IN pointer to an indicator variable or arr */
+ (ub2 *)NULL,
/* IN/OUT Pointer to array of length of
data fetched */
+ (ub2 *)NULL,
/* OUT Pointer to array of
column-level return codes */
+ OCI_DYNAMIC_FETCH
/* IN mode (OCI_DEFAULT,
OCI_DYNAMIC_FETCH) */
)
);
@@ -683,24 +683,24 @@
PHP_OCI_CALL_RETURN(statement->errcode,
OCIDefineByPos,
(
- statement->stmt,
/* IN/OUT handle to the requested SQL query */
- (OCIDefine
**)&outcol->oci_define, /* IN/OUT pointer to a pointer to a define
handle */
- statement->err,
/* IN/OUT An error handle */
- counter,
/* IN position in the select list */
- (dvoid *)buf,
/* IN/OUT pointer to a buffer */
- outcol->storage_size4,
/* IN The size of each valuep buffer in bytes */
- define_type,
/* IN The data type */
- (dvoid *)&outcol->indicator,
/* IN pointer to an indicator variable or arr */
- (ub2 *)&outcol->retlen,
/* IN/OUT Pointer to array of length of data fetched */
- (ub2 *)&outcol->retcode,
/* OUT Pointer to array of column-level return codes */
- OCI_DEFAULT
/* IN mode (OCI_DEFAULT, OCI_DYNAMIC_FETCH) */
+ statement->stmt,
/* IN/OUT handle to the requested SQL
query */
+ (OCIDefine
**)&outcol->oci_define, /* IN/OUT pointer to a pointer to
a define handle */
+ statement->err,
/* IN/OUT An error handle */
+ counter,
/* IN position in the
select list */
+ (dvoid *)buf,
/* IN/OUT pointer to a buffer */
+ outcol->storage_size4,
/* IN The size of each valuep buffer in
bytes */
+ define_type,
/* IN The data type */
+ (dvoid *)&outcol->indicator,
/* IN pointer to an indicator variable or arr */
+ (ub2 *)&outcol->retlen,
/* IN/OUT Pointer to array of length of data
fetched */
+ (ub2 *)&outcol->retcode,
/* OUT Pointer to array of column-level
return codes */
+ OCI_DEFAULT
/* IN mode (OCI_DEFAULT,
OCI_DYNAMIC_FETCH) */
)
);
}
if (statement->errcode != OCI_SUCCESS) {
- php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
+ statement->errcode =
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 0;
}
@@ -870,7 +870,8 @@
zval_dtor(*entry);
if (connection->errcode !=
OCI_SUCCESS) {
-
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode =
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
ZVAL_NULL(*entry);
} else {
zstr tmp;
@@ -883,7 +884,8 @@
PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err,
&(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
tmp.s = (char *)buff;
if (connection->errcode !=
OCI_SUCCESS) {
-
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ connection->errcode =
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
add_next_index_null(bind->zval);
} else {
add_next_index_textl(bind->zval, tmp, TEXT_CHARS(buff_len), 1);
@@ -1086,7 +1088,7 @@
);
if (statement->errcode != OCI_SUCCESS) {
- php_oci_error(statement->err, statement->errcode TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1104,7 +1106,7 @@
);
if (statement->errcode != OCI_SUCCESS) {
- php_oci_error(statement->err, statement->errcode
TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 1;
}
@@ -1126,7 +1128,7 @@
);
if (statement->errcode) {
- php_oci_error(statement->err, statement->errcode
TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection,
statement->errcode);
return 1;
}
@@ -1321,7 +1323,7 @@
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);
+ statement->errcode = php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1342,7 +1344,7 @@
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);
+ statement->errcode = php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1440,7 +1442,7 @@
if (statement->errcode != OCI_SUCCESS) {
efree(bind);
- php_oci_error(statement->err, statement->errcode TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err,
statement->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1642,7 +1644,8 @@
efree(bind->array.element_lengths);
efree(bind->array.elements);
efree(bind);
- php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ connection->errcode =
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection,
connection->errcode);
return NULL;
}
@@ -1663,7 +1666,8 @@
efree(bind->array.element_lengths);
efree(bind->array.elements);
efree(bind);
- php_oci_error(connection->err,
connection->errcode TSRMLS_CC);
+ connection->errcode =
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection,
connection->errcode);
return NULL;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/php_oci8.h?r1=1.43&r2=1.44&diff_format=u
Index: php-src/ext/oci8/php_oci8.h
diff -u php-src/ext/oci8/php_oci8.h:1.43 php-src/ext/oci8/php_oci8.h:1.44
--- php-src/ext/oci8/php_oci8.h:1.43 Thu Jan 3 16:18:28 2008
+++ php-src/ext/oci8/php_oci8.h Tue Mar 25 02:25:02 2008
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_oci8.h,v 1.43 2008/01/03 16:18:28 nlopess Exp $ */
+/* $Id: php_oci8.h,v 1.44 2008/03/25 02:25:02 sixd Exp $ */
#if HAVE_OCI8
# ifndef PHP_OCI8_H
@@ -35,6 +35,12 @@
# include "TSRM.h"
#endif
+
+/*
+ * The version of the OCI8 extension.
+ */
+#define PHP_OCI8_VERSION "1.3.1 Beta"
+
extern zend_module_entry oci8_module_entry;
#define phpext_oci8_ptr &oci8_module_entry
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/php_oci8_int.h?r1=1.42&r2=1.43&diff_format=u
Index: php-src/ext/oci8/php_oci8_int.h
diff -u php-src/ext/oci8/php_oci8_int.h:1.42
php-src/ext/oci8/php_oci8_int.h:1.43
--- php-src/ext/oci8/php_oci8_int.h:1.42 Wed Mar 12 01:25:13 2008
+++ php-src/ext/oci8/php_oci8_int.h Tue Mar 25 02:25:02 2008
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_oci8_int.h,v 1.42 2008/03/12 01:25:13 sixd Exp $ */
+/* $Id: php_oci8_int.h,v 1.43 2008/03/25 02:25:02 sixd Exp $ */
#if HAVE_OCI8
# ifndef PHP_OCI8_INT_H
@@ -268,34 +268,44 @@
} while (0)
#define PHP_OCI_HANDLE_ERROR(connection, errcode) \
- do { \
- switch (errcode) { \
- case 1013: \
- zend_bailout(); \
- break; \
- case 22: \
- case 378: \
- case 602: \
- case 603: \
- case 604: \
- case 609: \
- case 1012: \
- case 1033: \
- case 1041: \
- case 1043: \
- case 1089: \
- case 1090: \
- case 1092: \
- case 3113: \
- case 3114: \
- case 3122: \
- case 3135: \
- case 12153: \
- case 27146: \
- case 28511: \
- connection->is_open = 0; \
- break; \
- } \
+ do {
\
+ switch (errcode) {
\
+ case 1013:
\
+ zend_bailout();
\
+ break;
\
+ case 22:
\
+ case 378:
\
+ case 602:
\
+ case 603:
\
+ case 604:
\
+ case 609:
\
+ case 1012:
\
+ case 1033:
\
+ case 1041:
\
+ case 1043:
\
+ case 1089:
\
+ case 1090:
\
+ case 1092:
\
+ case 3113:
\
+ case 3114:
\
+ case 3122:
\
+ case 3135:
\
+ case 12153:
\
+ case 27146:
\
+ case 28511:
\
+ (connection)->is_open = 0; \
+ break;
\
+ default:
\
+ { /* do both numeric checks (above) and the status
check for maximum version compatibility */ \
+ ub4 serverStatus = OCI_SERVER_NORMAL;
\
+ PHP_OCI_CALL(OCIAttrGet, ((dvoid
*)(connection)->server, OCI_HTYPE_SERVER, (dvoid *)&serverStatus, \
+
(ub4 *)0, OCI_ATTR_SERVER_STATUS, (connection)->err)); \
+ if (serverStatus != OCI_SERVER_NORMAL) {
\
+ (connection)->is_open = 0;
\
+ }
\
+ }
\
+ break;
\
+ }
\
} while (0)
#define PHP_OCI_REGISTER_RESOURCE(resource, le_resource) \
@@ -349,9 +359,7 @@
sb4 php_oci_error (OCIError *, sword TSRMLS_DC);
sb4 php_oci_fetch_errmsg(OCIError *, text ** TSRMLS_DC);
-#ifdef HAVE_OCI8_ATTR_STATEMENT
int php_oci_fetch_sqltext_offset(php_oci_statement *, zstr *, ub2 * TSRMLS_DC);
-#endif
void php_oci_do_connect (INTERNAL_FUNCTION_PARAMETERS, int , int);
php_oci_connection *php_oci_do_connect_ex(zstr username, int username_len,
zstr password, int password_len, zstr new_password, int new_password_len, zstr
dbname, int dbname_len, zstr charset, long session_mode, int persistent, int
exclusive, zend_uchar type TSRMLS_DC);
@@ -464,6 +472,7 @@
zend_bool old_oci_close_semantics; /*
old_oci_close_semantics flag (to determine the way oci_close() should behave) */
int shutdown;
/* in shutdown flag */
+ int request_shutdown;
/* in request shutdown flag */
OCIEnv *env;
/* global environment handle */
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/drcp_cclass1.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/oci8/tests/drcp_cclass1.phpt
diff -u php-src/ext/oci8/tests/drcp_cclass1.phpt:1.1
php-src/ext/oci8/tests/drcp_cclass1.phpt:1.2
--- php-src/ext/oci8/tests/drcp_cclass1.phpt:1.1 Wed Mar 12 01:25:13 2008
+++ php-src/ext/oci8/tests/drcp_cclass1.phpt Tue Mar 25 02:25:03 2008
@@ -40,7 +40,7 @@
echo "Test 3\n";
-$s = oci_parse($c, "select cclass_name from v\$cpool_cc_stats where
cclass_name like '%.cc__$t'");
+$s = oci_parse($c, "select cclass_name from v\$cpool_cc_stats where
cclass_name like '%.cc__$t' order by cclass_name");
oci_execute($s);
oci_fetch_all($s, $r);
var_dump($r);
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/drcp_connect1.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/oci8/tests/drcp_connect1.phpt
diff -u php-src/ext/oci8/tests/drcp_connect1.phpt:1.2
php-src/ext/oci8/tests/drcp_connect1.phpt:1.3
--- php-src/ext/oci8/tests/drcp_connect1.phpt:1.2 Tue Feb 19 01:44:29 2008
+++ php-src/ext/oci8/tests/drcp_connect1.phpt Tue Mar 25 02:25:03 2008
@@ -1,7 +1,11 @@
--TEST--
DRCP: oci_connect()
--SKIPIF--
-<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+<?php
+if (!extension_loaded('oci8')) die("skip no oci8 extension");
+require(dirname(__FILE__)."/details.inc");
+if (!$test_drcp) die("skip expected test results are only valid for DRCP
Mode");
+?>
--INI--
oci8.connection_class=test
oci8.old_oci_close_semantics=0
http://cvs.php.net/viewvc.cgi/php-src/main/build-defs.h.in?r1=1.19&r2=1.20&diff_format=u
Index: php-src/main/build-defs.h.in
diff -u php-src/main/build-defs.h.in:1.19 php-src/main/build-defs.h.in:1.20
--- php-src/main/build-defs.h.in:1.19 Sun Jul 15 15:09:36 2007
+++ php-src/main/build-defs.h.in Tue Mar 25 02:25:03 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: build-defs.h.in,v 1.19 2007/07/15 15:09:36 jani Exp $ */
+/* $Id: build-defs.h.in,v 1.20 2008/03/25 02:25:03 sixd Exp $ */
#define CONFIGURE_COMMAND "@CONFIGURE_COMMAND@"
#define PHP_ADA_INCLUDE ""
@@ -53,7 +53,7 @@
#define PHP_ODBC_TYPE "@ODBC_TYPE@"
#define PHP_OCI8_SHARED_LIBADD "@OCI8_SHARED_LIBADD@"
#define PHP_OCI8_DIR "@OCI8_DIR@"
-#define PHP_OCI8_VERSION "@OCI8_VERSION@"
+#define PHP_OCI8_ORACLE_VERSION "@OCI8_ORACLE_VERSION@"
#define PHP_ORACLE_SHARED_LIBADD "@ORACLE_SHARED_LIBADD@"
#define PHP_ORACLE_DIR "@ORACLE_DIR@"
#define PHP_ORACLE_VERSION "@ORACLE_VERSION@"
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php