freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Lowden, James K" <LowdenJK AT bernstein.com>
- To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
- Subject: tdsver in mem.c::tds_alloc_login
- Date: Wed, 3 Jul 2002 15:37:41 -0400
Brian,
Does this code work?
I set my TDSVER to "4.2" or "7.0" (with decimal point), and it affects the
wire protocol. I know it does, because the dump files change from Ascii to
UCS-2.
But this function still expects the old-style 42/70 format. It gets called,
according to gdb, but obviously my "export TDSVER=4.2" won't be seen.
If I'm to change it, I'd also define defaultcaps as static const.
Fragment attached.
--jkl
TDSLOGIN *tds_alloc_login()
{
TDSLOGIN *tds_login;
unsigned char defaultcaps[] =
{0x01,0x07,0x03,109,127,0xFF,0xFF,0xFF,0xFE,0x02,0x07,0x00,0x00,0x0A,104,0x0
0,0x00,0x00};
char *tdsver;
tds_login = (TDSLOGIN *) malloc(sizeof(TDSLOGIN));
memset(tds_login, '\0', sizeof(TDSLOGIN));
if ((tdsver=getenv("TDSVER"))) {
if (!strcmp(tdsver,"42")) {
tds_login->major_version=4;
tds_login->minor_version=2;
} else if (!strcmp(tdsver,"46")) {
tds_login->major_version=4;
tds_login->minor_version=6;
} else if (!strcmp(tdsver,"50")) {
tds_login->major_version=5;
tds_login->minor_version=0;
} else if (!strcmp(tdsver,"70")) {
tds_login->major_version=7;
tds_login->minor_version=0;
} else if (!strcmp(tdsver,"80")) {
tds_login->major_version=8;
tds_login->minor_version=0;
}
/* else unrecognized...use compile time default above */
-
tdsver in mem.c::tds_alloc_login,
Lowden, James K, 07/03/2002
- <Possible follow-up(s)>
- Re: tdsver in mem.c::tds_alloc_login, Brian Bruns, 07/03/2002
Archive powered by MHonArc 2.6.24.