summaryrefslogtreecommitdiff
path: root/ext/oci8/oci8.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/oci8/oci8.c')
-rw-r--r--ext/oci8/oci8.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 74c72d7bd9..63fb334c99 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -1454,8 +1454,13 @@ void php_oci_column_hash_dtor(zval *data)
if (column->descid) {
if (GC_REFCOUNT(column->descid) == 1)
zend_list_close(column->descid);
- else
+ else {
+#if PHP_VERSION_ID < 70300
+ GC_REFCOUNT(column->descid)--;
+#else
GC_DELREF(column->descid);
+#endif
+ }
}
if (column->data) {
@@ -1877,7 +1882,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
(memcmp(ZSTR_VAL(tmp->hash_key), ZSTR_VAL(hashed_details.s),
ZSTR_LEN(tmp->hash_key)) == 0)) {
connection = tmp;
+#if PHP_VERSION_ID < 70300
+ ++GC_REFCOUNT(connection->id);
+#else
GC_ADDREF(connection->id);
+#endif
}
} else {
PHP_OCI_REGISTER_RESOURCE(connection, le_pconnection);
@@ -1887,7 +1896,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* decremented in the persistent helper
*/
if (OCI_G(old_oci_close_semantics)) {
+#if PHP_VERSION_ID < 70300
+ ++GC_REFCOUNT(connection->id);
+#else
GC_ADDREF(connection->id);
+#endif
}
}
smart_str_free(&hashed_details);
@@ -1898,7 +1911,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
} else {
/* we do not ping non-persistent connections */
smart_str_free(&hashed_details);
+#if PHP_VERSION_ID < 70300
+ ++GC_REFCOUNT(connection->id);
+#else
GC_ADDREF(connection->id);
+#endif
return connection;
}
} /* is_open is true? */
@@ -2052,7 +2069,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* refcount is decremented in the persistent helper
*/
if (OCI_G(old_oci_close_semantics)) {
+#if PHP_VERSION_ID < 70300
+ ++GC_REFCOUNT(connection->id);
+#else
GC_ADDREF(connection->id);
+#endif
}
#if PHP_VERSION_ID < 70300
zend_hash_update_mem(&EG(persistent_list), connection->hash_key, (void *)&new_le, sizeof(zend_resource));
@@ -2453,7 +2474,11 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode)
if (column->is_cursor) { /* REFCURSOR -> simply return the statement id */
ZVAL_RES(value, column->stmtid);
+#if PHP_VERSION_ID < 70300
+ ++GC_REFCOUNT(column->stmtid);
+#else
GC_ADDREF(column->stmtid);
+#endif
} else if (column->is_descr) {
if (column->data_type != SQLT_RDD) {
@@ -2497,7 +2522,11 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode)
/* return the locator */
object_init_ex(value, oci_lob_class_entry_ptr);
add_property_resource(value, "descriptor", column->descid);
+#if PHP_VERSION_ID < 70300
+ ++GC_REFCOUNT(column->descid);
+#else
GC_ADDREF(column->descid);
+#endif
}
} else {
switch (column->retcode) {