[python-sybase] Problem with CS_LONG

Paul Rensing prensing at cimetrics.com
Tue, 01 Jun 2004 10:58:33 -0400


Hi. I recently updated to FreeTDS 0.62.3 and Sybase 0.36 (used to have
0.36pre6 installed). Now, I am suddenly having a problem reading tables
I could read before. 

The culprit is a column which is of type CS_LONG_TYPE. There is no
conversion method in databuf.c DataBuf_item() for that type. I fixed it
(correctly?) by adding at line 183:

    case CS_LONG_TYPE:
	return PyLong_FromLongLong(*(long long *)item);

Note I could not use "(CS_LONG *)" because the header file from FreeTDS
lists CS_LONG as an int (4 bytes) instead of a long long (8 bytes).

Does this make sense, or am I missing something?

	Paul Rensing

-- 
Paul Rensing <prensing@cimetrics.com>
Cimetrics, Inc.