Skip to Content.
Sympa Menu

freetds - RE: [freetds] TDSICONVINFO **iconv_info

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO Frediano" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] TDSICONVINFO **iconv_info
  • Date: Mon, 20 Oct 2003 17:33:08 +0200

> >
> > Anyone can apply my patch ?
> > Mainly it add support for single-byte column conversions.
> > exceptions:
> > - numeric.c remove printf
> > - odbc.c applied update patch from ML
>
> Freddy, I don't understand this change:
>
> - TDSICONVINFO *iconv_info;
> + TDSICONVINFO **iconv_info;
>
> I like an array of structures better than an array of
> pointers. I couldn't find anywhere in the code where the
> second level of indirection made something possible/easier.
> Can you show me where that's the case?
>
> I know you're concerned about invalidating references to
> elements in the iconv_info array when it's reallocated, but
> I'm quite sure that can be avoided without making the data
> structure more complex.
>

Well... as stated TDSCOLINFO->iconv_info point to a
TDSSOCKET->iconv_info[n]. If TDSSOCKET->iconv_info get relocated (when
iconv stuff need to add a new conversion for a different column
encoding) TDSSOCKET->iconv_info[n] can change address so we should scan
all rows/compute/params infos and replace the pointer. Using
TDSICONVINFO** I avoid realloc-ation and I keep TDSICONVINFO data fixed
in memory.

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page