Skip to Content.
Sympa Menu

freetds - RE: [freetds] ctlib - Stored Proc Return Status

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <bill_d_thompson AT ml.com>
  • To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] ctlib - Stored Proc Return Status
  • Date: Thu, 29 Jan 2004 10:34:06 -0000

Iain,

thanks for the bug report. Your findings look valid to me.

I think we should save tds->ret_status before calling tds_free_all_results
etc, then use the saved value in the last statement of
_ct_process_return_status instead of tds->ret_status.

so....

_ct_process_return_status(TDSSOCKET * tds)
{
TDSRESULTINFO *info;
TDSCOLINFO *curcol;

+ TDS_INT saved_status;

enum
{ num_cols = 1 };


assert(tds);

+ saved_status = tds->ret_status;

tds_free_all_results(tds);

....

- *(TDS_INT *) (info->current_row + curcol->column_offset) =
tds->ret_status;
+ *(TDS_INT *) (info->current_row + curcol->column_offset) = saved_status;

return TDS_SUCCEED;
}


Can you do this fix locally and confirm the results ?

thanks,

Bill


> -----Original Message-----
> From: iain.calder AT blueyonder.co.uk [SMTP:iain.calder AT blueyonder.co.uk]
> Sent: 29 January 2004 09:41
> To: freetds AT lists.ibiblio.org
> Subject: [freetds] ctlib - Stored Proc Return Status
>
> Problem: Stored procedure return values obtained when the result type is
> CS_STATUS_RESULT are always 0
>
> Looking in ct.c _ct_process_return_status() initially calls
> tds_free_all_results(tds) which sets tds->ret_status to 0.
>
> What's the correct fix here - is it to take a copy of tds->ret_status
> before calling tds_free_all_results(), or should
> _ct_process_return_status() call tds_free_results() instead of
> tds_free_all_results()?
>
> Iain
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds





Archive powered by MHonArc 2.6.24.

Top of Page