Skip to Content.
Sympa Menu

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

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: John Mund <jmund AT miqs.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] bug/change in behavior in handling null text columns
  • Date: Thu, 24 May 2007 09:34:34 -0600

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









Archive powered by MHonArc 2.6.24.

Top of Page