]> granicus.if.org Git - php/commitdiff
MFH: fix #42134 (oci_error() returns false after oci_new_collection() fails)
authorAntony Dovgal <tony2001@php.net>
Tue, 31 Jul 2007 19:21:08 +0000 (19:21 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 31 Jul 2007 19:21:08 +0000 (19:21 +0000)
NEWS
ext/oci8/oci8.c
ext/oci8/oci8_collection.c
ext/oci8/oci8_interface.c
ext/oci8/oci8_lob.c
ext/oci8/oci8_statement.c
ext/oci8/php_oci8_int.h

diff --git a/NEWS b/NEWS
index d9bbd4807df09c57b32a4ef647cea14a9636e16e..48a613e9a7a6805df1d66fd64eeb44565e40f32f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -74,6 +74,8 @@ PHP                                                                        NEWS
   length). (Ilia) 
 - Fixed bug #42135 (Second call of session_start() causes creation of SID).
   (Ilia)
+- Fixed bug #42134 (oci_error() returns false after oci_new_collection() 
+  fails). (Tony)
 - Fixed Bug #42112 (deleting a node produces memory corruption). (Rob)
 - Fixed Bug #42107 (sscanf broken when using %2$s format parameters). (Jani)
 - Fixed bug #42090 (json_decode causes segmentation fault). (Hannes)
index 04d4f42a568e1c42278f94690ccf74c409a92b92..5fb8f9ff7ee46e7fac127e18c5a1e48eeef07257 100644 (file)
@@ -1832,3 +1832,12 @@ static int php_oci_list_helper(zend_rsrc_list_entry *le, void *le_type TSRMLS_DC
 #endif
 
 #endif /* HAVE_OCI8 */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
index ed9037af78ee3219deeb3ae315180dd223ade881..dabd90eeaca3c27563338382164b59c72f082b4e 100644 (file)
@@ -55,7 +55,8 @@ php_oci_collection * php_oci_collection_create(php_oci_connection* connection, c
 
        collection->connection = connection;
        collection->collection = NULL;
-       
+       zend_list_addref(collection->connection->rsrc_id);
+
        /* get type handle by name */
        PHP_OCI_CALL_RETURN(connection->errcode, OCITypeByName,
                        (
@@ -741,3 +742,12 @@ void php_oci_collection_close(php_oci_collection *collection TSRMLS_DC)
 } /* }}} */
 
 #endif /* HAVE_OCI8 */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
index 427a88b7ecdd93e1adbb8d77c233d4645e206397..009ef4d15357d5f312a4182f4653052253cb90fe 100644 (file)
@@ -2169,3 +2169,12 @@ PHP_FUNCTION(oci_new_collection)
 #endif
 
 #endif /* HAVE_OCI8 */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
index 470b3b44882ce5f21a57d5ae0432d895af21fb54..9a93ac4e8da4b14bbcd481c05a4b305cb272cfde 100644 (file)
@@ -69,6 +69,8 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ
 
        descriptor = ecalloc(1, sizeof(php_oci_descriptor));
        descriptor->type = type;
+       descriptor->connection = connection;
+       zend_list_addref(descriptor->connection->rsrc_id);
 
        PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIDescriptorAlloc, (connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0));
 
@@ -79,8 +81,6 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ
                return NULL;
        }
 
-       descriptor->connection = connection;
-
        PHP_OCI_REGISTER_RESOURCE(descriptor, le_descriptor);
        
        descriptor->lob_current_position = 0;
@@ -895,3 +895,12 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, ub1 type, char *data,
 } /* }}} */
 
 #endif /* HAVE_OCI8 */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
index 947d7a29780bd157b42002446449d54badea1624..fa592bc025d0d25df730b1dc7464d34b6bdd3be8 100644 (file)
@@ -107,6 +107,7 @@ php_oci_statement *php_oci_statement_create (php_oci_connection *connection, cha
        statement->connection = connection;
        statement->has_data = 0;
        statement->nested = 0;
+       zend_list_addref(statement->connection->rsrc_id);
 
        if (OCI_G(default_prefetch) > 0) {
                php_oci_statement_set_prefetch(statement, OCI_G(default_prefetch) TSRMLS_CC);
@@ -1587,3 +1588,12 @@ php_oci_bind *php_oci_bind_array_helper_date(zval* var, long max_table_length, p
 } /* }}} */
 
 #endif /* HAVE_OCI8 */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
index 8aacac9cacf0bcb6b5a1fa7b0072a0d0b8c18595..e05a0fb840ed5acbf98318d805de76bab0025519 100644 (file)
@@ -263,7 +263,6 @@ typedef struct { /* php_oci_out_column {{{ */
 #define PHP_OCI_REGISTER_RESOURCE(resource, le_resource) \
        do { \
                resource->id = ZEND_REGISTER_RESOURCE(NULL, resource, le_resource); \
-               zend_list_addref(resource->connection->rsrc_id); \
        } while (0)
 
 #define PHP_OCI_ZVAL_TO_CONNECTION(zval, connection) \