Skip to Content.
Sympa Menu

freetds - [freetds] Still done handling... again

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] Still done handling... again
  • Date: Tue, 3 May 2005 13:04:54 +0200

Well, as usual I'm doing come tests with ODBC. I discovered that ms odbc
try to read as mush as done/param/status tokens as it can. As result
connection is free after last SQLFetch. However it collapse multiple
done causing on prepared statement like

select
update

to return a single result set with wrong row number (from update) but
correct columns (from select)...

In FreeTDS the above sequence cause 2 result set, one for select and one
for update.

However I discovered a weird situation... raiserror test create a this
procedure

CREATE PROCEDURE #tmp1
@InParam int,
@OutParam int OUTPUT,
@OutString varchar(20) OUTPUT
AS
SET @OutParam = @InParam
SET @OutString = 'This is bogus!'
SELECT 'Here is the first row' AS FirstResult
RAISERROR('An error occurred.', @InParam, 1)
SELECT 'Here is the last row' AS LastResult WHERE 0=1
RETURN (0)

It return this packet

0000 ff 11 00 c1 00 01 00 00-00 ff 11 00 c1 00 01 00 |........ ........|
0010 00 00 81 01 00 00 00 00-00 a7 15 00 09 04 d0 00 |........ ........|
0020 34 0b 46 00 69 00 72 00-73 00 74 00 52 00 65 00 |4.F.i.r. s.t.R.e.|
0030 73 00 75 00 6c 00 74 00-d1 15 00 48 65 72 65 20 |s.u.l.t. ...Here |
0040 69 73 20 74 68 65 20 66-69 72 73 74 20 72 6f 77 |is the f irst row|
0050 ff 11 00 c1 00 01 00 00-00 ab 3e 01 50 c3 00 00 |........ ..>.P...|
0060 01 05 12 00 41 00 6e 00-20 00 65 00 72 00 72 00 |....A.n. .e.r.r.|
0070 6f 00 72 00 20 00 6f 00-63 00 63 00 75 00 72 00 |o.r. .o. c.c.u.r.|
0080 72 00 65 00 64 00 2e 00-07 4f 00 50 00 44 00 4e |r.e.d... .O.P.D.N|
0090 00 31 00 30 00 36 00 80-23 00 74 00 6d 00 70 00 |.1.0.6.. #.t.m.p.|
00a0 31 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |1._._._. _._._._.|
00b0 5f 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |_._._._. _._._._.|
00c0 5f 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |_._._._. _._._._.|
00d0 5f 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |_._._._. _._._._.|
00e0 5f 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |_._._._. _._._._.|
00f0 5f 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |_._._._. _._._._.|
0100 5f 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |_._._._. _._._._.|
0110 5f 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |_._._._. _._._._.|
0120 5f 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |_._._._. _._._._.|
0130 5f 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |_._._._. _._._._.|
0140 5f 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |_._._._. _._._._.|
0150 5f 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |_._._._. _._._._.|
0160 5f 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |_._._._. _._._._.|
0170 5f 00 5f 00 5f 00 5f 00-5f 00 5f 00 5f 00 5f 00 |_._._._. _._._._.|
0180 5f 00 5f 00 5f 00 5f 00-30 00 30 00 30 00 30 00 |_._._._. 0.0.0.0.|
0190 30 00 34 00 42 00 44 00-09 00 ff 01 00 f6 00 00 |0.4.B.D. ........|
01a0 00 00 00 81 01 00 00 00-00 00 a7 14 00 09 04 d0 |........ ........|
01b0 00 34 0a 4c 00 61 00 73-00 74 00 52 00 65 00 73 |.4.L.a.s .t.R.e.s|
01c0 00 75 00 6c 00 74 00 ff-11 00 c1 00 00 00 00 00 |.u.l.t.. ........|
01d0 ff 11 00 c1 00 01 00 00-00 79 00 00 00 00 ac 0d |........ .y......|
01e0 00 00 01 38 00 00 00 26-04 04 05 00 00 00 ac 1e |...8...& ........|
01f0 00 00 01 a7 00 00 00 a7-14 00 09 04 d0 00 34 0e |........ ......4.|
0200 00 54 68 69 73 20 69 73-20 62 6f 67 75 73 21 fe |.This is bogus!.|
0210 00 00 e0 00 01 00 00 00- |........|

Look at the end !!! After 'LastResult' row there are 2 doneinproc, one
for select and one for return!!! However these tokens are
indistinguible!!! Even statement type is the same (0x00C1). The only way
to distinguish them is that first "select" has some rows before... Now
how to fix it? Reproduce strange MS way or detect wrong "select"
doneinproc tokens??

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page