freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- 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
-
error handling mire,
James K. Lowden, 08/24/2002
- <Possible follow-up(s)>
- Re: error handling mire, Brian Bruns, 08/24/2002
-
Re: error handling mire,
James K . Lowden, 08/25/2002
- Re: error handling mire, Brian Bruns, 08/25/2002
- Re: error handling mire, James K . Lowden, 08/25/2002
Archive powered by MHonArc 2.6.24.