[freetds] sqsh build fails with FreeTDS 1.0

Frediano Ziglio freddy77 at gmail.com
Fri Jul 1 02:11:59 EDT 2016


On 1 Jul 2016 05:37, "Stuart Henderson" <stu at spacehopper.org> wrote:
>
> On 2016-06-29, Merle Reinhart <merlereinhart at mac.com> wrote:
> > I ran into this even before FreeTDS 1.0 when I was trying to check out
> > some of the features of 7.2 and 7.3 via sqsh.
>
> Yes, that's the easily-fixed one I mentioned.
>
>
> On 2016-06-29, Igor Korot <ikorot01 at gmail.com> wrote:
> > Hi, Stuart,
> >
> > On Tue, Jun 28, 2016 at 5:19 PM, Stuart Henderson <stu at spacehopper.org>
wrote:
> >> sqsh build is failing with newer FreeTDS. There's an easily fixed
> >> CS_TDS_80 that can be replaced with CS_TDS_71, but when that's done
> >> I run into this in src/dsp_conv.c:
> >
> > What is you OS? What is you configure line? What is the exact error
> > message you received?
>
> OS is OpenBSD/amd64 -current (not that it's relevant in this
> case), and I showed the exact error message:
>
> >> dsp_conv.c: In function 'dsp_datetime_conv':
> >> dsp_conv.c:665: error: 'CS_DATEREC' has no member named 'datesecfrac'
>
> freetds-1.00.9/include/cspublic.h now lists new bind types e.g.
>
> 581:#define CS_BIGDATETIME_TYPE TDS_STATIC_CAST(CS_INT, 35)
>
> The code in dsp_conv.c does this:
>
> >>     /*
> >>      * Take the existing format and strip it down according to the
> >>      * type of date that we are processing and replace the ms
> >>      * field if it exists.
> >>      */
> >> #if defined(CS_BIGDATETIME_TYPE) && defined(CS_BIGTIME_TYPE)
> >>     if (dt_fmt->datatype == CS_BIGDATETIME_TYPE || dt_fmt->datatype ==
CS_BIGTIME_TYPE)
> >>         fmt = dsp_datetime_strip( dt_fmt->datatype, conv_fmt, (int)
dr.datesecfrac );
> >>     else
> >> #endif
> >>         fmt = dsp_datetime_strip( dt_fmt->datatype, conv_fmt, (int)
dr.datemsecond );
>
> dr is a CS_DATEREC struct, but the definition in cstypes.h doesn't
> have datesecfrac and datesecprec fields so it's clear why the error
> occurs.
>
> Perhaps the better fix would be for FreeTDS to add them to the struct
> and cs_dt_crack().
>
>
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc20155.1550/html/newfesd/newfesd48.htm
>
>

Yes but this must be done in a ABI compatible way. Just adding fields to a
structure is not enough. They must be set in the right way.

Frediano


More information about the FreeTDS mailing list