Skip to Content.
Sympa Menu

freetds - Re: [freetds] Problem with Set TEXT field to NULL

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Problem with Set TEXT field to NULL
  • Date: Thu, 3 Sep 2009 13:57:34 +0200

2009/2/12 Min <pingminadmin AT gmail.com>:
> Hello,
>
> Thanks for the confirm and the patch. But this is related to the TEXT
> fields. So I add the following to the token.c. It seems working for me. But
> not sure if it break any else. Can some one confirm if it is OK?
>
> --- freetds-0.82/src/tds/token.c        2008-01-27 10:41:23.000000000 +0000
> +++ patch/src/tds/token.c       2009-02-12 16:11:40.000000000 +0000
> @@ -1946,6 +1946,8 @@
>                        tds_get_n(tds, blob->textptr, 16);
>                        tds_get_n(tds, blob->timestamp, 8);
>                        colsize = tds_get_int(tds);
> +                        if (colsize == 0)
> +                            colsize = -1;
>                } else {
>                        colsize = -1;
>                }
>
>
> Min
>
> 2009/2/12 Teemu Torma <teemu AT torma.org>
>
>> On Wednesday 11 February 2009 05:12:40 James K. Lowden wrote:
>> > Anyone got a patch?  I'm not going to be able to look into this for a few
>> > weeks.
>>
>> Does this patch help?  I just yesterday updated to 0.82 and noticed that
>> long
>> varchar columns (> 255) do not receive null status.  The attached appears
>> to
>> fix this.
>>
>> Teemu
>>

Applied Teemu Torma patch for long varchar. Min patch break empty TEXT
fields under mssql. mssql supports empty TEXT as ''. Sybase save empty
strings as a single characters (' '). I tried to insert an empty text
using Sybase 15 and db save NULLs as no having textptr/timestamp so
token.c code is ok.

freddy77



  • Re: [freetds] Problem with Set TEXT field to NULL, Frediano Ziglio, 09/03/2009

Archive powered by MHonArc 2.6.24.

Top of Page