[freetds] dbsetnull changed
James K. Lowden
jklowden at freetds.org
Mon Dec 3 23:57:29 EST 2007
ZIGLIO, Frediano, VF-IT wrote:
> > 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.
Very clever. You're making me work. ;-)
> And I would add that the new setnull test fails too
Not any more. :-)
> dbsetnull ignore bindlen if bindtype != CHARBIND and BINARYBIND so any
> values for other bindtypes are valid.
Thank you for pointing that out. Fixed.
> 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 :)
Well, yes, but I made the code smaller. I took out 75 lines; you took out
100 lines, and we added functionality. That's good! _set_null_value()
and dbgetnull() are basically table lookups, except that for padded
columns we need to know the column size and allocate the memory.
(Actually, combining those functions would simplify the logic further. I
started out thinking dbsetnull() should have an inverse, but in the end I
wound up with one job split over two functions.)
More information about the FreeTDS