sixd Mon Mar 9 18:04:26 2009 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/oci8 oci8.c
Log:
MFH: PECL Bug #15988 (sqlnet.ora isn't read with older Oracle libraries)
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.269.2.16.2.38.2.28&r2=1.269.2.16.2.38.2.29&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.28
php-src/ext/oci8/oci8.c:1.269.2.16.2.38.2.29
--- php-src/ext/oci8/oci8.c:1.269.2.16.2.38.2.28 Mon Mar 9 17:42:22 2009
+++ php-src/ext/oci8/oci8.c Mon Mar 9 18:04:26 2009
@@ -26,7 +26,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8.c,v 1.269.2.16.2.38.2.28 2009/03/09 17:42:22 sixd Exp $ */
+/* $Id: oci8.c,v 1.269.2.16.2.38.2.29 2009/03/09 18:04:26 sixd Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -983,6 +983,22 @@
goto oci_error;
}
+#if !defined(OCI_MAJOR_VERSION) || (OCI_MAJOR_VERSION < 11)
+ /* This works around PECL bug #15988 (sqlnet.ora not being read).
+ * The root cause was fixed in Oracle 10.2.0.4 but there is no
+ * compile time method to check for that precise patch level, nor
+ * can it be guaranteed that runtime will use the same patch level
+ * the code was compiled with. So, we do this code for all non
+ * 11g versions.
+ */
+ OCICPool *cpoolh;
+ ub4 cpoolmode = 0x80000000; /* Pass invalid mode to
OCIConnectionPoolCreate */
+ PHP_OCI_CALL(OCIHandleAlloc, (OCI_G(env), (dvoid **) &cpoolh,
OCI_HTYPE_CPOOL, (size_t) 0, (dvoid **) 0));
+ PHP_OCI_CALL(OCIConnectionPoolCreate, (OCI_G(env), OCI_G(err), cpoolh,
NULL, 0, NULL, 0, 0, 0, 0, NULL, 0, NULL, 0, cpoolmode));
+ PHP_OCI_CALL(OCIConnectionPoolDestroy, (cpoolh, OCI_G(err),
OCI_DEFAULT));
+ PHP_OCI_CALL(OCIHandleFree, (cpoolh, OCI_HTYPE_CPOOL));
+#endif
+
return;
oci_error:
@@ -1214,7 +1230,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "OCI8 Support", "enabled");
php_info_print_table_row(2, "Version", PHP_OCI8_VERSION);
- php_info_print_table_row(2, "Revision", "$Revision:
1.269.2.16.2.38.2.28 $");
+ php_info_print_table_row(2, "Revision", "$Revision:
1.269.2.16.2.38.2.29 $");
snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent));
php_info_print_table_row(2, "Active Persistent Connections", buf);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php