[freetds] empty strings select as null bug

Geoff Montee geoff.montee at gmail.com
Wed Jun 10 23:46:26 EDT 2015

On Wed, Jun 10, 2015 at 7:07 PM, James K. Lowden
<james.k.lowden at icloud.com> wrote:
> Using dbdatlen, you cannot distinguish between a zero-length string and
> NULL.  In some versions of TDS, there is no difference between the
> two: at the protocol level, a NULL CHAR column was indicated by having
> a length of zero.  Later versions indicated NULL explicitly.  That
> opened the possibilty of a non-NULL CHAR field having no data, a very
> strange situtation indeed.
> IIRC NULL can be more accurately detected with dbnullbind.

If this true, then it sounds like Jeff's bug is in my code. I think I
can work with dbnullbind.

Thanks, James!


More information about the FreeTDS mailing list