Skip to Content.
Sympa Menu

freetds - Re: [freetds] Plan to support newer MS SQL Server types

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: jklowden AT schemamania.org
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Plan to support newer MS SQL Server types
  • Date: Mon, 19 Apr 2010 17:08:36 -0400

On Mon, Apr 19, 2010 at 11:00:05PM +0200, Frediano Ziglio wrote:
> Il giorno lun, 19/04/2010 alle 12.04 -0400, jklowden AT schemamania.org ha
> scritto:
> > > > ?? For db-lib connections, the server converts varchar(max) to TEXT
> > > > (type 35). Then the db-lib API can deal with it either by binding it
> > > > as a string or with dbmoretext().
> > >
> > > Yes, this is true with MS dblib cause MS dblib use only protocol 4.2. We
> > > support protocol up to 7.1 under dblib :)
>
> Yes, cause you are using protocol 7.1 which does not support
> varchar(max) so this type is returned as text :)
> Protocol 7.2 support varchar(max) with different byte encoding.

I see, finally. I found this code in tds_connect_and_login():

/* disable tds9 if iconv wanted, currently not supported */
if (IS_TDS72(connection) && tds->use_iconv)
connection->tds_version = 0x701;

So, no matter how I set TDSVER, I never get more than 7.1. :-(

I've come to understand that client encoding is properly a binding step: the
library should always keep an original as-received copy of the data, and only
when asked to convert to a "string" does it need to consult iconv. That's
the only way to support binary bindings, and the best way to support UTF-16
on a TDS 7+ connection.

Not easy to fix, though.

--jkl







Archive powered by MHonArc 2.6.24.

Top of Page