@@ -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-
12771219static int _php_ibase_var_zval (zval * val , void * data , int type , int len , /* {{{ */
12781220 int scale , size_t flag )
12791221{
0 commit comments