[freetds] FreeTDS always setting empty VARCHAR's to NULL

Andrew Victor avictor.za at gmail.com
Tue Jun 23 14:08:00 EDT 2009


> It seems that calling ct_param() with an empty string (ie, data !=
> NULL and datalen = 0), a NULL gets passed to the database rather than
> an empty string.
> According to the Sybase documentation for ct_param:
>    "There are two ways to indicate a parameter with a null value:
>     - Pass indicator as -1. In this case, data and datalen are ignored.
>     - Pass data as NULL and datalen as 0 or CS_UNUSED"

Attached is a patch (against 0.82) which should fix this.

  Andrew Victor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: empty_string.patch
Type: text/x-patch
Size: 1776 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20090623/6d4cac14/attachment.bin 

More information about the FreeTDS mailing list