summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/oci8/oci8_statement.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c
index f57ecce8b9..b0929c8989 100644
--- a/ext/oci8/oci8_statement.c
+++ b/ext/oci8/oci8_statement.c
@@ -82,7 +82,7 @@ php_oci_statement *php_oci_statement_create (php_oci_connection *connection, cha
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, OCI_STRLS_CACHE_DELETE));
+ PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, statement->errcode ? OCI_STRLS_CACHE_DELETE : OCI_DEFAULT));
PHP_OCI_CALL(OCIHandleFree,(statement->err, OCI_HTYPE_ERROR));
#else
PHP_OCI_CALL(OCIHandleFree,(statement->stmt, OCI_HTYPE_STMT));