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: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: mssql, dynamic query and strings
  • Date: Thu, 26 Sep 2002 11:43:19 -0400


> From: ZIGLIO Frediano [mailto:Frediano.Ziglio AT vodafoneomnitel.it]
> Sent: September 26, 2002 9:53 AM
> > >
> > > 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
> >
> > 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 want to minimize the number of tests for TDS protocol; we want to push
that knowledge as close to the wire as possible.

What's up with this function, anyway? It's only used in login.c?

$ grep -rc tds_put_string src/ |grep -v :0
src/tds/login.c:11
src/tds/write.c:1

Maybe you should be using something else? Maybe it should be called
"tds_put_login_string"? If it's really that specialized, we should move it
inside login.c and make it static.

> > 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 ??

Eventually, that's the general idea, yes. Let the client declare the
character set he wants to use to communicate with FreeTDS. He could send us
UTF-8, UCS-2, ISO-8859-1, whatever. We pass it, converting if necessary to
match the wire. Isn't that what you want to do?

> > 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 ??

Good point. There are already a few tds7_* names; I think adhering to that
practice, to the extent necessary, would be fine.
>
> PS: prepare seem to work !!! (see dump from ethereal on a Linux rh/7.2
> machine below)

Amen!

If you get dynamic queries working, I think we should coordinate with the
others and issue a release. Maybe when Nick is satisfied with error
handling and Bill has compute rows working. Brian already added (or has the
patch for, not sure) handling of stored procedure output parameters. Not to
mention Nick's many fixes, including yesterday's to ct_cancel.

Those things together merit 0.61, to my mind.

Regards,

--jkl


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 for certain accounts we do not accept
orders and/or instructions by e-mail, and for those accounts we will not be
responsible for carrying out such orders and/or instructions. Kindly refrain
from sending orders or instructions by e-mail unless you have confirmed that
we accept such communications for your account. Please also note that to
satisfy regulatory requirements we review the outgoing and incoming e-mail
correspondence of staff members serving certain functions.






Archive powered by MHonArc 2.6.24.

Top of Page