Skip to content

Commit 03dc505

Browse files
committed
Refactor ibase_name_result()
1 parent 91c72df commit 03dc505

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ibase_query.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,25 +1731,27 @@ PHP_FUNCTION(ibase_name_result)
17311731
zval *result_arg;
17321732
char *name_arg;
17331733
size_t name_arg_len;
1734-
ibase_result *ib_result;
1734+
ibase_query *ib_query;
17351735

17361736
RESET_ERRMSG;
17371737

17381738
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &result_arg, &name_arg, &name_arg_len) == FAILURE) {
17391739
return;
17401740
}
17411741

1742-
ib_result = (ibase_result *)zend_fetch_resource_ex(result_arg, LE_RESULT, le_result);
1742+
if(_php_ibase_fetch_query_res(result_arg, &ib_query)) {
1743+
return;
1744+
}
17431745

1744-
if (isc_dsql_set_cursor_name(IB_STATUS, &ib_result->stmt, name_arg, 0)) {
1746+
if (isc_dsql_set_cursor_name(IB_STATUS, &ib_query->stmt, name_arg, 0)) {
17451747
_php_ibase_error();
17461748
RETURN_FALSE;
17471749
}
1750+
17481751
RETURN_TRUE;
17491752
}
17501753
/* }}} */
17511754

1752-
17531755
/* {{{ proto bool ibase_free_result(resource result)
17541756
Free the memory used by a result */
17551757
PHP_FUNCTION(ibase_free_result)

0 commit comments

Comments
 (0)