Skip to content

Commit 5c7e20d

Browse files
committed
Cleanup: remove #if abies_0 (#76)
ibase_num_rows() prototype
1 parent a259d9c commit 5c7e20d

File tree

3 files changed

+0
-73
lines changed

3 files changed

+0
-73
lines changed

ibase_query.c

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,64 +1216,6 @@ PHP_FUNCTION(ibase_affected_rows)
12161216
}
12171217
/* }}} */
12181218

1219-
/* {{{ proto int ibase_num_rows( resource result_identifier )
1220-
Return the number of rows that are available in a result */
1221-
#if abies_0
1222-
PHP_FUNCTION(ibase_num_rows)
1223-
{
1224-
/**
1225-
* As this function relies on the InterBase API function isc_dsql_sql_info()
1226-
* which has a couple of limitations (which I hope will be fixed in future
1227-
* releases of Firebird), this function is fairly useless. I'm leaving it
1228-
* in place for people who can live with the limitations, which I only
1229-
* found out about after I had implemented it anyway.
1230-
*
1231-
* Currently, there's no way to determine how many rows can be fetched from
1232-
* a cursor. The only number that _can_ be determined is the number of rows
1233-
* that have already been pre-fetched by the client library.
1234-
* This implies the following:
1235-
* - num_rows() always returns zero before the first fetch;
1236-
* - num_rows() for SELECT ... FOR UPDATE is broken -> never returns a
1237-
* higher number than the number of records fetched so far (no pre-fetch);
1238-
* - the result of num_rows() for other statements is merely a lower bound
1239-
* on the number of records => calling ibase_num_rows() again after a couple
1240-
* of fetches will most likely return a new (higher) figure for large result
1241-
* sets.
1242-
*/
1243-
1244-
zval *result_arg;
1245-
ibase_result *ib_result;
1246-
static char info_count[] = {isc_info_sql_records};
1247-
char result[64];
1248-
1249-
RESET_ERRMSG;
1250-
1251-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result_arg) == FAILURE) {
1252-
return;
1253-
}
1254-
1255-
ib_result = (ibase_result *)zend_fetch_resource_ex(&result_arg, LE_RESULT, le_result);
1256-
1257-
if (isc_dsql_sql_info(IB_STATUS, &ib_result->stmt, sizeof(info_count), info_count, sizeof(result), result)) {
1258-
_php_ibase_error();
1259-
RETURN_FALSE;
1260-
}
1261-
1262-
if (result[0] == isc_info_sql_records) {
1263-
unsigned i = 3, result_size = isc_vax_integer(&result[1],2);
1264-
1265-
while (result[i] != isc_info_end && i < result_size) {
1266-
short len = (short)isc_vax_integer(&result[i+1],2);
1267-
if (result[i] == isc_info_req_select_count) {
1268-
RETURN_LONG(isc_vax_integer(&result[i+3],len));
1269-
}
1270-
i += len+3;
1271-
}
1272-
}
1273-
}
1274-
#endif
1275-
/* }}} */
1276-
12771219
static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{ */
12781220
int scale, size_t flag)
12791221
{

interbase.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_affected_rows, 0, 0, 0)
168168
ZEND_ARG_INFO(0, link_identifier)
169169
ZEND_END_ARG_INFO()
170170

171-
#if abies_0
172-
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_num_rows, 0, 0, 1)
173-
ZEND_ARG_INFO(0, result_identifier)
174-
ZEND_END_ARG_INFO()
175-
#endif
176-
177171
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_fetch_row, 0, 0, 1)
178172
ZEND_ARG_INFO(0, result)
179173
ZEND_ARG_INFO(0, fetch_flags)
@@ -341,9 +335,6 @@ static const zend_function_entry ibase_functions[] = {
341335
PHP_FE(ibase_gen_id, arginfo_ibase_gen_id)
342336
PHP_FE(ibase_num_fields, arginfo_ibase_num_fields)
343337
PHP_FE(ibase_num_params, arginfo_ibase_num_params)
344-
#if abies_0
345-
PHP_FE(ibase_num_rows, arginfo_ibase_num_rows)
346-
#endif
347338
PHP_FE(ibase_affected_rows, arginfo_ibase_affected_rows)
348339
PHP_FE(ibase_field_info, arginfo_ibase_field_info)
349340
PHP_FE(ibase_param_info, arginfo_ibase_param_info)
@@ -407,9 +398,6 @@ static const zend_function_entry ibase_functions[] = {
407398
PHP_FALIAS(fbird_gen_id, ibase_gen_id, arginfo_ibase_gen_id)
408399
PHP_FALIAS(fbird_num_fields, ibase_num_fields, arginfo_ibase_num_fields)
409400
PHP_FALIAS(fbird_num_params, ibase_num_params, arginfo_ibase_num_params)
410-
#if abies_0
411-
PHP_FALIAS(fbird_num_rows, ibase_num_rows, arginfo_ibase_num_rows)
412-
#endif
413401
PHP_FALIAS(fbird_affected_rows, ibase_affected_rows, arginfo_ibase_affected_rows)
414402
PHP_FALIAS(fbird_field_info, ibase_field_info, arginfo_ibase_field_info)
415403
PHP_FALIAS(fbird_param_info, ibase_param_info, arginfo_ibase_param_info)

php_interbase.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ PHP_FUNCTION(ibase_timefmt);
7777
PHP_FUNCTION(ibase_gen_id);
7878
PHP_FUNCTION(ibase_num_fields);
7979
PHP_FUNCTION(ibase_num_params);
80-
#if abies_0
81-
PHP_FUNCTION(ibase_num_rows);
82-
#endif
8380
PHP_FUNCTION(ibase_affected_rows);
8481
PHP_FUNCTION(ibase_field_info);
8582
PHP_FUNCTION(ibase_param_info);

0 commit comments

Comments
 (0)