Skip to Content.
Sympa Menu

freetds - Re: [freetds] sqsh build fails with FreeTDS 1.0

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Merle Reinhart <merlereinhart AT mac.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] sqsh build fails with FreeTDS 1.0
  • Date: Wed, 29 Jun 2016 11:43:47 -0400

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. Here was what I patched to let
those tds versions pass through. Basically, I just removed 8.0 and added the
7.x subversions since I knew that was coming. This was quick and dirty, so
it is very possible there may be other changes that really should be made,
but this will get it to build (at least on Mac OS X). I never got a chance
to get back to it to verify if there were other changes or not, so I never
passed this upstream to the sqsh folks.

Merle






--- src/cmd_connect.c.orig 2014-04-04 04:22:38.000000000 -0400
+++ src/cmd_connect.c 2015-12-02 17:22:42.000000000 -0500
@@ -860,8 +860,12 @@
/* Then we use freetds which uses enum instead of defines */
else if (strcmp(tds_version, "7.0") == 0)
version = CS_TDS_70;
- else if (strcmp(tds_version, "8.0") == 0)
- version = CS_TDS_80;
+ else if (strcmp(tds_version, "7.1") == 0)
+ version = CS_TDS_71;
+ else if (strcmp(tds_version, "7.2") == 0)
+ version = CS_TDS_72;
+ else if (strcmp(tds_version, "7.3") == 0)
+ version = CS_TDS_73;
#endif
else version = CS_TDS_50; /* default version */

@@ -1258,8 +1262,14 @@
case CS_TDS_70:
env_set( g_env, "tds_version", "7.0" );
break;
- case CS_TDS_80:
- env_set( g_env, "tds_version", "8.0" );
+ case CS_TDS_71:
+ env_set( g_env, "tds_version", "7.1" );
+ break;
+ case CS_TDS_72:
+ env_set( g_env, "tds_version", "7.2" );
+ break;
+ case CS_TDS_73:
+ env_set( g_env, "tds_version", "7.3" );
break;
#endif
default:
--- doc/sqsh.pod.orig 2014-03-12 10:19:43.000000000 -0400
+++ doc/sqsh.pod 2015-12-02 17:24:44.000000000 -0500
@@ -145,12 +145,13 @@
=item -G tds_version

Set the TDS version to use. Valid versions are 4.0, 4.2, 4.6, 4.9.5, 5.0 and
-freetds additionally supports versions 7.0 and 8.0. The specified value is
-assigned to the variable B<$tds_version>. Input validation is not performed
by
-sqsh. However, when an invalid TDS version is specified, the default version
of
-5.0 will be used. After a session is setup, the variable B<$tds_version>
will be
-set to the TDS version in effect. The variable will not be available if
option
--G is not used. Meant for test and debugging purposes only.
+freetds additionally supports versions 7.0, 7.1, 7.2 and 7.3. The specified
+value is assigned to the variable B<$tds_version>. Input validation is not
+performed by sqsh. However, when an invalid TDS version is specified, the
+default version of 5.0 will be used. After a session is setup, the variable
+B<$tds_version> will be set to the TDS version in effect. The variable will
not
+be available if option -G is not used. Meant for test and debugging purposes
+only.

TDS stands for Tabular Data Stream and is the communication protocol Sybase
and
Microsoft uses for Client-Server communication.








> On 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:
>
> /*
> * 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 );
>
>
> - CS_BIGDATETIME_TYPE etc are now defined, but the structure
> doesn't include datesecfrac:
>
> dsp_conv.c: In function 'dsp_datetime_conv':
> dsp_conv.c:665: error: 'CS_DATEREC' has no member named 'datesecfrac'
>
> Any suggestions for a better fix than just #if 0'ing it out?
> Thanks.
>
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds





Archive powered by MHonArc 2.6.24.

Top of Page