Skip to Content.
Sympa Menu

freetds - RE: TODO

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <ThompBil AT exchange.uk.ml.com>
  • To: "'TDS Development Group'" <freetds AT franklin.oit.unc.edu>
  • Subject: RE: TODO
  • Date: Wed, 4 Sep 2002 17:42:53 +0100


Well no, it does affect everything.

If for example we tried to convert a VARCHAR of 0 length to a CHAR, the same
error would arise, even through dbconvert(), as these are different types.
The problem is inability to distinguish between TDS_FAIL and a valid
returned length of 0.

Eric, your problem is a symptom of the same thing:

try and convert VARBINARY of 0 length to varchar;
tds_convert_binary() validly returns length 0
tds_convert traps this as TDS_FAIL
tds_convert tries to convert the same data to VARCHAR for the purposes of
including it in the error message
fails again
falls foul of the assert()....

I think we should change all references to TDS_FAIL in convert.c ( and sub
functions in other files) to something like TDS_CONVERT_FAIL (#defined to
-1)

Bill
> -----Original Message-----
> From: Brian Bruns [SMTP:camber AT ais.org]
> Sent: Wednesday, September 04, 2002 5:38 PM
> To: TDS Development Group
> Subject: [freetds] RE: TODO
>
> Ok, so it affects libtds only, I can live with that, but we should fix it
> sooner or later.
>
> Brian
>
> > Brian,
> >
> > The problem is as follows:
> >
> > calling dbconvert() to convert varchar -> varchar bypasses the call to
> > tds_convert().
> >
> > however when tds_convert() is called to convert a varchar of 0 length to
> a
> > varchar it returns a length of 0 ( quite right too ).
> >
> > Unfortunately the error handling at the bottom of tds_convert captures
> the
> > return of the sub-functions ( which is the length of the converted data
> or
> > TDS_FAIL)
> > Unfortunately TDS_FAIL is #defined to 0
> >
> > you can deduce what's happening...
> >
> >
> > maybe we should somethin other than TDS_FAIL in convert.c
> > #define TDS_CONVERT_FAIL -1 perhaps ?
> >
> > Bill
>
> ---
> You are currently subscribed to freetds as: [thompbil AT exchange.uk.ml.com]
> To unsubscribe, forward this message to
> $subst('Email.Unsub')




  • TODO, ZIGLIO Frediano, 09/04/2002
    • <Possible follow-up(s)>
    • RE: TODO, Lowden, James K, 09/04/2002
    • Re: TODO, Brian Bruns, 09/04/2002
    • RE: TODO, Brian Bruns, 09/04/2002
    • RE: TODO, Thompson, Bill D (London), 09/04/2002
    • RE: TODO, Brian Bruns, 09/04/2002
    • RE: TODO, Thompson, Bill D (London), 09/04/2002
    • RE: TODO, Eric Deutsch, 09/04/2002
    • RE: TODO, Brian Bruns, 09/04/2002
    • RE: TODO, Thompson, Bill D (London), 09/04/2002
    • RE: TODO, Frediano Ziglio, 09/04/2002
    • RE: TODO, Lowden, James K, 09/04/2002
    • RE: TODO, Frediano Ziglio, 09/04/2002

Archive powered by MHonArc 2.6.24.

Top of Page