Skip to Content.
Sympa Menu

freetds - RE: TODO

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: RE: TODO
  • Date: 04 Sep 2002 19:36:34 +0200


Il mer, 2002-09-04 alle 18:42, Thompson, Bill D (London) ha scritto:
> 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

IMHO the problem is: should tds_convert support NULL values ??
I never thinks so...
If tds_convert must support NULL I think we must change something:
- mssql support empty string not null, so returning 0 for fail is not
ok... also srclen == 0 for null is bad too...
- dbconvert assume 0 for null values (and so many other types)...

freddy77





  • 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