[freetds] bug/change in behavior in handling null text columns

John Mund jmund at miqs.com
Thu May 24 11:34:34 EDT 2007


Hello,
   There is a difference between .63 and .64 versions on how null text 
columns are handled.  I believe it is a bug.    When you have a text 
column that previously had a value and then was set to null, 
freetds-0.64 doesn't appear to treat it as null, but rather some kind of 
zero length string.  This causes problems downstream (php blows up). 
Version .63 correctly treated it as null.
Here are the details:
   Platform/OS: Intel/FreeBSD 6.2
   freetds-0.64
   Connecting to remote Sybase DB (same behavior on versions 11.9.2 and 15)
      Sybase @@version:
         Adaptive Server Enterprise/11.9.2.6/1290/P/EBF 10491 
ESD1/Sun_svr4/OS 5.5.1/FBO/Mon Jul 15 06:54:22 2002
         Adaptive Server Enterprise/15.0/EBF 13194 EC ESD/P/Linux 
Intel/Linux 2.4.21-20.ELsmp i686/ase150/2179/32-bit/FBO/Mon Feb  6 
04:14:19 2006

To reproduce in tsql
1> create table #t (t1 text null, t2 text null)
2> insert #t (t1) select "a"
3> select * from #t
4> go
t1      t2
a       NULL
1>  update #t set t1=null
2> select * from #t
3> go
t1      t2
       NULL

The value for t1 is a blank, but not a null.  I believe this should be a 
NULL.  The same sql to same databases (from Intel/FreeBSD 5.4) using 
freetds-0.63 results in:
t1      t2
NULL    NULL


Please let me know if I can provide any more details.


Thank you for your work on this great piece of software.

John







More information about the FreeTDS mailing list