diff options
Diffstat (limited to 'ext/oci8/oci8_statement.c')
-rw-r--r-- | ext/oci8/oci8_statement.c | 183 |
1 files changed, 90 insertions, 93 deletions
diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index 7dc0d5ee66..f651925170 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -43,7 +43,7 @@ /* {{{ php_oci_statement_create() Create statemend handle and allocate necessary resources */ -php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len TSRMLS_DC) +php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len) { php_oci_statement *statement; sword errstatus; @@ -80,7 +80,7 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char #endif /* HAVE_OCI8_DTRACE */ if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, errstatus); PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, OCI_STRLS_CACHE_DELETE)); PHP_OCI_CALL(OCIHandleFree,(statement->err, OCI_HTYPE_ERROR)); @@ -109,9 +109,9 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char ++GC_REFCOUNT(statement->connection->id); if (OCI_G(default_prefetch) >= 0) { - php_oci_statement_set_prefetch(statement, (ub4)OCI_G(default_prefetch) TSRMLS_CC); + php_oci_statement_set_prefetch(statement, (ub4)OCI_G(default_prefetch)); } else { - php_oci_statement_set_prefetch(statement, (ub4)100 TSRMLS_CC); /* semi-arbitrary, "sensible default" */ + php_oci_statement_set_prefetch(statement, (ub4)100); /* semi-arbitrary, "sensible default" */ } PHP_OCI_REGISTER_RESOURCE(statement, le_statement); @@ -124,10 +124,10 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char /* {{{ php_oci_get_implicit_resultset() Fetch implicit result set statement resource */ -php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement TSRMLS_DC) +php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement) { #if (OCI_MAJOR_VERSION < 12) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Implicit results are available in Oracle Database 12c onwards"); + php_error_docref(NULL, E_WARNING, "Implicit results are available in Oracle Database 12c onwards"); return NULL; #else void *result; @@ -142,7 +142,7 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement T if (rtype != OCI_RESULT_TYPE_SELECT) { /* Only OCI_RESULT_TYPE_SELECT is supported by Oracle DB 12cR1 */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected implicit result type returned from Oracle Database"); + php_error_docref(NULL, E_WARNING, "Unexpected implicit result type returned from Oracle Database"); return NULL; } else { statement2 = ecalloc(1,sizeof(php_oci_statement)); @@ -169,7 +169,7 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement T Z_ADDREF_P(statement->id); Z_ADDREF_P(statement2->connection->id); - php_oci_statement_set_prefetch(statement2, statement->prefetch_count TSRMLS_CC); + php_oci_statement_set_prefetch(statement2, statement->prefetch_count); PHP_OCI_REGISTER_RESOURCE(statement2, le_statement); @@ -183,7 +183,7 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement T /* {{{ php_oci_statement_set_prefetch() Set prefetch buffer size for the statement */ -int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch TSRMLS_DC) +int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch ) { sword errstatus; @@ -194,7 +194,7 @@ int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch T PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, (statement->stmt, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, statement->err)); if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); statement->prefetch_count = 0; return 1; @@ -207,7 +207,7 @@ int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch T /* {{{ php_oci_cleanup_pre_fetch() Helper function to cleanup ref-cursors and descriptors from the previous row */ -int php_oci_cleanup_pre_fetch(void *data TSRMLS_DC) +int php_oci_cleanup_pre_fetch(void *data) { php_oci_out_column *outcol = data; @@ -241,7 +241,7 @@ int php_oci_cleanup_pre_fetch(void *data TSRMLS_DC) /* {{{ php_oci_statement_fetch() Fetch a row from the statement */ -int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) +int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows) { int i; void *handlepp; @@ -254,7 +254,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ if (statement->has_descr && statement->columns) { - zend_hash_apply(statement->columns, (apply_func_t) php_oci_cleanup_pre_fetch TSRMLS_CC); + zend_hash_apply(statement->columns, (apply_func_t) php_oci_cleanup_pre_fetch); } PHP_OCI_CALL_RETURN(errstatus, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT)); @@ -282,7 +282,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) /* reset length for all piecewise columns */ for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL, 0); if (column && column->piecewise) { column->retlen4 = 0; piecewisecols = 1; @@ -307,7 +307,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) /* scan through our columns for a piecewise column with a matching handle */ for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL, 0); if (column && column->piecewise && handlepp == column->oci_define) { if (!column->data) { column->data = (text *) ecalloc(1, PHP_OCI_PIECE_SIZE + 1); @@ -337,7 +337,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) if (piecewisecols) { for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL, 0); if (column && column->piecewise && handlepp == column->oci_define) { column->retlen4 += column->cb_retlen; } @@ -350,7 +350,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) /* do the stuff needed for OCIDefineByName */ for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL, 0); if (column == NULL) { continue; } @@ -360,13 +360,13 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) } zval_dtor(&column->define->zval); - php_oci_column_to_zval(column, &column->define->zval, 0 TSRMLS_CC); + php_oci_column_to_zval(column, &column->define->zval, 0); } return 0; } - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); statement->has_data = 0; @@ -377,7 +377,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) /* {{{ php_oci_statement_get_column() Get column from the result set */ -php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len TSRMLS_DC) +php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len) { php_oci_out_column *column = NULL; int i; @@ -388,7 +388,7 @@ php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, z if (column_name) { for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL, 0); if (column == NULL) { continue; } else if (((int) column->name_len == column_name_len) && (!strncmp(column->name, column_name, column_name_len))) { @@ -410,11 +410,10 @@ php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, z sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcpp) { php_oci_out_column *outcol = (php_oci_out_column *)ctx; - TSRMLS_FETCH(); if (!outcol) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid context pointer value"); + php_error_docref(NULL, E_WARNING, "Invalid context pointer value"); return OCI_ERROR; } @@ -422,7 +421,7 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf case SQLT_RSET: { php_oci_statement *nested_stmt; - nested_stmt = php_oci_statement_create(outcol->statement->connection, NULL, 0 TSRMLS_CC); + nested_stmt = php_oci_statement_create(outcol->statement->connection, NULL, 0); if (!nested_stmt) { return OCI_ERROR; } @@ -454,7 +453,7 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf dtype = OCI_DTYPE_LOB; } - descr = php_oci_lob_create(outcol->statement->connection, dtype TSRMLS_CC); + descr = php_oci_lob_create(outcol->statement->connection, dtype); if (!descr) { return OCI_ERROR; } @@ -477,7 +476,7 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf /* {{{ php_oci_statement_execute() Execute statement */ -int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) +int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) { php_oci_out_column *outcol; php_oci_out_column column; @@ -503,7 +502,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) #endif /* HAVE_OCI8_DTRACE */ break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid execute mode given: %d", mode); + php_error_docref(NULL, E_WARNING, "Invalid execute mode given: %d", mode); return 1; break; } @@ -513,7 +512,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement->stmttype, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } else { @@ -531,7 +530,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) if (statement->binds) { int result = 0; - zend_hash_apply_with_argument(statement->binds, (apply_func_arg_t) php_oci_bind_pre_exec, (void *)&result TSRMLS_CC); + zend_hash_apply_with_argument(statement->binds, (apply_func_arg_t) php_oci_bind_pre_exec, (void *)&result); if (result) { return 1; } @@ -541,13 +540,13 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) PHP_OCI_CALL_RETURN(errstatus, OCIStmtExecute, (statement->connection->svc, statement->stmt, statement->err, iters, 0, NULL, NULL, mode)); if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } if (statement->binds) { - zend_hash_apply(statement->binds, (apply_func_t) php_oci_bind_post_exec TSRMLS_CC); + zend_hash_apply(statement->binds, (apply_func_t) php_oci_bind_post_exec); } if (mode & OCI_COMMIT_ON_SUCCESS) { @@ -580,7 +579,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *)&colcount, (ub4 *)0, OCI_ATTR_PARAM_COUNT, statement->err)); if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -600,7 +599,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) PHP_OCI_CALL_RETURN(errstatus, OCIParamGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)¶m, counter)); if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -610,7 +609,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -620,7 +619,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -630,7 +629,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -640,7 +639,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -653,7 +652,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -663,7 +662,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -673,7 +672,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -808,7 +807,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) } if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -831,7 +830,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) ); if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -847,15 +846,15 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) /* {{{ php_oci_statement_cancel() Cancel statement */ -int php_oci_statement_cancel(php_oci_statement *statement TSRMLS_DC) +int php_oci_statement_cancel(php_oci_statement *statement) { - return php_oci_statement_fetch(statement, 0 TSRMLS_CC); + return php_oci_statement_fetch(statement, 0); } /* }}} */ /* {{{ php_oci_statement_free() Destroy statement handle and free associated resources */ -void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC) +void php_oci_statement_free(php_oci_statement *statement) { if (statement->stmt) { if (statement->last_query_len) { /* FIXME: magical */ @@ -903,7 +902,7 @@ void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC) /* {{{ php_oci_bind_pre_exec() Helper function */ -int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC) +int php_oci_bind_pre_exec(void *data, void *result) { php_oci_bind *bind = (php_oci_bind *) data; @@ -924,7 +923,7 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC) case SQLT_BLOB: case SQLT_RDD: if (Z_TYPE(bind->zval) != IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind"); + php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); *(int *)result = 1; } break; @@ -940,14 +939,14 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC) case SQLT_BIN: case SQLT_LNG: if (Z_TYPE(bind->zval) == IS_RESOURCE || Z_TYPE(bind->zval) == IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind"); + php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); *(int *)result = 1; } break; case SQLT_RSET: if (Z_TYPE(bind->zval) != IS_RESOURCE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind"); + php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); *(int *)result = 1; } break; @@ -962,7 +961,7 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC) /* {{{ php_oci_bind_post_exec() Helper function */ -int php_oci_bind_post_exec(void *data TSRMLS_DC) +int php_oci_bind_post_exec(void *data) { php_oci_bind *bind = (php_oci_bind *) data; php_oci_connection *connection = bind->parent_statement->connection; @@ -1030,7 +1029,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) zval_dtor(entry); if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, errstatus); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); ZVAL_NULL(entry); } else { @@ -1041,7 +1040,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) } else { PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, errstatus); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); add_next_index_null(&bind->zval); } else { @@ -1079,7 +1078,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) /* {{{ php_oci_bind_by_name() Bind zval to the given placeholder */ -int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type TSRMLS_DC) +int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type) { php_oci_collection *bind_collection = NULL; php_oci_descriptor *bind_descriptor = NULL; @@ -1099,7 +1098,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *tmp; if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(var), "collection", sizeof("collection"))) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); + php_error_docref(NULL, E_WARNING, "Unable to find collection property"); return 1; } @@ -1121,7 +1120,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *tmp; if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(var), "descriptor", sizeof("descriptor"))) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); + php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); return 1; } @@ -1140,7 +1139,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, case SQLT_INT: case SQLT_NUM: if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind"); + php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); return 1; } convert_to_long(var); @@ -1155,7 +1154,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, case SQLT_AFC: case SQLT_CHR: /* SQLT_CHR is the default value when type was not specified */ if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind"); + php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); return 1; } if (Z_TYPE_P(var) != IS_NULL) { @@ -1170,7 +1169,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, case SQLT_RSET: if (Z_TYPE_P(var) != IS_RESOURCE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind"); + php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); return 1; } PHP_OCI_ZVAL_TO_STATEMENT_EX(var, bind_statement); @@ -1186,7 +1185,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, #if defined(OCI_MAJOR_VERSION) && OCI_MAJOR_VERSION >= 12 case SQLT_BOL: if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind"); + php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); return 1; } convert_to_boolean(var); @@ -1198,7 +1197,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, #endif default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: %d", (int)type); + php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: %d", (int)type); return 1; break; } @@ -1248,7 +1247,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, ); if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -1266,7 +1265,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, ); if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -1287,7 +1286,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, ); if (errstatus) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -1312,10 +1311,9 @@ sb4 php_oci_bind_in_callback( { php_oci_bind *phpbind; zval *val; - TSRMLS_FETCH(); if (!(phpbind=(php_oci_bind *)ictxp) || !(val = &phpbind->zval)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value"); + php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value"); return OCI_ERROR; } @@ -1366,10 +1364,9 @@ sb4 php_oci_bind_out_callback( php_oci_bind *phpbind; zval *val; sb4 retval = OCI_ERROR; - TSRMLS_FETCH(); if (!(phpbind=(php_oci_bind *)octxp) || !(val = &phpbind->zval)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value"); + php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value"); return retval; } @@ -1396,7 +1393,7 @@ sb4 php_oci_bind_out_callback( * binds (Bug #46994). */ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(val), "descriptor", sizeof("descriptor"))) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find object outbind descriptor property"); + php_error_docref(NULL, E_WARNING, "Unable to find object outbind descriptor property"); return OCI_ERROR; } PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(tmp, desc); @@ -1438,11 +1435,11 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME php_oci_statement *statement; php_oci_out_column *column; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &z_statement, &column_index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &z_statement, &column_index) == FAILURE) { return NULL; } - statement = (php_oci_statement *) zend_fetch_resource(z_statement TSRMLS_CC, -1, "oci8 statement", NULL, 1, le_statement); + statement = (php_oci_statement *) zend_fetch_resource(z_statement, -1, "oci8 statement", NULL, 1, le_statement); if (!statement) { return NULL; @@ -1453,9 +1450,9 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME } if (Z_TYPE_P(column_index) == IS_STRING) { - column = php_oci_statement_get_column(statement, -1, Z_STRVAL_P(column_index), Z_STRLEN_P(column_index) TSRMLS_CC); + column = php_oci_statement_get_column(statement, -1, Z_STRVAL_P(column_index), Z_STRLEN_P(column_index)); if (!column) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_P(column_index)); + php_error_docref(NULL, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_P(column_index)); return NULL; } } else { @@ -1464,9 +1461,9 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME tmp = *column_index; zval_copy_ctor(&tmp); convert_to_long(&tmp); - column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0); if (!column) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%pd\"", Z_LVAL(tmp)); + php_error_docref(NULL, E_WARNING, "Invalid column index \"%pd\"", Z_LVAL(tmp)); zval_dtor(&tmp); return NULL; } @@ -1478,7 +1475,7 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME /* {{{ php_oci_statement_get_type() Return type of the statement */ -int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC) +int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type) { ub2 statement_type; sword errstatus; @@ -1488,7 +1485,7 @@ int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement_type, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -1501,7 +1498,7 @@ int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC /* {{{ php_oci_statement_get_numrows() Get the number of rows fetched to the clientside (NOT the number of rows in the result set) */ -int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSRMLS_DC) +int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows) { ub4 statement_numrows; sword errstatus; @@ -1511,7 +1508,7 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSR PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub4 *)&statement_numrows, (ub4 *)0, OCI_ATTR_ROW_COUNT, statement->err)); if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -1524,7 +1521,7 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSR /* {{{ php_oci_bind_array_by_name() Bind arrays to PL/SQL types */ -int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type TSRMLS_DC) +int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type) { php_oci_bind *bind, *bindp; sword errstatus; @@ -1532,7 +1529,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam convert_to_array(var); if (maxlength < -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid max length value (%pd)", maxlength); + php_error_docref(NULL, E_WARNING, "Invalid max length value (%pd)", maxlength); return 1; } @@ -1540,11 +1537,11 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam case SQLT_NUM: case SQLT_INT: case SQLT_LNG: - bind = php_oci_bind_array_helper_number(var, max_table_length TSRMLS_CC); + bind = php_oci_bind_array_helper_number(var, max_table_length); break; case SQLT_FLT: - bind = php_oci_bind_array_helper_double(var, max_table_length TSRMLS_CC); + bind = php_oci_bind_array_helper_double(var, max_table_length); break; case SQLT_AFC: @@ -1554,16 +1551,16 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam case SQLT_STR: case SQLT_LVC: if (maxlength == -1 && zend_hash_num_elements(Z_ARRVAL_P(var)) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must provide max length value for empty arrays"); + php_error_docref(NULL, E_WARNING, "You must provide max length value for empty arrays"); return 1; } - bind = php_oci_bind_array_helper_string(var, max_table_length, maxlength TSRMLS_CC); + bind = php_oci_bind_array_helper_string(var, max_table_length, maxlength); break; case SQLT_ODT: - bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection TSRMLS_CC); + bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: %pd", type); + php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: %pd", type); return 1; break; } @@ -1614,7 +1611,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam if (errstatus != OCI_SUCCESS) { efree(bind); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -1626,7 +1623,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam /* {{{ php_oci_bind_array_helper_string() Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength TSRMLS_DC) +php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength) { php_oci_bind *bind; ub4 i; @@ -1696,7 +1693,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le /* {{{ php_oci_bind_array_helper_number() Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length TSRMLS_DC) +php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length) { php_oci_bind *bind; ub4 i; @@ -1735,7 +1732,7 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le /* {{{ php_oci_bind_array_helper_double() Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length TSRMLS_DC) +php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length) { php_oci_bind *bind; ub4 i; @@ -1774,7 +1771,7 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_le /* {{{ php_oci_bind_array_helper_date() Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection TSRMLS_DC) +php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection) { php_oci_bind *bind; ub4 i; @@ -1809,7 +1806,7 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng efree(bind->array.element_lengths); efree(bind->array.elements); efree(bind); - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, errstatus); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return NULL; } @@ -1824,7 +1821,7 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng efree(bind->array.element_lengths); efree(bind->array.elements); efree(bind); - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, errstatus); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return NULL; } |