Skip to Content.
Sympa Menu

freetds - Re: DBD::Sybase main.t crash

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: DBD::Sybase main.t crash
  • Date: Mon, 30 Aug 1999 20:37:36 -0400 (EDT)



TDS is a little strange in that way considering usually networking
protocols (at least the TCP/IP ones) generally send binary data in
'network order'. The client can request either byte-order by specifying it
in the login packet and process either order. So, in theory the Sparc
machine could be set to HW_LITTLE_ENDIAN and still work. (operative words
being 'in theory', I'm not all that convinced that the current code base
is totally clean in this regard). This may become a necessity for TDS 7.0
or perhaps not, we'll find out more as we go I guess. IIOP (Corba) does
something similar in that is negotiates the byte order between client and
server.

I suppose the 'HW_' is a misnomer, since it really represents the wire
byte order and not the cpu endianess.

Brian

On Mon, 30 Aug 1999, Mark Schaal wrote:

> >
> >
> > We've had several people running on Solaris (with some local fixes
> > apparently). Now the question may be were all the Solaris people running
> > with 4.2 and this is 5.0? I'm trying to remember but it seems the packet
> > headers were in a fixed order that did not change which would mean when
> > sending a packet it should not swap the the length. Theoretically you
> > should be able to connect to a server with HW_LITTLE_ENDIAN set on a big
> > endian machine. There might not seem to be much value in it now, but I
> > haven't seen much in TDS 7.0 that indicates it supports multiple byte
> > orders.
> >
> > Brian
>
> I finally figured it out. These ints and smallints definitely change their
> byte order. However, the bitflipping done by tds_small_int() accomplishes
> explicitly the same thing as calling tds_get_n(tds, &smallintval, 2) would
> do
> implicitly. This is why tds_get_int() works correctly even though it
> doesn't
> try to take into account the machine byteorder. Kind of neat, but it
> confused
> me quite a bit.
>
> Mark
>
> For example:
> [63-64] is a smallint
> [81-82] is a smallint
> [83-86] is an int
>
> Solaris x86 (small endian)
>
> 48: XXXX XXXX XXXX XXXX XXXX XXXX XXXX e30f XXXXXXXXXXXXXX..
> 64: 0001 066d 6173 7465 7206 6d61 7374 6572 ...master.master
> 80: ab38 0045 1600 0002 0025 0043 6861 6e67 .8.E.....%.Chang
> 96: 6564 2064 6174 6162 6173 6520 636f 6e74 ed database cont
> 112: 6578 7420 746f 2027 6d61 7374 6572 272e ext to 'master'.
> 128: 0743 4154 414c 4f47 0000 00ad 1e00 0104 .CATALOG........
> 144: 0200 0014 4d69 6372 6f73 6f66 7420 5351 ....Microsoft SQ
> 160: 4c20 5365 7276 6572 5f06 32c9 e309 0004 L Server_.2.....
> 176: 0335 3132 0335 3132 fd00 0000 0000 0000 .512.512........
> 192: 00
>
> Solaris SPARC (big endian)
>
> 48: XXXX XXXX XXXX XXXX XXXX XXXX XXXX e300 XXXXXXXXXXXXXX..
> 64: 0f01 066d 6173 7465 7206 6d61 7374 6572 ...master.master
> 80: ab00 3800 0016 4502 0000 2543 6861 6e67 ..8...E...%Chang
> 96: 6564 2064 6174 6162 6173 6520 636f 6e74 ed database cont
> 112: 6578 7420 746f 2027 6d61 7374 6572 272e ext to 'master'.
> 128: 0743 4154 414c 4f47 0000 00ad 001e 0104 .CATALOG........
> 144: 0200 0014 4d69 6372 6f73 6f66 7420 5351 ....Microsoft SQ
> 160: 4c20 5365 7276 6572 5f06 32c9 e300 0904 L Server_.2.....
> 176: 0335 3132 0335 3132 fd00 0000 0000 0000 .512.512........
> 192: 00 .
>
> --
> Mark J. Schaal Phone: (909)
> 620-7724
> TST On Ramp Fax: (909) 620-8174
> System Administrator E-Mail: mark AT tstonramp.com
>
> ---
> 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