freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Sam Denton <denton AT wantec.com>
- To: 'TDS Development Group' <freetds AT franklin.oit.unc.edu>
- Subject: Re: killer query
- Date: Wed, 26 Jun 2002 10:59:04 -0500
I would make one request. Once someone figures out the right way to do the
copy, please document it in the code.
Sam Denton, WAN Technologies, Inc.
(314) 428-0888 / (800) 926-7771 Main Office
-----Original Message-----
From: ZIGLIO Frediano [mailto:Frediano.Ziglio AT vodafoneomnitel.it]
Sent: Wednesday, June 26, 2002 7:16 AM
To: TDS Development Group
Subject: [freetds] Re: killer query
>
> Bill,
>
> TDS 7 is little endian only, so there would be no swapping of
> bytes. True
> this is only valid for direct manipulation of the TDS_UNIQUE
> structure.
> The way to deal with this would be to implement the byte swap
> code for
> TDS_UNIQUE in tds_swap_datatype(). Given that SYBUNIQUE -> SYBCHAR
> (currenly) relies on the byte order being little endian, does
> any of this
> matter? If anyone can show me any code that directly manipulates
> SYBUNIQUE then I think a patch is appropriate, otherwise
> let's let it be.
>
> Given that SYBUNIQUE is not part of the original spec no
> programs should
> be doing anything with it other than binding as char. But
> again, if there
> is any reason to treat TDS_UNIQUE as anything other than
> opaque, we should
> fix it.
>
> Brian
>
Watching code more deeply bytes are swapped on tds_swap_datatype() for big
endian machines, so copy beetwen struct should work fine (is same packed
data). But in tds_convert_unique we convert uuid to string using always a
bigendian representation
(from src/tds/convert.c)
any.c = malloc(37);
sprintf(any.c,"%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%
02X%02X",
buf[0], buf[1], buf[2], buf[3],
buf[4], buf[5],
buf[6], buf[7],
buf[8], buf[9],
buf[10], buf[11], buf[12], buf[13], buf[14], buf[15]);
Executing this code (from Sql query analizer)
create table #temp ( uuid uniqueidentifier )
insert into #temp values('01020304-0506-0708-0910-111213141516')
select uuid from #temp
Data are returned (on socket stream) in this order
04 03 02 01 06 05 08 07 09 10 11 12 13 14 15 16
freddy77
=================================
"STRICTLY PERSONAL AND CONFIDENTIAL
This message may contain confidential and proprietary material for the sole
use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you are not the intended recipient please contact
the sender and delete all copies.
The contents of this message that do not relate to the official business of
our company shall be understood as neither given nor endorsed by it."
=================================
---
You are currently subscribed to freetds as: [denton AT wantec.com]
To unsubscribe, forward this message to
$subst('Email.Unsub')
-
Re: killer query
, (continued)
- Re: killer query, Brian Bruns, 06/25/2002
- Re: killer query, James K. Lowden, 06/25/2002
- Re: killer query, ZIGLIO Frediano, 06/26/2002
- Re: killer query, Bill Thompson, 06/26/2002
- Re: killer query, ZIGLIO Frediano, 06/26/2002
- Re: killer query, Bill Thompson, 06/26/2002
- Re: killer query, Brian Bruns, 06/26/2002
- Re: killer query, ZIGLIO Frediano, 06/26/2002
- Re: killer query, Bill Thompson, 06/26/2002
- Re: killer query, ZIGLIO Frediano, 06/26/2002
- Re: killer query, Sam Denton, 06/26/2002
- Re: killer query, Lowden, James K, 06/26/2002
- Re: killer query, ZIGLIO Frediano, 06/27/2002
Archive powered by MHonArc 2.6.24.