Skip to Content.
Sympa Menu

freetds - [freetds] support "CS_TDS_80" by "CS_SET" action in ct_con_props()

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Vadym Kononenko <vkononenko AT atlantic-link.com.ua>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] support "CS_TDS_80" by "CS_SET" action in ct_con_props()
  • Date: Mon, 5 Sep 2005 18:51:52 +0300

Hi, all.
I try to write libdbi-freetds driver using ctlib API.
My alpha version works good, but I have a problem.
If I don't use freetds.conf file and try to connect to MS SQL 8.0 CLI using
7.0 version settings, not NUL-terminated string received. I tried to use
"ind"
and "datalength" received from ct_bind() but this way don't work always
correctly.
Can anyone add the "CS_TDS_80" support for "ct_con_props()" call?

diff -rua freetds.orig/src/ctlib/ct.c freetds/src/ctlib/ct.c
--- freetds.orig/src/ctlib/ct.c 2005-09-05 11:02:27 +0300
+++ freetds/src/ctlib/ct.c 2005-09-05 11:03:19 +0300
@@ -431,6 +431,8 @@
tds_set_version(tds_login, 5, 0);
} else if (*(int *) buffer == CS_TDS_70) {
tds_set_version(tds_login, 7, 0);
+ } else if (*(int *) buffer == CS_TDS_80) {
+ tds_set_version(tds_login, 8, 0);
} else {
return CS_FAIL;
}

And... Can anyone review the small patch below. I assume than "ct.c" code
contain an error...

diff -rua freetds.orig/src/ctlib/ct.c freetds/src/ctlib/ct.c
--- freetds.orig/src/ctlib/ct.c 2005-09-05 11:02:27 +0300
+++ freetds/src/ctlib/ct.c 2005-09-05 11:08:16 +0300
@@ -469,7 +469,7 @@
tds_strlcpy((char *) buffer,
tds_dstr_cstr(&tds_login->server_name), buflen
break;
case CS_LOC_PROP:
- buffer = (CS_VOID *) con->locale;
+ *buffer = (CS_VOID *) con->locale;
break;
case CS_USERDATA:
tdsdump_log(TDS_DBG_INFO2, "fetching userdata %p\n",
con->userdata);

--
Best regards.
Vadym Kononenko.
Kyiv, Ukraine



  • [freetds] support "CS_TDS_80" by "CS_SET" action in ct_con_props(), Vadym Kononenko, 09/05/2005

Archive powered by MHonArc 2.6.24.

Top of Page