Skip to Content.
Sympa Menu

freetds - Re: [freetds] SQL Server version and TDS Version

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Vinh Nguyen <vinhdizzo AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] SQL Server version and TDS Version
  • Date: Tue, 20 Apr 2010 14:33:45 -0700

On Tue, Apr 20, 2010 at 12:33 PM, <jklowden AT schemamania.org> wrote:
> Vinh Nguyen wrote:
>> Issuing your command with tds version 8.0 specified I get:
>> config.c:202:         server_charset = iso_1
>> config.c:216:         client_charset = ISO-8859-1
>>
>> When I specify "client charset = UTF-8" in my .freetds.conf file, I get:
>>
>> config.c:479:   client charset = 'UTF-8'
>> config.c:526:tds_config_login: client charset is UTF-8.
>> config.c:202:         server_charset = iso_1
>> config.c:216:         client_charset = UTF-8
>>
>> However, with this, when I use tsql I get:
>>
>> locale is "en_US.utf-8"
>> locale charset is "utf-8"
>> Default database being set to IBADataDictionary
>> Msg 20017, Level 9, State -1, Server OpenClient, Line -1
>> Unexpected EOF from the server
>
> Yes, that's what I meant.  :-/
>
> I think there might be a bug.  I have a Mac but I won't be able
> to look at it for the next few days and I don't want you to
> wonder what happened.
>
> Please post the TDSDUMP log again now that you have that line in your

log.c:190:Starting log file for FreeTDS 0.82
on 2010-04-20 14:24:24 with debug flags 0x4fff.
iconv.c:197:names for ISO-8859-1: ISO-8859-1
iconv.c:197:names for UTF-8: UTF-8
iconv.c:197:names for UCS-2LE: UCS-2LE
iconv.c:197:names for UCS-2BE: UCS-2BE
iconv.c:363:iconv to convert client-side data to the "utf-8" character set
iconv.c:432:tds_iconv_info_init: client charset name "" unrecognized
net.c:210:Connecting to CENSORED (TDS version 8.0)
net.c:264:tds_open_socket: connect(2) returned "Operation now in progress"
net.c:303:tds_open_socket() succeeded
util.c:162:Changed query state from DEAD to IDLE
login.c:735:quietly sending TDS 7+ login packet
token.c:312:tds_process_login_tokens()
util.c:334:tdserror(0x1002001d0, 0x1002007e0, 20017, 0)
util.c:368:tdserror: client library returned TDS_INT_CANCEL(2)
util.c:389:tdserror: returning TDS_INT_CANCEL(2)
util.c:162:Changed query state from IDLE to DEAD
token.c:316:looking for login token, got 0()
token.c:108:tds_process_default_tokens() marker is 0()
token.c:111:leaving tds_process_default_tokens() connection dead
util.c:334:tdserror(0x1002001d0, 0x1002007e0, 20002, 0)
util.c:368:tdserror: client library returned TDS_INT_CANCEL(2)
util.c:389:tdserror: returning TDS_INT_CANCEL(2)
mem.c:563:tds_free_all_results()

> freetds.conf.  Also the output of locale(1).
>

locale is "en_US.utf-8"
locale charset is "utf-8"


> tsql is just reporting the results of nl_langinfo(3).  AFAICT
> that output isn't right: it's reporting an encoding that can't be
> used by iconv(3).  That leads me to think your environment is
> misconfigured.
>
> The "client charset = UTF-8" line in your freetds.conf is supposed to
> override environmental settings such as the LANG variable.  With it, your
> TDSDUMP should not report
>
>  iconv.c:432:tds_iconv_info_init: client charset name "" unrecognized
>

echo $LANG
en_US.utf-8

> If TDSDUMP still reports that even with UTF-8 set in your freet.conf, that
> would
> be a bug.  I vaguely remember discussing this before, but yours would be the
> clearest indication.  (It might even be fixed in CVS HEAD.  Yes,
> we need a release.)
>
> A workaround might be to clear any environment locale-related environment
> variables before starting tsql.  Or replace them with upper-case
> versions.

set $LANG to uppercase and unset it, still get the lowercase locale.

>
> HTH.




Archive powered by MHonArc 2.6.24.

Top of Page