]> granicus.if.org Git - php/commitdiff
MFH: missing part of the fix for bug #42134
authorAntony Dovgal <tony2001@php.net>
Tue, 31 Jul 2007 21:09:01 +0000 (21:09 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 31 Jul 2007 21:09:01 +0000 (21:09 +0000)
ext/oci8/oci8_interface.c

index 009ef4d15357d5f312a4182f4653052253cb90fe..834cf99ddae308405cf390bb8029a89c2785daf1 100644 (file)
@@ -1583,19 +1583,28 @@ PHP_FUNCTION(oci_error)
                                RETURN_FALSE;
                        }
 #endif
-               } else {
-                       connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection);
-                       
-                       if (connection) {
-                               errh = connection->err;
-                               error = connection->errcode;
-                       }
+                       goto go_out;
+               }
+
+               connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection);
+               if (connection) {
+                       errh = connection->err;
+                       error = connection->errcode;
+                       goto go_out;
+               }
+
+               connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_pconnection);
+               if (connection) {
+                       errh = connection->err;
+                       error = connection->errcode;
+                       goto go_out;
                }
        } else {
                errh = OCI_G(err);
                error = OCI_G(errcode);
        }
 
+go_out:
        if (error == OCI_SUCCESS) { /* no error set in the handle */
                RETURN_FALSE;
        }