Skip to Content.
Sympa Menu

freetds - Re: dbconvert bugs

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Brian Bruns" <camber AT ais.org>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: dbconvert bugs
  • Date: Fri, 12 Jul 2002 07:52:29 -0400


Bill, according to the dblib book, the message handler is called on errors
if a dbproc is passed to dbconvert, otherwise the global dblib error
variable is set (warning: not thread safe). I couldn't actually find the
global error variable and I've never seen a dblib program use it.

cs_convert says it will general CS-Library errors, although I imagine the
mean for the context passed, any connection error handlers would
apparently not be called. We are definately on the right track of using
tds_client_msg, but there are some quirks to be worked out.

It looks like passing tds_convert a TDS_CONTEXT is the proper course of
action. See freddy77 and my discussion on the matter of moving the dblib
error handlers into the implicit dblib context.

Freddy, is your patch ready? we could apply it ahead of Bill's and make
his life easier.

Now the other thing is separating the context handler from the connection
handlers, we'd need to be able to call the API handler with a context and
a possibly NULL socket, but it's the right thing to do. Currently, ctlib
handlers look up the context handler by following the connection. This
would obviously not be possible anymore.

Brian

> Brian,
> >
> > OK, I'm looking to put error handling into tds_convert...
> > Now I've hit a problem. tds_convert is not passed in the TDSSOCKET, which
> > tds_client_msg() requires.
> > I started to change things so that it could be passed in.
> > No problem with dbconvert(). This is passed in dbproc, whence we can get
> > the TDSSOCKET.
> > I think we have a problem with cs_convert(). This is not passed anything
> > that allows me to get at a TDSSOCKET, so I cant pass it into
> > tds_convert...
> >
> > Any ideas about where to go from here ?
> >
>
> Looked a bit further. Seems to me I'll have to call g_tds_err_handler
> directly, rather than through tds_client_msg() . The only thing we wont be
> able to do is set the tds.state to TDS_DEAD if the error handler function
> returns fail.
>
> Bill




Archive powered by MHonArc 2.6.24.

Top of Page