dblib either truncates nvarchar, or makes NULLs empty strings

Jeffrey Shaw <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAJYh90_DbrDUBpaANaT1_FasAFAQaPyAqMqdQ=O9B6QQy5bi2w@mail.gmail.com>
Hello,
I am having two problems. If I set the tds version to 7.1, empty strings
are selected as NULL.

If I set the tds version to something else, strings longer than 255
characters are truncated.

My guess is that in the case of tds version 7.1, types marked with * at
http://www.freetds.org/tds.html#types are using "size == 0" when checking
for null, rather than the correct "size == -1". "size == 0" is an empty
string, whereas "size == -1" is NULL.

It isn't clear to me where in the source this check is happening, so I'm
applying here for help.

I've tried CentOS 7's FreeTDS .91 and also freetds-dev-0.92.965.

Thanks,
Jeff
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.