Skip to Content.
Sympa Menu

freetds - Re: [freetds] dbsetnull changed

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] dbsetnull changed
  • Date: Mon, 3 Dec 2007 23:57:29 -0500

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.)

Regards,

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page