Skip to Content.
Sympa Menu

freetds - RE: [freetds] short read during bcp?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: 'FreeTDS Development Group' <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] short read during bcp?
  • Date: Tue, 16 Dec 2003 17:17:18 -0500

> From: Thompson, Bill D (London) [mailto:bill_d_thompson AT ml.com]
> Sent: December 16, 2003 3:53 AM
>
> I've noticed that the server tends to give up and drop the
> connection if
> there's something wrong with the packets during a bcp 'interchange'

Yep, that's it alright. I don't know why yet, but freebcp sends a series of
full packets:

pid: 10449:Sending packet @ 16:22:59.580757
0000 07 00 02 00 00 00 01 00-74 00 72 00 00 00 09 00 |........ t.r.....|
^^ ^^^^^
| +-- 512 bytes
+-- not last packet

whereas my application interrupts itself; it sends a full and a short
packet, gets an answer (that it reads), and then resends the packets, at
which point the server says goodbye.

In the following, "p.a" is my application; "p.f" is freebcp, same source
data:

jklowden@dec050$ grep '^0000 07' p.a p.f
p.a:0000 07 00 02 00 00 00 01 00-81 13 00 00 00 08 00 38 |........ .......8|
p.a:0000 07 01 01 67 00 00 01 00-74 00 72 00 00 00 09 00 |...g.... t.r.....|
p.a:0000 07 00 02 00 00 00 01 00-81 13 00 00 00 08 00 38 |........ .......8|
p.a:0000 07 01 01 67 00 00 01 00-74 00 72 00 00 00 09 00 |...g.... t.r.....|
p.a:0000 07 00 02 00 00 00 01 00-d1 03 00 00 00 08 00 30 |........ .......0|

p.f:0000 07 00 02 00 00 00 01 00-81 13 00 00 00 08 00 38 |........ .......8|
p.f:0000 07 00 02 00 00 00 01 00-74 00 72 00 00 00 09 00 |........ t.r.....|
p.f:0000 07 00 02 00 00 00 01 00-04 e4 93 00 00 00 00 00 |........ ........|
p.f:0000 07 00 02 00 00 00 01 00-00 01 00 00 00 00 ff ff |........ ........|
p.f:0000 07 00 02 00 00 00 01 00-49 4e 44 55 53 54 52 49 |........ INDUSTRI|
p.f:0000 07 01 01 6b 00 00 01 00-58 43 48 41 4e 47 45 20 |...k.... XCHANGE |

I've attached two pairs of broken packets for your perusal, in case you're
interested. AFAICT, this problem has nothing to do with sockets or parallel
sessions, and everything to do with how the bcp API is employed.

--jkl

