Skip to Content.
Sympa Menu

freetds - [freetds] FreeTDS (CVS version) hangs on reading column data larger than 256 bytes

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Chad Wagner <vdr781 AT yahoo.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] FreeTDS (CVS version) hangs on reading column data larger than 256 bytes
  • Date: Sun, 13 Apr 2003 17:10:40 -0700 (PDT)

Attached is a patch which appears to fix this problem.
A good test for it is "SELECT @@version", when the
column data exceeds the temp space the routine needs
to loop twice to do the conversion, but in_left is
adjusted to 0 by iconv routines, which then in_left
would need to be adjusted to the remaining data on the
wire to do the final conversion on remaining data.


BTW, I am using TDS 7.0 with SQL Server 2000, libiconv
1.8, and Linux 2.2.22.


Received packet @ 2003-04-13 20:03:34.063375
0000 81 01 00 00 00 01 00 e7 58 02 00 d1 76 01 4d 00
|........ X...v.M.|
0010 69 00 63 00 72 00 6f 00 73 00 6f 00 66 00 74 00
|i.c.r.o. s.o.f.t.|
0020 20 00 53 00 51 00 4c 00 20 00 53 00 65 00 72 00
| .S.Q.L. .S.e.r.|
0030 76 00 65 00 72 00 20 00 20 00 32 00 30 00 30 00
|v.e.r. . .2.0.0.|
0040 30 00 20 00 2d 00 20 00 38 00 2e 00 30 00 30 00
|0. .-. . 8...0.0.|
0050 2e 00 37 00 36 00 30 00 20 00 28 00 49 00 6e 00
|..7.6.0. .(.I.n.|
0060 74 00 65 00 6c 00 20 00 58 00 38 00 36 00 29 00
|t.e.l. . X.8.6.).|
0070 20 00 0a 00 09 00 44 00 65 00 63 00 20 00 31 00
| .....D. e.c. .1.|
0080 37 00 20 00 32 00 30 00 30 00 32 00 20 00 31 00
|7. .2.0. 0.2. .1.|
0090 34 00 3a 00 32 00 32 00 3a 00 30 00 35 00 20 00
|4.:.2.2. :.0.5. .|
00a0 0a 00 09 00 43 00 6f 00 70 00 79 00 72 00 69 00
|....C.o. p.y.r.i.|
00b0 67 00 68 00 74 00 20 00 28 00 63 00 29 00 20 00
|g.h.t. . (.c.). .|
00c0 31 00 39 00 38 00 38 00 2d 00 32 00 30 00 30 00
|1.9.8.8. -.2.0.0.|
00d0 33 00 20 00 4d 00 69 00 63 00 72 00 6f 00 73 00
|3. .M.i. c.r.o.s.|
00e0 6f 00 66 00 74 00 20 00 43 00 6f 00 72 00 70 00
|o.f.t. . C.o.r.p.|
00f0 6f 00 72 00 61 00 74 00 69 00 6f 00 6e 00 0a 00
|o.r.a.t. i.o.n...|
0100 09 00 44 00 65 00 76 00 65 00 6c 00 6f 00 70 00
|..D.e.v. e.l.o.p.|
0110 65 00 72 00 20 00 45 00 64 00 69 00 74 00 69 00
|e.r. .E. d.i.t.i.|
0120 6f 00 6e 00 20 00 6f 00 6e 00 20 00 57 00 69 00
|o.n. .o. n. .W.i.|
0130 6e 00 64 00 6f 00 77 00 73 00 20 00 4e 00 54 00
|n.d.o.w. s. .N.T.|
0140 20 00 35 00 2e 00 31 00 20 00 28 00 42 00 75 00
| .5...1. .(.B.u.|
0150 69 00 6c 00 64 00 20 00 32 00 36 00 30 00 30 00
|i.l.d. . 2.6.0.0.|
0160 3a 00 20 00 53 00 65 00 72 00 76 00 69 00 63 00
|:. .S.e. r.v.i.c.|
0170 65 00 20 00 50 00 61 00 63 00 6b 00 20 00 31 00
|e. .P.a. c.k. .1.|
0180 29 00 0a 00 fd 10 00 c1 00 01 00 00 00
|)....... .....|


2003-04-13 20:03:34.064807 processing result tokens.
marker is 81(TDS7_RESULT)
2003-04-13 20:03:34.064952 tds7_get_data_info:1199:
type = 39 (varchar)
column_varint_size = 2
colname = (0 bytes)
column_size = 300 (600 on server)
2003-04-13 20:03:34.065685 processing result tokens.
marker is d1(ROW)
2003-04-13 20:03:34.065885 processing row tokens.
marker is d1(ROW)
2003-04-13 20:03:34.065957 processing row. column is
0 varint size = 2
2003-04-13 20:03:34.066025 processing row. column
size is 374
2003-04-13 20:03:34.066098 clearing column 0 NULL bit
tds_get_char_data: reading 374 on wire for 187 to
client


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.comIndex: read.c
===================================================================
RCS file: /cvsroot/freetds/freetds/src/tds/read.c,v
retrieving revision 1.46
diff -u -r1.46 read.c
--- read.c 8 Apr 2003 10:25:42 -0000 1.46
+++ read.c 14 Apr 2003 00:06:39 -0000
@@ -333,8 +333,9 @@
return wire_size;
}
p = dest;
- for (in_left = wire_size; wire_size > 0; ) {
+ for (; wire_size > 0; ) {
int buffer_size;
+ in_left = wire_size;
if (in_left > sizeof(temp))
in_left = sizeof(temp);
tds_get_n(tds, temp, in_left);



Archive powered by MHonArc 2.6.24.

Top of Page