Skip to Content.
Sympa Menu

freetds - RE: [freetds] Freedom from iconv day

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: 'FreeTDS Development Group' <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Freedom from iconv day
  • Date: Tue, 8 Jul 2003 10:43:32 -0400

> From: Michael Peppler [mailto:mpeppler AT bluewin.ch]
> Sent: July 8, 2003 2:49 AM
>
> On Mon, 2003-07-07 at 22:33, Brian Bruns wrote:
> > Actually, there are lots of messages generated directly
> from the client
> > libraries (meaning in Sybase OpenClient). "Attempt to
> initiate new query
> > with results pending", datatype conversion errors, some bcp
> stuff all come
> > to mind. I think it's probably an ok way to deal with it.
>
> Yes - but the messages generated by OpenClient don't use the same
> numbering scheme as the server messages, and are sent to the CLIENT
> callback (in CTlib) or the error handler (in DBlib).

I chose to emulate Sybase server messages because I thought that best
approximates what's happening. Client applications designed to deal with
character conversion errors would already include handlers for those
messages. Whether the message originates from the server or FreeTDS is
indistinguishable to the application.

I consider my choice to be provisional, though; the messages we generate in
tds_iconv() are suitable only for db-lib. I didn't want iconv independence
to wait for a revamping of our internal message handling, see below.

I expect these messages to be generated on connections to Microsoft servers,
that after all being the most probable need for character conversion.
Microsoft's theory of operation is to have UCS-2 clients and servers. For
non-UCS-2 data, their db-lib driver does no conversion. Their ODBC driver
has an "AutoTranslate" feature; I don't know what error message it might
generate. Until all unixy clients are UCS-2LE, they'll benefit from
client-side conversion.

Sybase, as you know, performs conversions on the server, and deals with
UTF-8 client and server data (plus others, a very long list if the
international options are installed). Client-side conversion is of more
limited use on Sybase, but might serve as a workaround occasionally.

The issue of what error message to generate touches on how messages are
conveyed to the various client libraries, a framework that is skeletal at
best. One day, we'll need to leverage the work Nick began, have libtds emit
ct-lib-style messages by *number*, and require db-lib and ODBC to map that
number onto their scheme (and add suitable text). To fully generalize that
is a non-trivial task, and will be post-0.62 unless someone shows up with a
really fine patch.

As ever, Michael, if you have another suggestion, I'm all ears.

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 we do not accept account orders and/or instructions
by e-mail, and therefore will not be responsible for carrying out such orders
and/or instructions.






Archive powered by MHonArc 2.6.24.

Top of Page