diff options
author | Antony Dovgal <tony2001@php.net> | 2007-06-08 08:44:39 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2007-06-08 08:44:39 +0000 |
commit | a87f7117ffd37fe6fd62d1475718f640eac06579 (patch) | |
tree | 005200c2a5747595e960d9bcdde7989a1aae9a3e | |
parent | 76065b520aafe796717d4ae3ae296e2b4127ec38 (diff) | |
download | php-git-a87f7117ffd37fe6fd62d1475718f640eac06579.tar.gz |
MFH: enable statement cache for non-persistent connections (patch by Chris Jones)
-rw-r--r-- | ext/oci8/oci8.c | 2 | ||||
-rw-r--r-- | ext/oci8/oci8_statement.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index cf4c321066..ccfe6cd269 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -1374,7 +1374,7 @@ open: } #if HAVE_OCI_STMT_PREPARE2 - if (connection->is_persistent) { + { ub4 statement_cache_size = (OCI_G(statement_cache_size) > 0) ? OCI_G(statement_cache_size) : 0; PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &statement_cache_size, 0, (ub4) OCI_ATTR_STMTCACHESIZE, OCI_G(err))); diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index 672d72f34e..c28ca8216b 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 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_DEFAULT)); + 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)); @@ -733,7 +733,7 @@ void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC) if (statement->stmt) { #if HAVE_OCI_STMT_PREPARE2 if (statement->last_query_len) { /* FIXME: magical */ - PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, OCI_DEFAULT)); + PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, statement->errcode ? OCI_STRLS_CACHE_DELETE : OCI_DEFAULT)); } else { PHP_OCI_CALL(OCIHandleFree, (statement->stmt, OCI_HTYPE_STMT)); } |