[freetds] Problems with nvarchar

Johnny Ljunggren johnny at navtek.no
Mon May 12 14:25:55 EDT 2003


On Mon, 12 May 2003 17:56:27 +0200
"ZIGLIO Frediano" <Frediano.Ziglio at mail.vodafone.it> wrote:

> > 
> > I have this system:
> > MS SQL 2000 sp2, freetds-0.62.dev.20030508, unixODBC-2.2.5
> > 
<snip db setup>
> >
> > If I run the isql-program that comes with unixODBC, I connect 
> > OK and try
> > this statement:
> > select * from text;
> > That should return 'Excellent test' but return this:
> > +---------------------+
> > | text                |
> > +---------------------+
> > |                     |
> > +---------------------+
> > 1 rows affected
> > 1 rows returned
> 
> > (using current CVS, of course...)

I'm using the version from thursday. Hopefully that is current enough?

> Are you using TDS8 or TDS7 ??

I was using TDS7, but I changed tds version to 8.0 in freetds.conf, but
the problem persists. 
 
> Try setting TDSDUMP to a file and send file (check file and remove
> possible secret information, login packet, with password,  is
> automatically removed from log)

Here goes (also at http://www.navtek.no/~johnny/freetds/tdsdump.txt):
Starting log file for FreeTDS 0.62.dev.20030508
	on 2003-05-12 20:17:52 with debug level 99.
iconv to convert client-side data to the "ISO-8859-1" character set
20:17:52.866157 tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
20:17:52.866246 tds_iconv_info_init: converting
"ANSI_X3.4-1968"->"UCS-2LE" 20:17:52.866286 Connecting to 192.168.0.21
port 1433, TDS 8.0. 20:17:52.866964 tds_put_string converting 4 bytes of
"SNIP" 20:17:52.867071 tds_put_string wrote 8 bytes
20:17:52.867097 tds_put_string converting 9 bytes of "SNIP"
20:17:52.867125 tds_put_string wrote 18 bytes
20:17:52.867155 tds_put_string wrote 0 bytes
20:17:52.867179 tds_put_string converting 6 bytes of "SYBASE"
20:17:52.867206 tds_put_string wrote 12 bytes
20:17:52.867229 tds_put_string wrote 0 bytes
20:17:52.867252 tds_put_string converting 10 bytes of "us_english"
20:17:52.867279 tds_put_string wrote 20 bytes
20:17:52.867302 tds_put_string converting 6 bytes of "JCTest"
20:17:52.867330 tds_put_string wrote 12 bytes
20:17:52.867447 tds_process_login_tokens()
Received header @ 20:17:52.867919
0000 04 01 01 67 00 36 01 00-                        |...g.6..|


Received packet @ 20:17:52.868007
0000 e3 1b 00 01 06 4a 00 43-00 54 00 65 00 73 00 74 |.....J.C .T.e.s.t|
0010 00 06 6d 00 61 00 73 00-74 00 65 00 72 00 ab 5e |..m.a.s. t.e.r..^|
0020 00 45 16 00 00 02 00 25-00 43 00 68 00 61 00 6e |.E.....% .C.h.a.n|
0030 00 67 00 65 00 64 00 20-00 64 00 61 00 74 00 61 |.g.e.d.  .d.a.t.a|
0040 00 62 00 61 00 73 00 65-00 20 00 63 00 6f 00 6e |.b.a.s.e . .c.o.n|
0050 00 74 00 65 00 78 00 74-00 20 00 74 00 6f 00 20 |.t.e.x.t . .t.o. |
0060 00 27 00 4a 00 43 00 54-00 65 00 73 00 74 00 27 |.'.J.C.T .e.s.t.'|
0070 00 2e 00 04 50 00 49 00-4d 00 53 00 00 00 00 e3 |....P.I. M.S.....|
0080 08 00 07 05 09 04 d0 00-00 00 e3 17 00 02 0a 75 |........ .......u|
0090 00 73 00 5f 00 65 00 6e-00 67 00 6c 00 69 00 73 |.s._.e.n .g.l.i.s|
00a0 00 68 00 00 ab 62 00 47-16 00 00 01 00 27 00 43 |.h...b.G .....'.C|
00b0 00 68 00 61 00 6e 00 67-00 65 00 64 00 20 00 6c |.h.a.n.g .e.d. .l|
00c0 00 61 00 6e 00 67 00 75-00 61 00 67 00 65 00 20 |.a.n.g.u .a.g.e. |
00d0 00 73 00 65 00 74 00 74-00 69 00 6e 00 67 00 20 |.s.e.t.t .i.n.g. |
00e0 00 74 00 6f 00 20 00 75-00 73 00 5f 00 65 00 6e |.t.o. .u .s._.e.n|
00f0 00 67 00 6c 00 69 00 73-00 68 00 2e 00 04 50 00 |.g.l.i.s .h....P.|
0100 49 00 4d 00 53 00 00 00-00 ad 36 00 01 71 00 00 |I.M.S... ..6..q..|
0110 01 16 4d 00 69 00 63 00-72 00 6f 00 73 00 6f 00 |..M.i.c. r.o.s.o.|
0120 66 00 74 00 20 00 53 00-51 00 4c 00 20 00 53 00 |f.t. .S. Q.L. .S.|
0130 65 00 72 00 76 00 65 00-72 00 00 00 00 00 08 00 |e.r.v.e. r.......|
0140 02 16 e3 11 00 04 03 35-00 31 00 32 00 04 34 00 |.......5 .1.2..4.|
0150 30 00 39 00 36 00 fd 00-00 00 00 00 00 00 00    |0.9.6... .......|


20:17:52.868538 looking for login token, got  e3(ENVCHANGE)
20:17:52.868570 tds_process_default_tokens() marker is e3(ENVCHANGE)
tds_get_string: need 24 on wire for 6 to client?
tds_get_string: need 24 on wire for 6 to client?
20:17:52.868730 looking for login token, got  ab(INFO)
20:17:52.868757 tds_process_default_tokens() marker is ab(INFO)
tds_get_string: need 148 on wire for 37 to client?
tds_get_string: need 16 on wire for 4 to client?
20:17:52.868872 looking for login token, got  e3(ENVCHANGE)
20:17:52.868899 tds_process_default_tokens() marker is e3(ENVCHANGE)
20:17:52.868927 looking for login token, got  e3(ENVCHANGE)
20:17:52.868952 tds_process_default_tokens() marker is e3(ENVCHANGE)
tds_get_string: need 40 on wire for 10 to client?
20:17:52.869006 looking for login token, got  ab(INFO)
20:17:52.869032 tds_process_default_tokens() marker is ab(INFO)
tds_get_string: need 156 on wire for 39 to client?
tds_get_string: need 16 on wire for 4 to client?
20:17:52.869113 looking for login token, got  ad(LOGINACK)
20:17:52.869141 looking for login token, got  e3(ENVCHANGE)
20:17:52.869166 tds_process_default_tokens() marker is e3(ENVCHANGE)
tds_get_string: need 12 on wire for 3 to client?
tds_get_string: need 16 on wire for 4 to client?
20:17:52.869245 looking for login token, got  fd(DONE)
20:17:52.869304 tds_process_default_tokens() marker is fd(DONE)
20:17:52.869338 tds_process_end() more_results = 0, was_cancelled = 0 
20:17:52.869370 tds_process_default_tokens() setting state to COMPLETED
20:17:52.869400 leaving tds_process_login_tokens() returning 1
20:17:52.869469 tds_put_string converting 19 bytes of "set textsize 64512
" 20:17:52.869500 tds_put_string wrote 38 bytes
Sending packet @ 20:17:52.869529
0000 01 01 00 2e 00 00 01 00-73 00 65 00 74 00 20 00 |........ s.e.t. .|
0010 74 00 65 00 78 00 74 00-73 00 69 00 7a 00 65 00 |t.e.x.t. s.i.z.e.|
0020 20 00 36 00 34 00 35 00-31 00 32 00 20 00       | .6.4.5. 1.2. .|


Received header @ 20:17:52.873862
0000 04 01 00 11 00 36 01 00-                        |.....6..|


Received packet @ 20:17:52.873978
0000 fd 00 00 be 00 00 00 00-00                      |........ .|


20:17:52.874016 processing result tokens.  marker is  fd(DONE)
20:17:52.874047 tds_process_end() more_results = 0, was_cancelled = 0 
20:17:52.874080 tds_process_result_tokens() state is COMPLETED
SQLGetFunctions: fFunction is 1
SQLGetFunctions: fFunction is 2
SQLGetFunctions: fFunction is 1001
SQLGetFunctions: fFunction is 3
SQLGetFunctions: fFunction is 4
SQLGetFunctions: fFunction is 72
SQLGetFunctions: fFunction is 5
SQLGetFunctions: fFunction is 6
SQLGetFunctions: fFunction is 56
SQLGetFunctions: fFunction is 40
SQLGetFunctions: fFunction is 7
SQLGetFunctions: fFunction is 8
SQLGetFunctions: fFunction is 9
SQLGetFunctions: fFunction is 41
SQLGetFunctions: fFunction is 1005
SQLGetFunctions: fFunction is 10
SQLGetFunctions: fFunction is 11
SQLGetFunctions: fFunction is 12
SQLGetFunctions: fFunction is 13
SQLGetFunctions: fFunction is 60
SQLGetFunctions: fFunction is 15
SQLGetFunctions: fFunction is 1006
SQLGetFunctions: fFunction is 16
SQLGetFunctions: fFunction is 14
SQLGetFunctions: fFunction is 42
SQLGetFunctions: fFunction is 43
SQLGetFunctions: fFunction is 1010
SQLGetFunctions: fFunction is 44
SQLGetFunctions: fFunction is 45
SQLGetFunctions: fFunction is 1014
SQLGetFunctions: fFunction is 46
SQLGetFunctions: fFunction is 47
SQLGetFunctions: fFunction is 61
SQLGetFunctions: fFunction is 63
SQLGetFunctions: fFunction is 18
SQLGetFunctions: fFunction is 48
SQLGetFunctions: fFunction is 19
SQLGetFunctions: fFunction is 65
SQLGetFunctions: fFunction is 66
SQLGetFunctions: fFunction is 67
SQLGetFunctions: fFunction is 49
SQLGetFunctions: fFunction is 20
SQLGetFunctions: fFunction is 1016
SQLGetFunctions: fFunction is 50
SQLGetFunctions: fFunction is 1019
SQLGetFunctions: fFunction is 51
SQLGetFunctions: fFunction is 53
SQLGetFunctions: fFunction is 70
SQLGetFunctions: fFunction is 54
SQLGetFunctions: fFunction is 23
SQLGetFunctions: fFunction is 1011
odbc: not implemented: SQLGetInfo: option/type 10000(SQL_XOPEN_CLI_YEAR)
[category Added for ODBC 3.x] 20:17:54.968044 tds_put_string converting 20
bytes of " select * from text;" 20:17:54.968155 tds_put_string wrote 40
bytes Sending packet @ 20:17:54.968184
0000 01 01 00 30 00 00 01 00-20 00 73 00 65 00 6c 00 |...0....  .s.e.l.|
0010 65 00 63 00 74 00 20 00-2a 00 20 00 66 00 72 00 |e.c.t. . *. .f.r.|
0020 6f 00 6d 00 20 00 74 00-65 00 78 00 74 00 3b 00 |o.m. .t. e.x.t.;.|


Received header @ 20:17:54.970854
0000 04 01 00 54 00 36 01 00-                        |...T.6..|


Received packet @ 20:17:54.970943
0000 81 01 00 00 00 09 00 e7-28 00 09 04 d0 00 00 04 |.......ç (...Ð...|
0010 74 00 65 00 78 00 74 00-d1 28 00 45 00 78 00 63 |t.e.x.t. Ñ(.E.x.c|
0020 00 65 00 6c 00 6c 00 65-00 6e 00 74 00 20 00 74 |.e.l.l.e .n.t. .t|
0030 00 65 00 73 00 74 00 20-00 20 00 20 00 20 00 20 |.e.s.t.  . . . . |
0040 00 20 00 fd 10 00 c1 00-01 00 00 00             |. .ý..Á. ....|


20:17:54.971073 processing result tokens.  marker is  81(TDS7_RESULT)
tds_get_string: need 511 on wire for 4 to client?
20:17:54.971185 tds7_get_data_info:1279: 
	type = 39 (varchar)
	column_varint_size = 2
	colname = text (4 bytes)
	column_size = 20 (40 on server)
20:17:54.971259 processing result tokens.  marker is  d1(ROW)
odbc:SQLColAttributes: fDescType is 6
odbc:SQLColAttributes: fDescType is 18
SQLColAttributes: copying 4 bytes, len = 4, cbDescMax = 301
odbc:SQLColAttributes: fDescType is 18
SQLColAttributes: copying 4 bytes, len = 4, cbDescMax = 301
20:17:54.971873 processing row tokens.  marker is  d1(ROW)
20:17:54.971909 processing row.  column is 0 varint size = 2
20:17:54.971937 processing row.  column size is 40 
20:17:54.971967 clearing column 0 NULL bit
odbc:SQLColAttributes: fDescType is 6
odbc:SQLColAttributes: fDescType is 18
SQLColAttributes: copying 4 bytes, len = 4, cbDescMax = 301
convert_tds2sql: src is 39 dest = 1
convert_tds2sql: outputting character data destlen = 301 
20:17:54.972203 processing row tokens.  marker is  45()
20:17:54.972235 tds_process_default_tokens() marker is 45()
Unknown marker: 69(45)!!
SQLFetch: !TDS_SUCCEED (0)
SQLFreeHandle(3, 0x8062db8)
Sending packet @ 20:17:54.972475
0000 06 01 00 08 00 00 01 00-                        |........|

-- 
Johnny Ljunggren, Priv: Bærefjellvn 15, 3160 STOKKE
Tlf: 33 07 10 77 (jobb) 918 50 411 (mob) 33 33 62 52 (priv)



More information about the FreeTDS mailing list