summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-07-31 19:21:08 +0000
committerAntony Dovgal <tony2001@php.net>2007-07-31 19:21:08 +0000
commit9efa1d891401aa57685c20fae35f218e2097ea88 (patch)
treedd68ffaaf96c131f885f65a02a5027bdb9613332
parent10fabe9092ca7f2543fdeddb9a46fabdf3fc8014 (diff)
downloadphp-git-9efa1d891401aa57685c20fae35f218e2097ea88.tar.gz
MFH: fix #42134 (oci_error() returns false after oci_new_collection() fails)
-rw-r--r--NEWS2
-rw-r--r--ext/oci8/oci8.c9
-rw-r--r--ext/oci8/oci8_collection.c12
-rw-r--r--ext/oci8/oci8_interface.c9
-rw-r--r--ext/oci8/oci8_lob.c13
-rw-r--r--ext/oci8/oci8_statement.c10
-rw-r--r--ext/oci8/php_oci8_int.h1
7 files changed, 52 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index d9bbd4807d..48a613e9a7 100644
--- 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)
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 04d4f42a56..5fb8f9ff7e 100644
--- a/ext/oci8/oci8.c
+++ b/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
+ */
diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c
index ed9037af78..dabd90eeac 100644
--- a/ext/oci8/oci8_collection.c
+++ b/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
+ */
diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c
index 427a88b7ec..009ef4d153 100644
--- a/ext/oci8/oci8_interface.c
+++ b/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
+ */
diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c
index 470b3b4488..9a93ac4e8d 100644
--- a/ext/oci8/oci8_lob.c
+++ b/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
+ */
diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c
index 947d7a2978..fa592bc025 100644
--- a/ext/oci8/oci8_statement.c
+++ b/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
+ */
diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h
index 8aacac9cac..e05a0fb840 100644
--- a/ext/oci8/php_oci8_int.h
+++ b/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) \