pid: 20927:Received header @ 16:23:33.058297
0000 04 01 00 11 00 00 00 00- |........|
pid: 20927:Received packet @ 16:23:33.060249
0000 fd 00 00 c3 00 00 00 00-00 |........ .|
pid: 20927:Sending packet @ 16:23:33.070980
0000 07 00 02 00 00 00 01 00-81 13 00 00 00 08 00 38 |........ .......8|
0010 12 53 00 70 00 63 00 50-00 65 00 72 00 6d 00 61 |.S.p.c.P .e.r.m.a|
0020 00 6e 00 65 00 6e 00 74-00 4e 00 75 00 6d 00 62 |.n.e.n.t .N.u.m.b|
0030 00 65 00 72 00 00 00 0a-00 af 08 00 07 43 00 73 |.e.r.... .....C.s|
0040 00 43 00 75 00 73 00 69-00 70 00 00 00 0b 00 a7 |.C.u.s.i .p......|
0050 1c 00 0b 43 00 6f 00 6d-00 70 00 61 00 6e 00 79 |...C.o.m .p.a.n.y|
0060 00 4e 00 61 00 6d 00 65-00 00 00 0b 00 a7 08 00 |.N.a.m.e ........|
0070 0b 53 00 74 00 6f 00 63-00 6b 00 54 00 69 00 63 |.S.t.o.c .k.T.i.c|
0080 00 6b 00 65 00 72 00 00-00 08 00 38 07 43 00 73 |.k.e.r.. ...8.C.s|
0090 00 5a 00 6c 00 69 00 73-00 74 00 00 00 09 00 6f |.Z.l.i.s .t.....o|
00a0 04 03 49 00 70 00 6f 00-00 00 09 00 6f 04 18 43 |..I.p.o. ....o..C|
00b0 00 73 00 43 00 6f 00 76-00 65 00 72 00 61 00 67 |.s.C.o.v .e.r.a.g|
00c0 00 65 00 42 00 65 00 67-00 69 00 6e 00 49 00 6e |.e.B.e.g .i.n.I.n|
00d0 00 63 00 6c 00 75 00 73-00 69 00 76 00 65 00 00 |.c.l.u.s .i.v.e..|
00e0 00 09 00 6f 04 16 43 00-73 00 43 00 6f 00 76 00 |...o..C. s.C.o.v.|
00f0 65 00 72 00 61 00 67 00-65 00 45 00 6e 00 64 00 |e.r.a.g. e.E.n.d.|
0100 45 00 78 00 63 00 6c 00-75 00 73 00 69 00 76 00 |E.x.c.l. u.s.i.v.|
0110 65 00 00 00 09 00 26 02-1c 45 00 61 00 72 00 6c |e.....&. .E.a.r.l|
0120 00 69 00 65 00 73 00 74-00 41 00 6e 00 6e 00 75 |.i.e.s.t .A.n.n.u|
0130 00 61 00 6c 00 44 00 61-00 74 00 61 00 46 00 69 |.a.l.D.a .t.a.F.i|
0140 00 73 00 63 00 61 00 6c-00 59 00 65 00 61 00 72 |.s.c.a.l .Y.e.a.r|
0150 00 00 00 09 00 26 02 1a-4c 00 61 00 74 00 65 00 |.....&.. L.a.t.e.|
0160 73 00 74 00 41 00 6e 00-6e 00 75 00 61 00 6c 00 |s.t.A.n. n.u.a.l.|
0170 44 00 61 00 74 00 61 00-46 00 69 00 73 00 63 00 |D.a.t.a. F.i.s.c.|
0180 61 00 6c 00 59 00 65 00-61 00 72 00 00 00 09 00 |a.l.Y.e. a.r.....|
0190 26 02 1b 45 00 61 00 72-00 6c 00 69 00 65 00 73 |&..E.a.r .l.i.e.s|
01a0 00 74 00 51 00 74 00 72-00 6c 00 79 00 44 00 61 |.t.Q.t.r .l.y.D.a|
01b0 00 74 00 61 00 46 00 69-00 73 00 63 00 61 00 6c |.t.a.F.i .s.c.a.l|
01c0 00 59 00 65 00 61 00 72-00 00 00 09 00 26 01 1a |.Y.e.a.r .....&..|
01d0 45 00 61 00 72 00 6c 00-69 00 65 00 73 00 74 00 |E.a.r.l. i.e.s.t.|
01e0 51 00 74 00 72 00 6c 00-79 00 44 00 61 00 74 00 |Q.t.r.l. y.D.a.t.|
01f0 61 00 46 00 69 00 73 00-63 00 61 00 6c 00 51 00 |a.F.i.s. c.a.l.Q.|
pid: 20927:Sending packet @ 16:23:33.087564
0000 07 01 01 67 00 00 01 00-74 00 72 00 00 00 09 00 |...g.... t.r.....|
0010 26 02 19 4c 00 61 00 74-00 65 00 73 00 74 00 51 |&..L.a.t .e.s.t.Q|
0020 00 74 00 72 00 6c 00 79-00 44 00 61 00 74 00 61 |.t.r.l.y .D.a.t.a|
0030 00 46 00 69 00 73 00 63-00 61 00 6c 00 59 00 65 |.F.i.s.c .a.l.Y.e|
0040 00 61 00 72 00 00 00 09-00 26 01 18 4c 00 61 00 |.a.r.... .&..L.a.|
0050 74 00 65 00 73 00 74 00-51 00 74 00 72 00 6c 00 |t.e.s.t. Q.t.r.l.|
0060 79 00 44 00 61 00 74 00-61 00 46 00 69 00 73 00 |y.D.a.t. a.F.i.s.|
0070 63 00 61 00 6c 00 51 00-74 00 72 00 00 00 08 00 |c.a.l.Q. t.r.....|
0080 38 09 41 00 76 00 61 00-69 00 6c 00 46 00 6c 00 |8.A.v.a. i.l.F.l.|
0090 61 00 67 00 00 00 08 00-38 16 49 00 6e 00 64 00 |a.g..... 8.I.n.d.|
00a0 75 00 73 00 74 00 72 00-79 00 43 00 6c 00 61 00 |u.s.t.r. y.C.l.a.|
00b0 73 00 73 00 69 00 66 00-69 00 63 00 61 00 74 00 |s.s.i.f. i.c.a.t.|
00c0 69 00 6f 00 6e 00 00 00-09 00 26 04 04 47 00 69 |i.o.n... ..&..G.i|
00d0 00 63 00 73 00 00 00 0b-00 a7 06 00 05 4e 00 61 |.c.s.... .....N.a|
00e0 00 69 00 63 00 73 00 00-00 0b 00 a7 23 00 0c 49 |.i.c.s.. ....#..I|
00f0 00 6e 00 64 00 75 00 73-00 74 00 72 00 79 00 4e |.n.d.u.s .t.r.y.N|
0100 00 61 00 6d 00 65 00 d1-01 00 00 00 08 00 30 30 |.a.m.e.. ......00|
0110 30 30 30 30 30 30 13 00-53 26 50 20 49 4e 44 55 |000000.. S&P INDU|
0120 53 54 52 49 41 4c 53 2d-57 45 44 05 00 49 30 30 |STRIALS- WED..I00|
0130 30 31 00 00 00 00 00 04-93 58 00 00 04 e4 93 00 |01...... .X......|
0140 00 00 00 00 00 00 00 69-00 20 00 01 00 00 00 00 |.......i . ......|
0150 ff ff 13 00 53 26 50 20-49 4e 44 55 53 54 52 49 |....S&P INDUSTRI|
0160 41 4c 53 2d 57 45 44 - |ALS-WED|
pid: 20927:Received header @ 16:23:33.211604
0000 04 01 00 11 00 00 00 00- |........|
pid: 20927:Received packet @ 16:23:33.211604
0000 fd 10 00 f0 00 01 00 00-00 |........ .|
pid: 20927:Sending packet @ 16:23:33.221379
0000 07 00 02 00 00 00 01 00-81 13 00 00 00 08 00 38 |........ .......8|
0010 12 53 00 70 00 63 00 50-00 65 00 72 00 6d 00 61 |.S.p.c.P .e.r.m.a|
0020 00 6e 00 65 00 6e 00 74-00 4e 00 75 00 6d 00 62 |.n.e.n.t .N.u.m.b|
0030 00 65 00 72 00 00 00 0a-00 af 08 00 07 43 00 73 |.e.r.... .....C.s|
0040 00 43 00 75 00 73 00 69-00 70 00 00 00 0b 00 a7 |.C.u.s.i .p......|
0050 1c 00 0b 43 00 6f 00 6d-00 70 00 61 00 6e 00 79 |...C.o.m .p.a.n.y|
0060 00 4e 00 61 00 6d 00 65-00 00 00 0b 00 a7 08 00 |.N.a.m.e ........|
0070 0b 53 00 74 00 6f 00 63-00 6b 00 54 00 69 00 63 |.S.t.o.c .k.T.i.c|
0080 00 6b 00 65 00 72 00 00-00 08 00 38 07 43 00 73 |.k.e.r.. ...8.C.s|
0090 00 5a 00 6c 00 69 00 73-00 74 00 00 00 09 00 6f |.Z.l.i.s .t.....o|
00a0 04 03 49 00 70 00 6f 00-00 00 09 00 6f 04 18 43 |..I.p.o. ....o..C|
00b0 00 73 00 43 00 6f 00 76-00 65 00 72 00 61 00 67 |.s.C.o.v .e.r.a.g|
00c0 00 65 00 42 00 65 00 67-00 69 00 6e 00 49 00 6e |.e.B.e.g .i.n.I.n|
00d0 00 63 00 6c 00 75 00 73-00 69 00 76 00 65 00 00 |.c.l.u.s .i.v.e..|
00e0 00 09 00 6f 04 16 43 00-73 00 43 00 6f 00 76 00 |...o..C. s.C.o.v.|
00f0 65 00 72 00 61 00 67 00-65 00 45 00 6e 00 64 00 |e.r.a.g. e.E.n.d.|
0100 45 00 78 00 63 00 6c 00-75 00 73 00 69 00 76 00 |E.x.c.l. u.s.i.v.|
0110 65 00 00 00 09 00 26 02-1c 45 00 61 00 72 00 6c |e.....&. .E.a.r.l|
0120 00 69 00 65 00 73 00 74-00 41 00 6e 00 6e 00 75 |.i.e.s.t .A.n.n.u|
0130 00 61 00 6c 00 44 00 61-00 74 00 61 00 46 00 69 |.a.l.D.a .t.a.F.i|
0140 00 73 00 63 00 61 00 6c-00 59 00 65 00 61 00 72 |.s.c.a.l .Y.e.a.r|
0150 00 00 00 09 00 26 02 1a-4c 00 61 00 74 00 65 00 |.....&.. L.a.t.e.|
0160 73 00 74 00 41 00 6e 00-6e 00 75 00 61 00 6c 00 |s.t.A.n. n.u.a.l.|
0170 44 00 61 00 74 00 61 00-46 00 69 00 73 00 63 00 |D.a.t.a. F.i.s.c.|
0180 61 00 6c 00 59 00 65 00-61 00 72 00 00 00 09 00 |a.l.Y.e. a.r.....|
0190 26 02 1b 45 00 61 00 72-00 6c 00 69 00 65 00 73 |&..E.a.r .l.i.e.s|
01a0 00 74 00 51 00 74 00 72-00 6c 00 79 00 44 00 61 |.t.Q.t.r .l.y.D.a|
01b0 00 74 00 61 00 46 00 69-00 73 00 63 00 61 00 6c |.t.a.F.i .s.c.a.l|
01c0 00 59 00 65 00 61 00 72-00 00 00 09 00 26 01 1a |.Y.e.a.r .....&..|
01d0 45 00 61 00 72 00 6c 00-69 00 65 00 73 00 74 00 |E.a.r.l. i.e.s.t.|
01e0 51 00 74 00 72 00 6c 00-79 00 44 00 61 00 74 00 |Q.t.r.l. y.D.a.t.|
01f0 61 00 46 00 69 00 73 00-63 00 61 00 6c 00 51 00 |a.F.i.s. c.a.l.Q.|
pid: 20927:Sending packet @ 16:23:33.246796
0000 07 01 01 67 00 00 01 00-74 00 72 00 00 00 09 00 |...g.... t.r.....|
0010 26 02 19 4c 00 61 00 74-00 65 00 73 00 74 00 51 |&..L.a.t .e.s.t.Q|
0020 00 74 00 72 00 6c 00 79-00 44 00 61 00 74 00 61 |.t.r.l.y .D.a.t.a|
0030 00 46 00 69 00 73 00 63-00 61 00 6c 00 59 00 65 |.F.i.s.c .a.l.Y.e|
0040 00 61 00 72 00 00 00 09-00 26 01 18 4c 00 61 00 |.a.r.... .&..L.a.|
0050 74 00 65 00 73 00 74 00-51 00 74 00 72 00 6c 00 |t.e.s.t. Q.t.r.l.|
0060 79 00 44 00 61 00 74 00-61 00 46 00 69 00 73 00 |y.D.a.t. a.F.i.s.|
0070 63 00 61 00 6c 00 51 00-74 00 72 00 00 00 08 00 |c.a.l.Q. t.r.....|
0080 38 09 41 00 76 00 61 00-69 00 6c 00 46 00 6c 00 |8.A.v.a. i.l.F.l.|
0090 61 00 67 00 00 00 08 00-38 16 49 00 6e 00 64 00 |a.g..... 8.I.n.d.|
00a0 75 00 73 00 74 00 72 00-79 00 43 00 6c 00 61 00 |u.s.t.r. y.C.l.a.|
00b0 73 00 73 00 69 00 66 00-69 00 63 00 61 00 74 00 |s.s.i.f. i.c.a.t.|
00c0 69 00 6f 00 6e 00 00 00-09 00 26 04 04 47 00 69 |i.o.n... ..&..G.i|
00d0 00 63 00 73 00 00 00 0b-00 a7 06 00 05 4e 00 61 |.c.s.... .....N.a|
00e0 00 69 00 63 00 73 00 00-00 0b 00 a7 23 00 0c 49 |.i.c.s.. ....#..I|
00f0 00 6e 00 64 00 75 00 73-00 74 00 72 00 79 00 4e |.n.d.u.s .t.r.y.N|
0100 00 61 00 6d 00 65 00 d1-02 00 00 00 08 00 30 30 |.a.m.e.. ......00|
0110 30 30 30 30 30 30 13 00-53 26 50 20 49 4e 44 55 |000000.. S&P INDU|
0120 53 54 52 49 41 4c 53 2d-4c 54 44 05 00 49 30 30 |STRIALS- LTD..I00|
0130 30 32 00 00 00 00 00 04-93 58 00 00 04 e4 93 00 |02...... .X......|
0140 00 00 00 00 00 00 00 69-00 20 00 02 00 00 00 00 |.......i . ......|
0150 ff ff 13 00 53 26 50 20-49 4e 44 55 53 54 52 49 |....S&P INDUSTRI|
0160 41 4c 53 2d 4c 54 44 - |ALS-LTD|


-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the original
message. Please note that we do not accept account orders and/or instructions
by e-mail, and therefore will not be responsible for carrying out such orders
and/or instructions.






Archive powered by MHonArc 2.6.24.

Top of Page