Browse files

MFH: fix #42134 (oci_error() returns false after oci_new_collection()…

… fails)
  • Loading branch information...
1 parent 10fabe9 commit 9efa1d891401aa57685c20fae35f218e2097ea88 @tony2001 tony2001 committed Jul 31, 2007
Showing with 52 additions and 4 deletions.
  1. +2 −0 NEWS
  2. +9 −0 ext/oci8/oci8.c
  3. +11 −1 ext/oci8/oci8_collection.c
  4. +9 −0 ext/oci8/oci8_interface.c
  5. +11 −2 ext/oci8/oci8_lob.c
  6. +10 −0 ext/oci8/oci8_statement.c
  7. +0 −1 ext/oci8/php_oci8_int.h
View
2 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)
View
9 ext/oci8/oci8.c
@@ -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
+ */
View
12 ext/oci8/oci8_collection.c
@@ -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
+ */
View
9 ext/oci8/oci8_interface.c
@@ -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
+ */
View
13 ext/oci8/oci8_lob.c
@@ -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
+ */
View
10 ext/oci8/oci8_statement.c
@@ -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
+ */
View
1 ext/oci8/php_oci8_int.h
@@ -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) \

0 comments on commit 9efa1d8

Please sign in to comment.