Skip to Content.
Sympa Menu

freetds - [freetds] SYBLONGBINARY mapping to CS_CHAR_TYPE in src/ctlib/ct.c

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Christian Hoffmann <chrmhoffmann AT gmail.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] SYBLONGBINARY mapping to CS_CHAR_TYPE in src/ctlib/ct.c
  • Date: Thu, 10 Dec 2009 15:19:30 +0100

Hi all,

I am facing a problem with freetds when calling a stored procedure
that returns a SYBLONGBINARY (column in table is of type "varbinary
(2000)"). It looks like the code in _ct_get_client_type (int, int,
int) function returns a CS_CHAR_TYPE and not as I would expect a
CS_LONGBINARY_TYPE. I tried to look in the CVS history and at
somepoint it was changed from CS_BINARY_TYPE to CS_CHAR_TYPE:

http://freetds.cvs.sourceforge.net/viewvc/freetds/freetds/src/ctlib/ct.c?r1=1.108&r2=1.109

Any idea why this is done like this?

Kind regards,

Chris

PS: I would have thought to change the code to this:

Index: src/ctlib/ct.c
===================================================================
--- src/ctlib/ct.c (revision 89641)
+++ src/ctlib/ct.c (working copy)
@@ -1991,7 +1991,7 @@
case SYBLONGBINARY:
if (usertype == USER_UNICHAR_TYPE || usertype ==
USER_UNIVARCHAR_TYPE)
return CS_UNICHAR_TYPE;
- return CS_CHAR_TYPE;
+ return CS_LONGBINARY_TYPE;
break;
}




Archive powered by MHonArc 2.6.24.

Top of Page