Skip to Content.
Sympa Menu

freetds - RE: Help required

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: Help required
  • Date: Tue, 13 Aug 2002 15:15:50 -0400


> From: John Seers [mailto:John.Seers AT uk.lionbioscience.com]
> Sent: August 13, 2002 2:08 PM
>
> A little more about what I have been doing. I downloaded 0.53 and this
> was my first experience with freetds.
>
> I am connecting to MS SQL Server 2000 from a Linux intel platform.
...
> The first platform is the one I have been working on with 0.53.

John,

You should be able to connect 0.53 or a recent snapshot to SQL Server 2000
with TDS 7.0.

> My current snapshot build is going backwards at
> the moment as I cannot run the unittests

IIRC, unittest #4 is currently broken. If that's what you're seeing, you
can ignore it. It would be interesting to know if tsql handles the query
that your new C++ program is choking on.

> I built using TDSVER=7.0. Also I have not installed in the standard
> libraries as I have to get Systems to install in the standard
> libraries

Which "standard libraries" are you referring to?

> seers@braque> ./mytest
> About to start at cs_ctx_alloc
> At ct_init
> At ct_con_alloc
> At ct_con_props 1
> At ct_con_props 2
> At ct_connect
> Connected successfully
> Successful run command 1
> Successful run command 2
>
> OK, not very illuminating for you but it shows that the basic
> environment is probably correct and I am getting some sort of a dialog
> with the database server.

Since your other tests successfully connect, we know your account
credentials are OK. Since unknown marker errors often stem from TDS version
mismatches, though, you might want to "export TDSVER=7.0", just to be sure
that's not the issue.

>From your backtrace, you seem to be in g_tds_msg_handler(). That supports
your hypothesis of "getting some sort of a dialog with the database server".
ISTR some discussion recently about the default message handler. It might
be broken, or I might be starting a rumor. Maybe Brian remembers.

It's probably worthwhile to install your own handler. If you haven't done
that before, allow some time. :)

One convenient way to make sure you're generating a message is with a query
like "raiserror( 'hello', 16,1 )". sqsh won't die on that, but the default
handler might.

> I ran the unittests successfully. I decided to use ctlib for
> now as that
> seemed more modern than dblib and perhaps faster than odbc.

I doubt you'll see much difference in speed. The ct-lib is more complete
than the ODBC implementation. Apart from that, it's mostly a question of
religion, er, preference.

Regards,

--jkl

> I wrote some
> C++ code which hit the problem. So I wrote a small C program (output
> above) to prove I could connect etc and that apparently worked fine. I
> have changed the C++ program to mimic the small C program as
> closely as
> I can.
>
> Stepping though using gdb showed the value of aStruct/tds
> becoming zero
> at some stage. Here is some of the gdb output:
>
>
> #0 0x00000010 in ?? ()
> (gdb)
> (gdb)
> (gdb)
> (gdb)
> (gdb)
> (gdb) up
> #1 0x407339de in ctlib_handle_info_message (aStruct=0x889bc70) at
> ctutil.c:38
> 38 return ctlib_handle_err_message(aStruct);
> (gdb) up
> #2 0x4073647b in tds_process_msg (tds=0x889bc70, marker=171) at
> token.c:1214
> 1214 g_tds_msg_handler(tds);
> (gdb) up
> #3 0x40734ba9 in tds_process_default_tokens (tds=0x889bc70,
> marker=171)
> at token.c:101
> 101 return tds_process_msg(tds,marker);
> (gdb) p tds
> $1 = (TDSSOCKET *) 0x889bc70
> (gdb) down
> #2 0x4073647b in tds_process_msg (tds=0x889bc70, marker=171) at
> token.c:1214
> 1214 g_tds_msg_handler(tds);
> (gdb) p tds
> $2 = (TDSSOCKET *) 0x0
> (gdb) up
> #3 0x40734ba9 in tds_process_default_tokens (tds=0x889bc70,
> marker=171)
> at token.c:101
> 101 return tds_process_msg(tds,marker);
> (gdb) up
> #4 0x40734d0a in tds_process_login_tokens (tds=0x889bc70) at
> token.c:209
> 209 if
> (tds_process_default_tokens(tds,marker)
> ==TDS_FAIL)
> (gdb) up
> #5 0x40737996 in tds_connect (login=0x889bad0, parent=0x889baa8) at
> login.c:240
> 240 if (!tds_process_login_tokens(tds)) {
> (gdb) up
> #6 0x40731a73 in ct_connect (con=0x889baa8, servername=0xbfffe954
> "MyServer70",
> snamelen=2) at ct.c:303
> 303 if (!(con->tds_socket = (void *)
> tds_connect(con->tds_login, (void
> *) con))) {
> (gdb) up
> #7 0x4002c844 in RdbSqlTDS::initialise (this=0x889b8f0) at
> RdbSqlTDS.cpp:129
> 129 ret=ct_connect((CS_CONNECTION*)tdsconn,
> SERVER,CS_NULLTERM);
> Current language: auto; currently c++
> (gdb)
>
> I am very grateful for any help. Apologies in advance if it is a
> beginner type problem.
>
> Thanks.


The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that for certain accounts we do not accept
orders and/or instructions by e-mail, and for those accounts we will not be
responsible for carrying out such orders and/or instructions. Kindly refrain
from sending orders or instructions by e-mail unless you have confirmed that
we accept such communications for your account. Please also note that to
satisfy regulatory requirements we review the outgoing and incoming e-mail
correspondence of staff members serving certain functions.






Archive powered by MHonArc 2.6.24.

Top of Page