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

Christian Hoffmann chrmhoffmann at gmail.com
Thu Dec 10 09:19:30 EST 2009


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;
 	}



More information about the FreeTDS mailing list