freetds silently truncating text/varchar/etc fields to 80 characters

Robert Jay <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Hi,

Using freetds v0.83.dev.20090421 (threadsafe, default tds version=5.0)
connecting to a SQL2005 server i found that all of my text fields in INSERTs
were being truncated to 80 characters.

This is using Perl 5.10, and DBD::Sybase.

I managed to fix the problem (well at least bandaid it) by changing line 792
of src/tds/query.c from:

strcat(declaration, "varchar(80)");

to

strcat(declaration, "varchar(255)");


I don't know why it is not building the declaration properly, but could this
be changed to 255 instead of 80?  It's a bit more of a sensible number.  And
maybe a warning logged? Or an entry in the FAQ?

Thanks,
Rob.
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.