Skip to Content.
Sympa Menu

freetds - RE: mssql, dynamic query and strings

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: ZIGLIO Frediano <Frediano.Ziglio AT vodafoneomnitel.it>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: mssql, dynamic query and strings
  • Date: Thu, 26 Sep 2002 15:52:35 +0200


> >
> > My intention is to rename tds_write_string to
> > tds_write_ascii_string_padded
> > (too long ?? tds_write_padded_cstring is better? ) and create a
> > tds_write_string with similar behaviour of tds_read_string
>
> Frediano,
>
> Why not just fix tds_write_string()? I think it should do
> the Write Thing
> (tm) regardless of client character set.
>

Arghh... already changed.
The problem is that tds_put_string was used like

tds_put_string(tds,"test",10);

and output something like (in C form)

"test\0\0\0\0\0\0"
(padded with zeroes, very strange)

This is why I renamed tds_put_string in tds_put_padded_cstring

> We're going to bump into a lot of this sort of thing as we remove the
> asciiness from libtds to make it 16-bit clean. Better to fix
> each function
> in place than to create a duplicate set of fixed ones, say I.
>

This mean that client can call freetds libs using multibyte charsets ??

> If it makes sense to retain the old function for Sybase, then
> I suggest
> tds_write_string() and tds7_write_string(). Or possibly
> ucs_write_string(),
> if that's not offensive.
>

ucs_write_string() ?? But tds_ is not a prefix to avoid name conflicts ??
Perhaps tds_ucs_write_string(), but we have used all get/put for writing and
reading from wire...
Best tds_put_ucs2_string ??

bye

freddy77

PS: prepare seem to work !!! (see dump from ethereal on a Linux rh/7.2
machine below)

000000C2 01 01 00 2c 00 00 01 00 73 00 65 00 74 00 20 00 ...,.... s.e.t. .
000000D2 74 00 65 00 78 00 74 00 73 00 69 00 7a 00 65 00 t.e.x.t. s.i.z.e.
000000E2 20 00 31 00 30 00 32 00 34 00 30 00 .1.0.2. 4.0.

000001A0 04 01 00 11 00 00 00 00 fd 00 00 be 00 00 00 00 ........ ý..¾....
000001B0 00 .

000000EE 03 01 00 ae 00 00 01 00 0a 00 73 00 70 00 5f 00 ...®.... ..s.p._.
000000FE 70 00 72 00 65 00 70 00 61 00 72 00 65 00 00 00 p.r.e.p. a.r.e...
0000010E 00 01 26 04 00 00 00 63 1e 00 00 00 1e 00 00 00 ..&....c ........
0000011E 40 00 50 00 31 00 20 00 76 00 61 00 72 00 63 00 @.P.1. . v.a.r.c.
0000012E 68 00 61 00 72 00 28 00 38 00 30 00 29 00 00 00 h.a.r.(. 8.0.)...
0000013E 63 4e 00 00 00 4e 00 00 00 53 00 45 00 4c 00 45 cN...N.. .S.E.L.E
0000014E 00 43 00 54 00 20 00 2a 00 20 00 46 00 52 00 4f .C.T. .* . .F.R.O
0000015E 00 4d 00 20 00 73 00 79 00 73 00 6f 00 62 00 6a .M. .s.y .s.o.b.j
0000016E 00 65 00 63 00 74 00 73 00 20 00 57 00 48 00 45 .e.c.t.s . .W.H.E
0000017E 00 52 00 45 00 20 00 69 00 64 00 20 00 3d 00 20 .R.E. .i .d. .=.
0000018E 00 40 00 50 00 31 00 00 00 38 01 00 00 00 .@.P.1.. .8....


