Skip to Content.
Sympa Menu

freetds - Re: [freetds] Fw: Free TDS with MS SQL Server 2005

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Craig Johannsen <craigj AT ca.sophos.com>
  • To: "James K. Lowden" <jklowden AT freetds.org>, FreeTDS <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Fw: Free TDS with MS SQL Server 2005
  • Date: Mon, 12 Mar 2007 18:50:37 +0000

I upgraded my freetds version from 0.62.3 to 0.64, which appears to have fixed the varchar truncation problem. On Gentoo, 0.64 is only in test status, not release, but works well enough for my purposes at present.

Here is the trace of the prepare that I was getting with version 0.62.3. Note that P4 is varchar(1):

Sending packet @ 18:34:37.690527
0000 03 01 01 94 00 00 01 00-0a 00 73 00 70 00 5f 00 |........ ..s.p._.|
0010 70 00 72 00 65 00 70 00-61 00 72 00 65 00 00 00 |p.r.e.p. a.r.e...|
0020 00 01 26 04 00 00 00 63-dc 00 00 00 dc 00 00 00 |..&....c ........|
0030 40 00 50 00 31 00 20 00-56 00 41 00 52 00 43 00 |@.P.1. . V.A.R.C.|
0040 48 00 41 00 52 00 28 00-38 00 30 00 29 00 2c 00 |H.A.R.(. 8.0.).,.|
0050 40 00 50 00 32 00 20 00-56 00 41 00 52 00 43 00 |@.P.2. . V.A.R.C.|
0060 48 00 41 00 52 00 28 00-38 00 30 00 29 00 2c 00 |H.A.R.(. 8.0.).,.|
0070 40 00 50 00 33 00 20 00-56 00 41 00 52 00 43 00 |@.P.3. . V.A.R.C.|
0080 48 00 41 00 52 00 28 00-38 00 30 00 29 00 2c 00 |H.A.R.(. 8.0.).,.|
0090 40 00 50 00 34 00 20 00-56 00 41 00 52 00 43 00 |@.P.4. . V.A.R.C.|
00a0 48 00 41 00 52 00 28 00-31 00 29 00 2c 00 40 00 |H.A.R.(. 1.).,.@.|
00b0 50 00 35 00 20 00 56 00-41 00 52 00 43 00 48 00 |P.5. .V. A.R.C.H.|
00c0 41 00 52 00 28 00 38 00-30 00 29 00 2c 00 40 00 |A.R.(.8. 0.).,.@.|
00d0 50 00 36 00 20 00 56 00-41 00 52 00 43 00 48 00 |P.6. .V. A.R.C.H.|
00e0 41 00 52 00 28 00 38 00-30 00 29 00 2c 00 40 00 |A.R.(.8. 0.).,.@.|
00f0 50 00 37 00 20 00 56 00-41 00 52 00 43 00 48 00 |P.7. .V. A.R.C.H.|
0100 41 00 52 00 28 00 38 00-30 00 29 00 00 00 63 76 |A.R.(.8. 0.)...cv|
0110 00 00 00 76 00 00 00 20-00 69 00 6e 00 73 00 65 |...v... .i.n.s.e|
0120 00 72 00 74 00 20 00 69-00 6e 00 74 00 6f 00 20 |.r.t. .i .n.t.o. |
0130 00 69 00 70 00 5f 00 73-00 74 00 61 00 74 00 75 |.i.p._.s .t.a.t.u|
0140 00 73 00 20 00 76 00 61-00 6c 00 75 00 65 00 73 |.s. .v.a .l.u.e.s|
0150 00 28 00 40 00 50 00 31-00 2c 00 40 00 50 00 32 |.(.@.P.1 .,.@.P.2|
0160 00 2c 00 40 00 50 00 33-00 2c 00 40 00 50 00 34 |.,.@.P.3 .,.@.P.4|
0170 00 2c 00 40 00 50 00 35-00 2c 00 40 00 50 00 36 |.,.@.P.5 .,.@.P.6|
0180 00 2c 00 40 00 50 00 37-00 29 00 20 00 00 00 38 |.,.@.P.7 .). ...8|
0190 01 00 00 00 - |....|

And here is the same packet for version 0.64. Note that P4 is varchar(80):

