]> granicus.if.org Git - php/commitdiff
MFH: PECL Bug #15988 (sqlnet.ora isn't read with older Oracle libraries)
authorChristopher Jones <sixd@php.net>
Mon, 9 Mar 2009 18:04:26 +0000 (18:04 +0000)
committerChristopher Jones <sixd@php.net>
Mon, 9 Mar 2009 18:04:26 +0000 (18:04 +0000)
ext/oci8/oci8.c

index d1bd81a64cc0ad6dd487d4489b077f0b5aac5084..bea6d7e153bec036918db7098faf41f40ba2c84e 100644 (file)
@@ -983,6 +983,22 @@ static void php_oci_init_global_handles(TSRMLS_D)
                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: