Skip to Content.
Sympa Menu

freetds - Re: M$ SQL 7, again ;-)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT umcc.ais.org>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: M$ SQL 7, again ;-)
  • Date: Fri, 10 Sep 1999 20:26:23 -0400 (EDT)



Wow, this indeed does only affect MS SQL Servers. This message may shed
some light on the subject (it was posted to the list by Bill Tutt on
August 28)

> A little birdie from MS support mentioned that SQL 7 unintentionally
> broke TDS 4.2 complatiblility and that the following problems are
> experienced by big endian sybase clients:
>
> 1) selecting datetime, smalldatetime, and money data types return
> incorrect results.
> 2) Error numbers at the client are always wrong.
> 3) bcp just won't work.

So, it appears that microsoft has broken big endian support for the above
types. Good news it can be fixed. Try and do that with closed source
libraries!

Luckily the login ack token has a place where the servers version number
is returned, so we should be able to fix this without breaking older
versions of SQL Server. I'll brew something up and let you know when it's
ready.

Brian


On Fri, 10 Sep 1999, Brian Bruns wrote:

> On 09/10/99, "Michael Peppler <mpeppler AT peppler.org>" wrote:
> > Paul Schaap writes:
> > > Hi,
> > >
> > > I have a fairly recent CVS freetds which has the following two issues
> > :-
> > >
> > > 1) With both php and sqsh dates come through incorrectly, i.e.
> > > 1> SELECT ID,DateAdded FROM Customer WHERE ID > 10001434
> > > 2> \go
> > > ID DateAdded
> > > -------- -------------------
> > > 10001435 Aug 11 1903 06:51AM
> > > 10001436 Aug 30 1903 06:51AM
> > > 10001437 Nov 25 1903 06:51AM
> > >
> > > (3 rows affected)
> > > 1> SELECT ID,CONVERT(CHAR(20),DateAdded) FROM Customer WHERE ID >
> > 10001434
> > > 2> \go
> > > ID
> > > -------- --------------------
> > > 10001435 Sep 10 1999 9:32PM
> > > 10001436 Sep 10 1999 9:51PM
> > > 10001437 Sep 10 1999 11:18PM
> > >
> > > (3 rows affected)
> > > I resolve this by doing a CONVERT right now ! Any ideas how it could be
> > > fixed ?
> >
> > Looks like the first and second word of the DATETIME value are swapped
> > on MSSQL7... Remember that a datetime is a struct with two 32bit int
> > values, one for days since Jan 1 1900, and one for 300th of seconds
> > since midnight.
> >
>
> Interesting. I can see I need to test this on big endian. The 32bit values
> themselves seem to be byte-ordered correctly. However if it treats dates as
> a single 64bit value on the server side it would indeed show this
> behaviour. I'll verify against Solaris/Sybase tonight when I get home, but
> my feeling is it's wrong there as well. Simple patch if thats the case.
>
> Brian
>
> ---
> You are currently subscribed to freetds as: camber AT ais.org
> To unsubscribe, forward this message to $subst('Email.Unsub')
>
>







Archive powered by MHonArc 2.6.24.

Top of Page