Skip to Content.
Sympa Menu

freetds - RE: [freetds] Status: bcp

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] Status: bcp
  • Date: Fri, 19 Dec 2003 15:13:55 +0100

>
> Some more...
>
> > I'm guessing therefore that some of our code is now more
> sensitive to
> > the TDS_DEAD state than it used to be.
>
> Indeed....it's this check that stops the program in it's
> tracks after generating the "batch success..." message
>
> static int
> tds_to_quering(TDSSOCKET * tds)
> {
> if (tds->state == TDS_DEAD) {
> tds_client_msg(tds->tds_ctx, tds, 20006, 9, 0, 0,
> "Write to SQL Server failed. ");
> return TDS_FAIL;
>
>
> Bill
>

The problem is: what do we mean with TDS_DEAD? IMO TDS_DEAD means that
server close connection so it's normal that trying sending a query
libTDS fails...

There are some comments in tds_client_msg

/*
* error handler may return:
* INT_EXIT -- Print an error message, and exit
application, . returning an error to the OS.
* INT_CANCEL -- Return FAIL to the db-lib function that
caused the error.
* For SQLETIME errors only, call dbcancel() to try to
cancel the current command batch
* and flush any pending results. Break the
connection if dbcancel() times out,
* INT_CONTINUE -- For SQLETIME, wait for one additional
time-out period, then call the error handler again.
* Else treat as INT_CANCEL.
*/

and

/* message handler returned FAIL/CS_FAIL
* mark socket as dead */


Which one is the correct one? err_handler is libTDS, not dblib so it
shouldn't return db-lib result (INT_EXIT, INT_CANCEL, INT_CONTINUE)...
dblib_handle_err_message returns SUCCEED/FAIL codes... err_handler
should return TDS_SUCCEED/TDS_FAIL and tds_client_msg should check ret
== TDS_FAIL (or ret != TDS_SUCCEED), not ret (that means if succeed set
state to DEAD... I don't understand why code worked...).

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page