[freetds] dbsetnull changed

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Mon Dec 3 04:45:03 EST 2007


> 
> The nightly snapshot will contain changes you might want to 
> know about.  
> 

Good.

> I rewrote dbsetnull() this weekend, and added to dbconvert 
> the ability to
> use user-defined null representations.  So, if you want 
> SYBCHAR columns to
> appear as "<NULL>" instead of "\0", that's now your choice. 
> 
> Overall there were some 400 lines removed and added, 
> according to CVS. 
> Everything *seems* to work, except for Frediano's new null unit tests
> (which were failing before).  I haven't looked into that.  
> But the code is
> new and the real world inevitably turns up use cases the programmer
> doesn't foresee, so be warned.  
> 

Lately I write tests before fixing the problem. Yes, null and null2
tests fail.
And I would add that the new setnull test fails too (see
http://freetds.cvs.sourceforge.net/freetds/freetds/src/dblib/unittests/s
etnull.c?view=markup)
dbsetnull ignore bindlen if bindtype != CHARBIND and BINARYBIND so any
values for other bindtypes are valid. I have to say that you added
bindlen for all types but it's needed for only two... yes, optimization
it's not so important but you know I'm too paranoid :)

> The work goes some distance toward addressing the issue Simon Talbot
> raised last week.  To fix it fully, I think dbbind() needs a little
> attention.  
> 

Yes, I think null2 test should incorporate other types.

freddy77


More information about the FreeTDS mailing list