Skip to Content.
Sympa Menu

freetds - NUMERIC seems broken again

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: NUMERIC seems broken again
  • Date: Mon, 8 Jul 2002 17:34:37 -0400


> From: Eric Deutsch [mailto:edeutsch AT systemsbiology.org]
> Sent: July 8, 2002 5:07 PM
>
> Linux x86 using Perl + DBD::Sybase to MS SQL Server 2000
> using TDS 7.0.
> I can never remember which endian is which but it's Intel, not RISC.

Confirmed. My Alpha box (little endian) fails in exactly the same way:

1> select cast(123 as numeric(10,0))
2> go

-------------
-886308406666513612

1> select cast(1 as numeric(10,0)), cast(-1 as numeric(10,0))
2> go

------------- -------------
-7205759403792793 7205759403792793

regardless of TDSVER. Maybe we are swapping when we shouldn't, instead of
not swaping when we should? Bytes, that is.

Hmm. Note sqsh's misalignment of the columns. We might be lying about the
length, too:

1> select cast(1 as numeric(1,0))
2> go

----
-1677721

1> select cast(-1677721 as varbinary ) -- MS isql
2> go

--------------------------------------------------------------
0xffe66667

--jkl

P.S. varbinary is broken with sqsh on my system, too, but that might be
oldness of snapshot.





Archive powered by MHonArc 2.6.24.

Top of Page