Logo Search packages:      
Sourcecode: freetds version File versions

TDS_INT tds_process_end ( TDSSOCKET *  tds,
int  marker,
int *  flags_parm 
)

tds_process_end() processes any of the DONE, DONEPROC, or DONEINPROC tokens.

Parameters:
marker TDS token number
flags_parm filled with bit flags (see TDS_DONE_ constants). Is NULL nothing is returned

Definition at line 1480 of file token.c.

References tds_get_int(), tds_get_smallint(), and tds_process_end().

Referenced by tds_process_cancel(), tds_process_default_tokens(), tds_process_end(), tds_process_result_tokens(), and tds_process_row_tokens().

{
int more_results, was_cancelled, error;
int tmp;

      tmp = tds_get_smallint(tds);

      more_results = (tmp & TDS_DONE_MORE_RESULTS) != 0;
      was_cancelled = (tmp & TDS_DONE_CANCELLED) != 0;
      error = (tmp & TDS_DONE_ERROR) != 0;


      tdsdump_log(TDS_DBG_FUNC, "%L inside tds_process_end() more_results = %d, was_cancelled = %d \n",
                more_results, was_cancelled);
      if (tds->res_info) {
            tds->res_info->more_results = more_results;
      }

      if (flags_parm)
            *flags_parm = tmp;

      if (was_cancelled || !(more_results)) {
            tds->state = TDS_COMPLETED;
      }

      tds_get_smallint(tds);

      /* rows affected is in the tds struct because a query may affect rows but
       * have no result set. */

      tds->rows_affected = tds_get_int(tds);

      if (error)
            return TDS_FAIL;
      else
            return TDS_SUCCEED;
}


Generated by  Doxygen 1.6.0   Back to index