Skip to Content.
Sympa Menu

freetds - [freetds] client/server mismatch

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: [freetds] client/server mismatch
  • Date: Fri, 15 Jun 2007 12:02:43 +0200

Trying ASE 15 I noted some problems with charset. tsql used UTF-8 as
server charset... why not utf8 (valid Sybase charset) ??

Index: src/apps/tsql.c
===================================================================
RCS file: /cvsroot/freetds/freetds/src/apps/tsql.c,v
retrieving revision 1.103
diff -u -1 -0 -r1.103 tsql.c
--- src/apps/tsql.c 18 Mar 2007 11:07:30 -0000 1.103
+++ src/apps/tsql.c 15 Jun 2007 09:58:01 -0000
@@ -459,23 +459,20 @@
tsql_print_usage(argv[0]);
exit(1);
}
if (!password) {
password = (char*) malloc(128);
readpassphrase("Password: ", password, 128,
RPP_ECHO_OFF);
}

/* all validated, let's do it */

- if (tds_sybase_charset_name(charset))
- charset = tds_sybase_charset_name(charset);
-
/* if it's a servername */
if (servername) {
tds_set_user(login, username);
tds_set_app(login, "TSQL");
tds_set_library(login, "TDS-Library");
tds_set_server(login, servername);
tds_set_client_charset(login, charset);
tds_set_language(login, "us_english");
tds_set_passwd(login, password);
if (confile) {


Here tsql converted charset from client to server but set client
charset.


Index: src/tds/locale.c
===================================================================
RCS file: /cvsroot/freetds/freetds/src/tds/locale.c,v
retrieving revision 1.26
diff -u -1 -0 -r1.26 locale.c
--- src/tds/locale.c 26 Dec 2006 14:56:21 -0000 1.26
+++ src/tds/locale.c 15 Jun 2007 09:58:06 -0000
@@ -97,23 +97,23 @@
continue;
*s = 0;
if (*strip == '.')
charset = s+1;
rewind(in);
found = tds_read_conf_section(in, buf,
tds_parse_locale, locale);
}

/* charset specified in LANG ?? */
if (charset) {
- if (locale->server_charset)
- free(locale->server_charset);
- locale->server_charset =
strdup(charset);
+ if (locale->client_charset)
+ free(locale->client_charset);
+ locale->client_charset =
strdup(charset);
}
}

fclose(in);
}
return locale;
}

static void
tds_parse_locale(const char *option, const char *value, void *param)


Here a client charset name was used for server_charset.
Does anyone disagree with these changes??

freddy77





Archive powered by MHonArc 2.6.24.

Top of Page