[freetds] 0.82 RC4 assert(0) on failed to connect

Dossy Shiobara dossy at panoptic.com
Mon Apr 21 11:12:44 EDT 2008

On 2008.04.21, James K. Lowden <jklowden at freetds.org> wrote:
> This is actually a specific instance of the general purpose of each
> library's "handler handler".  Each library defines its own way to deal
> with timeouts, and libtds doesn't care which client library happens to be
> in use; it has its own callback specification.  It's the job of the
> "handler handler" to wrap the caller's handler (if any) and provide
> conforming behavior for libtds.  
> Hope that's clear!  

Yup, absolutely clear ... probably because I'd already read all the
related code.  :-)

> > Yes, I realize that direct use of libtds isn't supported, but this
> > caught me by surprise.
> I'm sure.  Over the last year or two I've worked to rationalize error
> handling. The philosophy is that most error detection and handling should
> be done by the client library, and libtds can expect to be called
> correctly.  Life is simpler that way.  

Absolutely.  This was just a change from 0.64 to 0.82 that I wasn't
expecting ...

> For the sake of a framework, let's say errors are of two kinds: logical
> and runtime.  Runtime errors -- server not available, library misuse --
> cannot be handled at compile time.  They provoke error messages that
> inform the user what went wrong.  Logical errors are bugs embedded in the
> code that can be prevented by testing, etc.  They are handled more simply:
> with a log message (maybe) and an assertion.  (I'm excluding server
> messages -- bad SQL, etc. -- because they're not errors insofar as the
> library is concerned.  They're just data.) 

It would be nice if in the TDSMESSAGE structure there was an "error
code" passed along.  Having to parse the error message string (esp. once
things get localized, yow!) to deduce "what went wrong" is going to be
very ... painful.

Dossy Shiobara              | dossy at panoptic.com | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
    folly -- then you can let go and quickly move on." (p. 70)

More information about the FreeTDS mailing list