tony2001 Fri Jun 8 08:44:39 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/oci8 oci8.c oci8_statement.c
Log:
MFH: enable statement cache for non-persistent connections (patch by Chris
Jones)
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.269.2.16.2.32&r2=1.269.2.16.2.33&diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.269.2.16.2.32
php-src/ext/oci8/oci8.c:1.269.2.16.2.33
--- php-src/ext/oci8/oci8.c:1.269.2.16.2.32 Sat Feb 24 02:17:25 2007
+++ php-src/ext/oci8/oci8.c Fri Jun 8 08:44:39 2007
@@ -26,7 +26,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8.c,v 1.269.2.16.2.32 2007/02/24 02:17:25 helly Exp $ */
+/* $Id: oci8.c,v 1.269.2.16.2.33 2007/06/08 08:44:39 tony2001 Exp $ */
/* TODO
*
* file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty()
with OCI_ATTR_LOBEMPTY
@@ -674,7 +674,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "OCI8 Support", "enabled");
php_info_print_table_row(2, "Version", "1.2.3");
- php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.16.2.32 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.16.2.33 $");
snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent));
php_info_print_table_row(2, "Active Persistent Connections", buf);
@@ -1374,7 +1374,7 @@
}
#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)));
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.7.2.14.2.24&r2=1.7.2.14.2.25&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.24
php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.25
--- php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.24 Tue Jun 5 07:49:00 2007
+++ php-src/ext/oci8/oci8_statement.c Fri Jun 8 08:44:39 2007
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_statement.c,v 1.7.2.14.2.24 2007/06/05 07:49:00 tony2001 Exp $ */
+/* $Id: oci8_statement.c,v 1.7.2.14.2.25 2007/06/08 08:44:39 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
@@ -82,7 +82,7 @@
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 @@
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));
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php