From: Thies C. Arntzen Date: Sat, 17 Feb 2001 15:54:40 +0000 (+0000) Subject: make oci work again. X-Git-Tag: php-4.0.5RC1~262 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67c2eaa6ea221d47717b2218637394718d06c53a;p=php make oci work again. --- diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index f504827e0c..2ee8ef2636 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -735,22 +735,17 @@ _oci_session_list_dtor(zend_rsrc_list_entry *rsrc) static ub4 oci_handle_error(oci_connection *connection, ub4 errcode) { - switch (errcode) { - case 0: - return 0; - break; - case 22: /* ORA-00022 Invalid session id */ - case 1012: /* ORA-01012: */ - case 3113: /* ORA-03113: end-of-file on communication channel */ - connection->open = 0; - connection->session->open = 0; - connection->session->server->open = 0; - return 0; - break; - default: - return 0; - break; - } + switch (errcode) { + case 22: /* ORA-00022 Invalid session id */ + case 1012: /* ORA-01012: */ + case 3113: /* ORA-03113: end-of-file on communication channel */ + connection->open = 0; + connection->session->open = 0; + connection->session->server->open = 0; + return 1; /* fatal error */ + } + + return 0; /* no fatal error */ } /* {{{ oci_error() */ @@ -1224,8 +1219,12 @@ oci_execute(oci_statement *statement, char *func,ub4 mode) if (statement->binds) { zend_hash_apply(statement->binds, (int (*)(void *)) _oci_bind_post_exec); } + oci_handle_error(statement->conn, statement->error); - return 0; + + if (statement->error) { + return 0; + } } if (stmttype == OCI_STMT_SELECT && (statement->executed == 0)) {