Skip to Content.
Sympa Menu

freetds - Re: error handling mire

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: James K. Lowden <jklowden AT speakeasy.org>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: error handling mire
  • Date: Sun, 25 Aug 2002 10:27:48 -0400


On Sat, 24 Aug 2002 20:14:46 -0400, "James K. Lowden"
<jklowden AT schemamania.org> wrote:

> I'm going to modify all the "subconverters" (e.g., tds_convert_char) to
> take as a first parameter a TDSSOCKET*. I will drop their srctype first
> parameters, because they're not used.

New theory, memo to file.

The subconverters need neither srctype nor TDSSOCKET*. They are
context-free; they just convert one type to another, returning
success/failure, just like a fancy atoi().

tds_convert() has to pay attention to the return code, and call
tds_client_msg() accordingly. That's much easier.

It may also be insufficiently precise. It may be that the call to
tds_client_msg() will have to be made by the caller e.g., dbconvert(),
because the message number depends on the context (in the English sense).
For instance, failure to convert varchar -> datetime via dbconvert()
spawns error 249. Were the same data encountered during dbnextrow() --
for which dbbind() had been called with DATETIMEBIND -- the same
conversion would be attempted, and the same error encountered. But the
message number would be different (I think), because the conversion isn't
"explicit".

For now though, I think it's easiest and good to have tds_convert() call
the message handler. Best can wait.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page