sixd Sat Mar 22 01:27:50 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/oci8 oci8.c oci8_collection.c oci8_lob.c oci8_statement.c php_oci8_int.h /php-src/ext/oci8/tests drcp_cclass1.phpt drcp_connect1.phpt Log: Further improvements to error handling
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.269.2.16.2.38.2.10&r2=1.269.2.16.2.38.2.11&diff_format=u Index: php-src/ext/oci8/oci8.c diff -u php-src/ext/oci8/oci8.c:1.269.2.16.2.38.2.10 php-src/ext/oci8/oci8.c:1.269.2.16.2.38.2.11 --- php-src/ext/oci8/oci8.c:1.269.2.16.2.38.2.10 Wed Mar 12 01:26:44 2008 +++ php-src/ext/oci8/oci8.c Sat Mar 22 01:27:50 2008 @@ -26,7 +26,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8.c,v 1.269.2.16.2.38.2.10 2008/03/12 01:26:44 sixd Exp $ */ +/* $Id: oci8.c,v 1.269.2.16.2.38.2.11 2008/03/22 01:27:50 sixd Exp $ */ /* TODO * * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() with OCI_ATTR_LOBEMPTY @@ -661,6 +661,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; } @@ -684,6 +685,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 @@ -694,7 +698,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 @@ -712,7 +716,7 @@ 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.269.2.16.2.38.2.10 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.16.2.38.2.11 $"); snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent)); php_info_print_table_row(2, "Active Persistent Connections", buf); @@ -781,10 +785,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, strlen(connection->hash_key)+1, (void **) &le)== SUCCESS) && (le->type == le_pconnection) && (le->ptr == connection)) { + zend_hash_del(&EG(persistent_list), connection->hash_key, strlen(connection->hash_key)+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__); + } + } } } /* }}} */ @@ -999,14 +1030,16 @@ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *) sqltext, (ub4 *)0, OCI_ATTR_STATEMENT, 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; } 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; @@ -1246,32 +1279,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; - - /* 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) { @@ -1281,7 +1314,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. @@ -1460,7 +1492,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; } @@ -1475,7 +1507,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; } @@ -1638,7 +1670,7 @@ 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); + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } @@ -1655,7 +1687,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; } @@ -1859,6 +1891,7 @@ { time_t timestamp; php_oci_connection *connection; + int rsrc_type; timestamp = time(NULL); @@ -1866,7 +1899,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.5.2.3.2.7.2.2&r2=1.5.2.3.2.7.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.7.2.2 php-src/ext/oci8/oci8_collection.c:1.5.2.3.2.7.2.3 --- php-src/ext/oci8/oci8_collection.c:1.5.2.3.2.7.2.2 Fri Feb 15 23:24:45 2008 +++ php-src/ext/oci8/oci8_collection.c Sat Mar 22 01:27:50 2008 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_collection.c,v 1.5.2.3.2.7.2.2 2008/02/15 23:24:45 sixd Exp $ */ +/* $Id: oci8_collection.c,v 1.5.2.3.2.7.2.3 2008/03/22 01:27:50 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; } @@ -343,7 +349,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; } @@ -358,7 +365,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; } @@ -376,7 +384,8 @@ PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, 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; } @@ -391,7 +400,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; } @@ -465,7 +475,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; } @@ -486,7 +497,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; } @@ -528,7 +540,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; } @@ -559,7 +572,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; @@ -578,7 +592,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; } @@ -594,7 +609,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; } @@ -615,7 +631,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; } @@ -631,7 +648,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; } @@ -649,7 +667,8 @@ PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, 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; } @@ -665,7 +684,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; } @@ -721,7 +741,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; @@ -737,7 +758,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_lob.c?r1=1.7.2.6.2.14.2.4&r2=1.7.2.6.2.14.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.14.2.4 php-src/ext/oci8/oci8_lob.c:1.7.2.6.2.14.2.5 --- php-src/ext/oci8/oci8_lob.c:1.7.2.6.2.14.2.4 Mon Feb 25 23:50:51 2008 +++ php-src/ext/oci8/oci8_lob.c Sat Mar 22 01:27:50 2008 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_lob.c,v 1.7.2.6.2.14.2.4 2008/02/25 23:50:51 sixd Exp $ */ +/* $Id: oci8_lob.c,v 1.7.2.6.2.14.2.5 2008/03/22 01:27:50 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; } @@ -209,7 +209,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 */ } @@ -281,7 +281,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; } @@ -291,7 +291,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; } @@ -305,7 +305,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; } @@ -384,7 +384,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) { efree(*data); @@ -400,7 +400,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) { efree(*data); @@ -457,7 +457,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; @@ -500,7 +500,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; } @@ -558,7 +558,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; } @@ -577,7 +577,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; } @@ -599,7 +599,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; } @@ -608,7 +608,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; } @@ -649,7 +649,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; } @@ -729,7 +729,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; @@ -765,7 +765,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; } @@ -801,7 +801,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; } @@ -835,7 +835,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; } @@ -855,7 +855,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; } @@ -899,7 +899,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; } @@ -907,7 +907,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; } http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.7.2.14.2.28.2.5&r2=1.7.2.14.2.28.2.6&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.28.2.5 php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.28.2.6 --- php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.28.2.5 Tue Mar 4 21:46:24 2008 +++ php-src/ext/oci8/oci8_statement.c Sat Mar 22 01:27:50 2008 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_statement.c,v 1.7.2.14.2.28.2.5 2008/03/04 21:46:24 sixd Exp $ */ +/* $Id: oci8_statement.c,v 1.7.2.14.2.28.2.6 2008/03/22 01:27:50 sixd Exp $ */ #ifdef HAVE_CONFIG_H @@ -79,10 +79,10 @@ 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)); + PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, OCI_STRLS_CACHE_DELETE)); PHP_OCI_CALL(OCIHandleFree,(statement->err, OCI_HTYPE_ERROR)); #else PHP_OCI_CALL(OCIHandleFree,(statement->stmt, OCI_HTYPE_STMT)); @@ -135,7 +135,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; } @@ -266,7 +266,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; @@ -409,7 +409,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; } @@ -433,7 +433,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; } @@ -462,7 +462,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; } @@ -482,7 +482,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; } @@ -492,7 +492,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; } @@ -502,7 +502,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; } @@ -512,7 +512,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; } @@ -522,7 +522,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; } @@ -535,7 +535,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; } @@ -545,7 +545,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; } @@ -555,7 +555,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; } @@ -652,17 +652,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) */ ) ); @@ -670,24 +670,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; } @@ -849,7 +849,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 { ZVAL_STRINGL(*entry, (char *)buff, buff_len, 1); @@ -858,7 +859,8 @@ } else { 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); + 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_stringl(bind->zval, (char *)buff, buff_len, 1); @@ -1041,7 +1043,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; } @@ -1059,7 +1061,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; } @@ -1081,7 +1083,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; } @@ -1261,7 +1263,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; } @@ -1282,7 +1284,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; } @@ -1380,7 +1382,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; } @@ -1569,7 +1571,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; } @@ -1583,7 +1586,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_int.h?r1=1.11.2.6.2.21.2.6&r2=1.11.2.6.2.21.2.7&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.21.2.6 php-src/ext/oci8/php_oci8_int.h:1.11.2.6.2.21.2.7 --- php-src/ext/oci8/php_oci8_int.h:1.11.2.6.2.21.2.6 Wed Mar 12 01:26:44 2008 +++ php-src/ext/oci8/php_oci8_int.h Sat Mar 22 01:27:50 2008 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_oci8_int.h,v 1.11.2.6.2.21.2.6 2008/03/12 01:26:44 sixd Exp $ */ +/* $Id: php_oci8_int.h,v 1.11.2.6.2.21.2.7 2008/03/22 01:27:50 sixd Exp $ */ #if HAVE_OCI8 # ifndef PHP_OCI8_INT_H @@ -258,34 +258,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) \ @@ -453,6 +463,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.2.2&r2=1.1.2.3&diff_format=u Index: php-src/ext/oci8/tests/drcp_cclass1.phpt diff -u php-src/ext/oci8/tests/drcp_cclass1.phpt:1.1.2.2 php-src/ext/oci8/tests/drcp_cclass1.phpt:1.1.2.3 --- php-src/ext/oci8/tests/drcp_cclass1.phpt:1.1.2.2 Wed Mar 12 01:26:44 2008 +++ php-src/ext/oci8/tests/drcp_cclass1.phpt Sat Mar 22 01:27:50 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.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/oci8/tests/drcp_connect1.phpt diff -u php-src/ext/oci8/tests/drcp_connect1.phpt:1.1.2.1 php-src/ext/oci8/tests/drcp_connect1.phpt:1.1.2.2 --- php-src/ext/oci8/tests/drcp_connect1.phpt:1.1.2.1 Thu Jan 31 01:33:29 2008 +++ php-src/ext/oci8/tests/drcp_connect1.phpt Sat Mar 22 01:27:50 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 @@ -50,7 +54,7 @@ oci_close($pconn1); echo " Connection pconn1 closed....\n"; -// Second conenction with oci_pconnect should return the same session hence the +// Second connection with oci_pconnect should return the same session hence the // value returned is what is set by pconn1 var_dump($pconn2 = oci_pconnect($user,$password,$dbase));
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php