net.c:673:Sending packet
0000 03 01 01 98 00 00 01 00-0a 00 73 00 70 00 5f 00 |........ ..s.p._.|
0010 70 00 72 00 65 00 70 00-61 00 72 00 65 00 00 00 |p.r.e.p. a.r.e...|
0020 00 01 26 04 00 00 00 63-de 00 00 00 de 00 00 00 |..&....c ........|
0030 40 00 50 00 31 00 20 00-76 00 61 00 72 00 63 00 |@.P.1. . v.a.r.c.|
0040 68 00 61 00 72 00 28 00-38 00 30 00 29 00 2c 00 |h.a.r.(. 8.0.).,.|
0050 40 00 50 00 32 00 20 00-76 00 61 00 72 00 63 00 |@.P.2. . v.a.r.c.|
0060 68 00 61 00 72 00 28 00-38 00 30 00 29 00 2c 00 |h.a.r.(. 8.0.).,.|
0070 40 00 50 00 33 00 20 00-76 00 61 00 72 00 63 00 |@.P.3. . v.a.r.c.|
0080 68 00 61 00 72 00 28 00-38 00 30 00 29 00 2c 00 |h.a.r.(. 8.0.).,.|
0090 40 00 50 00 34 00 20 00-76 00 61 00 72 00 63 00 |@.P.4. . v.a.r.c.|
00a0 68 00 61 00 72 00 28 00-38 00 30 00 29 00 2c 00 |h.a.r.(. 8.0.).,.|
00b0 40 00 50 00 35 00 20 00-76 00 61 00 72 00 63 00 |@.P.5. . v.a.r.c.|
00c0 68 00 61 00 72 00 28 00-38 00 30 00 29 00 2c 00 |h.a.r.(. 8.0.).,.|
00d0 40 00 50 00 36 00 20 00-76 00 61 00 72 00 63 00 |@.P.6. . v.a.r.c.|
00e0 68 00 61 00 72 00 28 00-38 00 30 00 29 00 2c 00 |h.a.r.(. 8.0.).,.|
00f0 40 00 50 00 37 00 20 00-76 00 61 00 72 00 63 00 |@.P.7. . v.a.r.c.|
0100 68 00 61 00 72 00 28 00-38 00 30 00 29 00 00 00 |h.a.r.(. 8.0.)...|
0110 63 76 00 00 00 76 00 00-00 20 00 69 00 6e 00 73 |cv...v.. . .i.n.s|
0120 00 65 00 72 00 74 00 20-00 69 00 6e 00 74 00 6f |.e.r.t. .i.n.t.o|
0130 00 20 00 69 00 70 00 5f-00 73 00 74 00 61 00 74 |. .i.p._ .s.t.a.t|
0140 00 75 00 73 00 20 00 76-00 61 00 6c 00 75 00 65 |.u.s. .v .a.l.u.e|
0150 00 73 00 28 00 40 00 50-00 31 00 2c 00 40 00 50 |.s.(.@.P .1.,.@.P|
0160 00 32 00 2c 00 40 00 50-00 33 00 2c 00 40 00 50 |.2.,.@.P .3.,.@.P|
0170 00 34 00 2c 00 40 00 50-00 35 00 2c 00 40 00 50 |.4.,.@.P .5.,.@.P|
0180 00 36 00 2c 00 40 00 50-00 37 00 29 00 20 00 00 |.6.,.@.P .7.). ..|
0190 00 26 04 04 01 00 00 00- |.&......|

Does varchar(80) above mean that data will be truncated to 80 characters?

Cheers and thanks for your help,
Craig Johannsen
Sophos Labs

James K. Lowden wrote:
I appears you just need to upgrade.
Begin forwarded message:

Date: Mon, 12 Mar 2007 08:59:16 +0100
From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
Subject: Re: [freetds] Fw: Free TDS with MS SQL Server 2005


The below message was sent to me offlist. I'm forwarding it here because
it might be important.
--jkl


Fixed for ODBC many time ago. The problem occur cause you have to
reprepare statement.
It would be helpful to know which freetds version is using...

freddy77

Begin forwarded message:

Date: Sat, 10 Mar 2007 00:23:19 +0000
Subject: Free TDS with MS SQL Server 2005


I have Free TDS and unixODBC working on Gentoo Linux talking to MS SQL Server 2005 Enterprise on MS Windows 2003 Enterprise Server using protocol version 7.0.

One problem, though, is that if the first insert using placeholders contains a varchar column that is null, then subsequent inserts into that column will be truncated to one character. Otherwise, most things I have tried have worked.

_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page