Skip to Content.
Sympa Menu

freetds - [freetds] TDS 9... fun stuff

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: [freetds] TDS 9... fun stuff
  • Date: Mon, 27 Aug 2007 08:54:16 +0200

I'm just analyzing TDS 9 protocol updates. One of the changes is MARS
header (quite catched) and DONE count. TDS_DONE tokens is 4 bytes
longer... I supposed that they update counter to 64-bit... How to
discover this?? Just return more than 2^32 rows !!! With these commands



create table #tmp1(a tinyint not null)
go

insert into #tmp1 values(0)
insert into #tmp1 values(1)
insert into #tmp1 values(2)
insert into #tmp1 values(3)
insert into #tmp1 values(4)
insert into #tmp1 values(5)
insert into #tmp1 values(6)
insert into #tmp1 values(7)
insert into #tmp1 values(8)
insert into #tmp1 values(9)
insert into #tmp1 values(10)
insert into #tmp1 values(11)
insert into #tmp1 values(12)
insert into #tmp1 values(13)
insert into #tmp1 values(14)
insert into #tmp1 values(15)
insert into #tmp1 values(255)
go

insert into #tmp1 select a+16 from #tmp1 where a < 16
go

insert into #tmp1 select a+32 from #tmp1 where a < 32
go

insert into #tmp1 select a+64 from #tmp1 where a < 64
go

insert into #tmp1 select a+128 from #tmp1 where a < 128
go

select count_big(*) from #tmp1 a, #tmp1 b, #tmp1 c, #tmp1 d
go

select a.a ^ b.a ^ c.a ^ d.a as c from #tmp1 a, #tmp1 b, #tmp1 c, #tmp1
d
go


you can do it... just wait some time (it took more than a day!) and a
small logger program (I have still to publish, it's an easy port
forwarder that limit logs...) I got these finally rows:

03e0 3b d1 3a d1 39 d1 38 d1-37 d1 36 d1 35 d1 34 d1 |;.:.9.8. 7.6.5.4.|
03f0 33 d1 32 d1 31 d1 30 d1-2f d1 2e d1 2d d1 2c d1 |3.2.1.0. /...-.,.|
data from remote
0000 04 01 00 6c 00 36 0a 00-2b d1 2a d1 29 d1 28 d1 |...l.6.. +.*.).(.|
0010 27 d1 26 d1 25 d1 24 d1-23 d1 22 d1 21 d1 20 d1 |'.&.%.$. #.".!. .|
0020 1f d1 1e d1 1d d1 1c d1-1b d1 1a d1 19 d1 18 d1 |........ ........|
0030 17 d1 16 d1 15 d1 14 d1-13 d1 12 d1 11 d1 10 d1 |........ ........|
0040 0f d1 0e d1 0d d1 0c d1-0b d1 0a d1 09 d1 08 d1 |........ ........|
0050 07 d1 06 d1 05 d1 04 d1-03 d1 02 d1 01 d1 00 fd |........ ........|
0060 10 00 c1 00 01 04 06 04-01 00 00 00 |........ ....|

As expected 257 * 257 * 257 * 257 = 4362470401 = 104060401 = 01 04 06 04
01 00 00 00. Row count is now 64-bit!

I'm currently working on login bits and chunked data (like new
varchar/varbinary protocol)

freddy77



  • [freetds] TDS 9... fun stuff, ZIGLIO, Frediano, VF-IT, 08/27/2007

Archive powered by MHonArc 2.6.24.

Top of Page