freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Frediano Ziglio <freddyz77 AT tin.it>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] TDS+ODBC 'not in service' patch
- Date: Thu, 14 Aug 2003 21:09:47 -0000
Il gio, 2003-08-14 alle 00:04, Peter Deacon ha scritto:
> This one mostly fixes problems where connections drops while
> processing results.
>
> It doesen't cover all possible situtations. Added as many as reasonable
> to catch the situations I wanted and put a catch-most in read_packet.
>
> Used sql server kill to axe the spid running a slow test query to
> simulate a dropped connection.
>
> take care,
> Peter
Hi Peter!
At usually very nice patch... applied!
However I rejected a small part (sqlstate handling, attached) cause it
cause a core and cause it mixed client and server messages.
freddy77
Index: src/tds/mem.c =================================================================== RCS file: /cvsroot/freetds/freetds/src/tds/mem.c,v retrieving revision 1.91 diff -u -u -1 -0 -b -r1.91 mem.c --- src/tds/mem.c 6 Aug 2003 19:32:46 -0000 1.91 +++ src/tds/mem.c 14 Aug 2003 21:06:18 -0000 @@ -826,20 +826,23 @@ tds_alloc_lookup_sqlstate(TDSSOCKET * tds, int msgnum) { const char *p = NULL; char *q = NULL; if (TDS_IS_MSSQL(tds)) { switch (msgnum) { /* MSSQL Server */ SQLS_ENTRY(3621, "01000"); SQLS_ENTRY(8153, "01003"); /* Null in aggregate */ + SQLS_ENTRY(20004, "08S01"); /* Communication link failure */ + SQLS_ENTRY(20006, "08S01"); + SQLS_ENTRY(20009, "08S01"); SQLS_ENTRY(512, "21000"); /* Subquery returns more than one value */ SQLS_ENTRY(213, "21S01"); /* Insert column list mismatch */ SQLS_ENTRY(109, "21S01"); SQLS_ENTRY(110, "21S01"); SQLS_ENTRY(1774, "21S02"); /* Ref column mismatch */ SQLS_ENTRY(8152, "22001"); /* String data would be truncated */ SQLS_ENTRY(5146, "22003"); /* Numeric value out of range */ SQLS_ENTRY(220, "22003"); /* Arithmetic overflow */ SQLS_ENTRY(232, "22003"); SQLS_ENTRY(3606, "22003"); @@ -917,20 +920,23 @@ SQLS_ENTRY(207, "42S22"); SQLS_ENTRY(4924, "42S22"); SQLS_ENTRY(4926, "42S22"); SQLS_ENTRY(15645, "42S22"); SQLS_ENTRY(21166, "42S22"); } } else { switch (msgnum) { /* Sybase */ SQLS_ENTRY(3621, "01000"); SQLS_ENTRY(9501, "01003"); /* Null in aggregate */ + SQLS_ENTRY(20004, "08S01"); /* Communication link failure */ + SQLS_ENTRY(20006, "08S01"); + SQLS_ENTRY(20009, "08S01"); SQLS_ENTRY(512, "21000"); /* Subquery returns more than one value */ SQLS_ENTRY(213, "21S01"); /* Insert column list mismatch */ SQLS_ENTRY(109, "21S01"); SQLS_ENTRY(110, "21S01"); SQLS_ENTRY(1715, "21S02"); /* Ref column mismatch */ SQLS_ENTRY(9502, "22001"); /* String data would be truncated */ SQLS_ENTRY(220, "22003"); /* Arithmetic overflow */ SQLS_ENTRY(227, "22003"); SQLS_ENTRY(232, "22003"); SQLS_ENTRY(247, "22003"); Index: src/tds/token.c =================================================================== RCS file: /cvsroot/freetds/freetds/src/tds/token.c,v retrieving revision 1.206 diff -u -u -1 -0 -b -r1.206 token.c --- src/tds/token.c 14 Aug 2003 21:03:39 -0000 1.206 +++ src/tds/token.c 14 Aug 2003 21:06:21 -0000 @@ -1953,20 +1953,22 @@ if (tds_ctx->err_handler) { memset(&msg_info, 0, sizeof(TDSMSGINFO)); msg_info.msg_number = msgnum; msg_info.msg_level = level; /* severity? */ msg_info.msg_state = state; /* TODO is possible to avoid copy of strings ? */ msg_info.server = strdup("OpenClient"); msg_info.line_number = line; msg_info.message = strdup(message); + if (msg_info.sql_state == NULL) + msg_info.sql_state = tds_alloc_lookup_sqlstate(tds, msgnum); ret = tds_ctx->err_handler(tds_ctx, tds, &msg_info); tds_free_msg(&msg_info); /* message handler returned FAIL/CS_FAIL * mark socket as dead */ if (ret && tds) { /* TODO close socket too ?? */ tds->state = TDS_DEAD; } } return 0;
-
[freetds] TDS+ODBC 'not in service' patch,
Peter Deacon, 08/13/2003
-
Re: [freetds] TDS+ODBC 'not in service' patch,
Frediano Ziglio, 08/14/2003
- Re: [freetds] TDS+ODBC 'not in service' patch, Peter Deacon, 08/14/2003
-
Re: [freetds] TDS+ODBC 'not in service' patch,
Frediano Ziglio, 08/14/2003
Archive powered by MHonArc 2.6.24.