Skip to Content.
Sympa Menu

freetds - RE: [freetds] Strange code

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO Frediano" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Strange code
  • Date: Tue, 4 Nov 2003 12:32:08 +0100

>
> Understood, and I think I agree.
>
>
> Would the following work for you (provided you adjust the
> SQLExecute code a
> bit :-)
>
> in tds_process_result_tokens :
>
> case TDS_DONE_TOKEN:
> tds_process_end(tds, marker, done_flags);
> *result_type = TDS_DONE_RESULT;
> return TDS_SUCCEED;
>
> case TDS_DONEPROC_TOKEN:
> tds_process_end(tds, marker, done_flags);
> if (tds->internal_sp_called) {
> *result_type = TDS_NO_MORE_RESULTS
> return TDS_NO_MORE_RESULTS;
> } else {
> *result_type = TDS_DONEPROC_RESULT;
> return TDS_SUCCEED;
> }
>
> case TDS_DONEINPROC_TOKEN:
> tds_process_end(tds, marker, done_flags);
> if (tds->internal_sp_called) {
> *result_type = TDS_DONE_RESULT;
> } else {
> *result_type = TDS_DONEINPROC_RESULT;
> }
> return TDS_SUCCEED;
> break;
>
> so you would hopefully get :
>
> TDS_ROWFMT_RESULT first recordset with column information
> TDS_DONE_RESULT 0 rows returned from first recordset
> TDS_ROWFMT_RESULT second recordset with column information
> TDS_DONE_RESULT 0 rows returned from second recordset
> TDS_NO_MORE_RESULTS
>
> returned from tds_process_result_tokens(), which would be the
> same results
> as from a straightforward language string query, I think....
>
> Bill
>

Yes and not... I want MS ODBC compatibility in recordset handling but
this require handling DONEINPROC in a different way from DONE...
All DONE tokens are returned to client however DONEINPROC are not
returned if there are no rows... (I can't escape from my tests :) )

Changing your code to

case TDS_DONEINPROC_TOKEN:
tds_process_end(tds, marker, done_flags);
*result_type = TDS_DONEINPROC_RESULT;
return TDS_SUCCEED;
break;

Fix all issues... (I don't know yours...).

Previous patch do not contain this change.

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page