freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
- To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] Null Handling of VarChar Columns
- Date: Tue, 27 Nov 2007 16:25:46 +0100
>
> We have now got to the bottom of this and I believe there are
> some real
> underlying issues:
>
> The NULL indicator does in fact function correctly, there was an error
> in our test harness (missing an &) meaning that we were passing the
> contents of our indicator variable, rather than it's address!
>
> However, the other problem stands in that when a query returns a NULL
> string column, the contents of the data buffer is not cleared and the
> string that was last stored in the bound variable is still there. The
> library documentation states that the standard behaviour would be to
> place a zero length null terminated string in this buffer, which is
> obviously more sensible behaviour.
>
I just wrote a test and tested with both our library and Sybase one.
Buffer is not terminated on NULLs!
See
http://freetds.cvs.sourceforge.net/freetds/freetds/src/dblib/unittests/n
ull2.c?view=markup
So the behavior of FreeTDS (at least of CVS HEAD) is correct.
I don't know however how dbbind works with -1 as varlen.
bye
freddy77
-
[freetds] Null Handling of VarChar Columns,
Simon Talbot, 11/21/2007
-
Re: [freetds] Null Handling of VarChar Columns,
James K. Lowden, 11/21/2007
- Re: [freetds] Null Handling of VarChar Columns, Simon Talbot, 11/21/2007
- <Possible follow-up(s)>
-
Re: [freetds] Null Handling of VarChar Columns,
Simon Talbot, 11/23/2007
- Re: [freetds] Null Handling of VarChar Columns, James K. Lowden, 11/24/2007
-
Re: [freetds] Null Handling of VarChar Columns,
ZIGLIO, Frediano, VF-IT, 11/27/2007
- Re: [freetds] Null Handling of VarChar Columns, James K. Lowden, 11/27/2007
- Re: [freetds] Null Handling of VarChar Columns, Simon Talbot, 11/23/2007
-
Re: [freetds] Null Handling of VarChar Columns,
Simon Talbot, 11/24/2007
- Re: [freetds] Null Handling of VarChar Columns, Frediano Ziglio, 11/25/2007
-
Re: [freetds] Null Handling of VarChar Columns,
James K. Lowden, 11/25/2007
- Re: [freetds] Null Handling of VarChar Columns, ZIGLIO, Frediano, VF-IT, 11/26/2007
-
Re: [freetds] Null Handling of VarChar Columns,
James K. Lowden, 11/21/2007
Archive powered by MHonArc 2.6.24.