Discussion:
[freetds] [PATCH] SYBUINT<n> support
Ian Lister
2012-12-31 01:51:53 UTC
Permalink
Hi,

I was running into a problem due to FreeTDS not supporting Sybase's unsigned integer types (SYBUINT1/2/4/8). It was manifested as cs_convert failing to convert other types (such as SYBNUMERIC) to those unsigned types, and reporting:

cs_convert: cslib user api layer: external error: Conversion between 108 and -1 datatypes is not supported

I have attached a patch that addresses the issue for me, in the hope that it might be useful for others. I tried to make it fairly complete in the areas of the code that I touched, but I was only following my nose so have quite likely overlooked other parts of the code (including test cases) that are also lacking SYBUINTn support. YMMV etc.

Ian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freetds-uint.patch
Type: application/octet-stream
Size: 25944 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20121230/86de9070/attachment.obj
Frediano Ziglio
2012-12-31 11:29:59 UTC
Permalink
Post by Ian Lister
Hi,
cs_convert: cslib user api layer: external error: Conversion between 108 and -1 datatypes is not supported
I have attached a patch that addresses the issue for me, in the hope that it might be useful for others. I tried to make it fairly complete in the areas of the code that I touched, but I was only following my nose so have quite likely overlooked other parts of the code (including test cases) that are also lacking SYBUINTn support. YMMV etc.
Ian
Hi Ian,
thanks for the patch. I have a similar unfinished one so I'll merge
it (I think you'll have to wait new year). Is not enough to fully
support unsigned integers but the conversions stuff is good (to fully
support unsigned you have also to tell Sybase server that you accept
unsigned integers and check if all layers can handle these new types).

Happy New Year to everybody,
Frediano
Frediano Ziglio
2013-01-09 16:12:02 UTC
Permalink
Post by Ian Lister
Hi,
cs_convert: cslib user api layer: external error: Conversion between 108 and -1 datatypes is not supported
I have attached a patch that addresses the issue for me, in the hope that it might be useful for others. I tried to make it fairly complete in the areas of the code that I touched, but I was only following my nose so have quite likely overlooked other parts of the code (including test cases) that are also lacking SYBUINTn support. YMMV etc.
Ian
The big doubt I have with this patch is that it could let you use
SYBUINT types even if server is not accepting that types... probably
passing a tds variable to cs_server_type could help.

Frediano
Frediano Ziglio
2013-01-13 21:28:56 UTC
Permalink
Post by Ian Lister
Hi,
cs_convert: cslib user api layer: external error: Conversion between 108 and -1 datatypes is not supported
I have attached a patch that addresses the issue for me, in the hope that it might be useful for others. I tried to make it fairly complete in the areas of the code that I touched, but I was only following my nose so have quite likely overlooked other parts of the code (including test cases) that are also lacking SYBUINTn support. YMMV etc.
Ian
I integrated your patch. You can find changes at
http://gitorious.org/freetds/freetds/commits/master.

For the moment you have to use --enable-developing to get it compiled.

Frediano

Loading...