000001B1 04 01 02 3d 00 00 00 00 81 19 00 00 01 08 00 e7 ...=.... .......ç
000001C1 00 01 04 6e 00 61 00 6d 00 65 00 00 00 08 00 38 ...n.a.m .e.....8
000001D1 02 69 00 64 00 00 00 08 00 af 02 00 05 78 00 74 .i.d.... .¯...x.t
000001E1 00 79 00 70 00 65 00 00 00 08 00 34 03 75 00 69 .y.p.e.. ...4.u.i
000001F1 00 64 00 00 00 08 00 34 04 69 00 6e 00 66 00 6f .d.....4 .i.n.f.o
00000201 00 00 00 08 00 38 06 73 00 74 00 61 00 74 00 75 .....8.s .t.a.t.u
00000211 00 73 00 00 00 08 00 38 0f 62 00 61 00 73 00 65 .s.....8 .b.a.s.e
00000221 00 5f 00 73 00 63 00 68 00 65 00 6d 00 61 00 5f ._.s.c.h .e.m.a._
00000231 00 76 00 65 00 72 00 00 00 08 00 38 08 72 00 65 .v.e.r.. ...8.r.e
00000241 00 70 00 6c 00 69 00 6e 00 66 00 6f 00 00 00 08 .p.l.i.n .f.o....
00000251 00 38 0a 70 00 61 00 72 00 65 00 6e 00 74 00 5f .8.p.a.r .e.n.t._
00000261 00 6f 00 62 00 6a 00 00 00 08 00 3d 06 63 00 72 .o.b.j.. ...=.c.r
00000271 00 64 00 61 00 74 00 65 00 00 00 08 00 34 07 66 .d.a.t.e .....4.f
00000281 00 74 00 63 00 61 00 74 00 69 00 64 00 00 00 00 .t.c.a.t .i.d....
00000291 00 38 0a 73 00 63 00 68 00 65 00 6d 00 61 00 5f .8.s.c.h .e.m.a._
000002A1 00 76 00 65 00 72 00 00 00 00 00 38 10 73 00 74 .v.e.r.. ...8.s.t
000002B1 00 61 00 74 00 73 00 5f 00 73 00 63 00 68 00 65 .a.t.s._ .s.c.h.e
000002C1 00 6d 00 61 00 5f 00 76 00 65 00 72 00 00 00 01 .m.a._.v .e.r....
000002D1 00 af 02 00 04 74 00 79 00 70 00 65 00 00 00 01 .¯...t.y .p.e....
000002E1 00 26 02 08 75 00 73 00 65 00 72 00 73 00 74 00 .&..u.s. e.r.s.t.
000002F1 61 00 74 00 00 00 01 00 26 02 07 73 00 79 00 73 a.t..... &..s.y.s
00000301 00 73 00 74 00 61 00 74 00 00 00 01 00 26 02 08 .s.t.a.t .....&..
00000311 69 00 6e 00 64 00 65 00 78 00 64 00 65 00 6c 00 i.n.d.e. x.d.e.l.
00000321 00 00 01 00 6f 08 07 72 00 65 00 66 00 64 00 61 ....o..r .e.f.d.a
00000331 00 74 00 65 00 00 00 01 00 26 04 07 76 00 65 00 .t.e.... .&..v.e.
00000341 72 00 73 00 69 00 6f 00 6e 00 00 00 01 00 26 04 r.s.i.o. n.....&.
00000351 07 64 00 65 00 6c 00 74 00 72 00 69 00 67 00 00 .d.e.l.t .r.i.g..
00000361 00 01 00 26 04 07 69 00 6e 00 73 00 74 00 72 00 ...&..i. n.s.t.r.
00000371 69 00 67 00 00 00 01 00 26 04 07 75 00 70 00 64 i.g..... &..u.p.d
00000381 00 74 00 72 00 69 00 67 00 00 00 01 00 26 04 07 .t.r.i.g .....&..
00000391 73 00 65 00 6c 00 74 00 72 00 69 00 67 00 00 00 s.e.l.t. r.i.g...
000003A1 01 00 26 04 08 63 00 61 00 74 00 65 00 67 00 6f ..&..c.a .t.e.g.o
000003B1 00 72 00 79 00 00 00 01 00 26 02 05 63 00 61 00 .r.y.... .&..c.a.
000003C1 63 00 68 00 65 00 ff 01 00 c1 00 00 00 00 00 79 c.h.e.ÿ. .Á.....y
000003D1 00 00 00 00 ac 0d 00 00 01 38 00 00 00 26 04 04 ....¬... .8...&..
000003E1 01 00 00 00 fe 00 00 e0 00 00 00 00 00 ....þ..à .....

=================================
"STRICTLY PERSONAL AND CONFIDENTIAL

This message may contain confidential and proprietary material for the sole
use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you are not the intended recipient please contact
the sender and delete all copies.
The contents of this message that do not relate to the official business of
our company shall be understood as neither given nor endorsed by it."

=================================




Archive powered by MHonArc 2.6.24.

Top of Page