tds_fdw
tds_fdw copied to clipboard
long varchar(max) and varbinary(max) fields truncated
I have found that long strings and long byte arrays are truncated to 64512 chars/bytes when imported from SQL Server. The cause seems to be that freetds's dbdatlen function returns 64512 as the srclen. Not sure yet if this is a problem in freetds, or if dbdatlen is the wrong API to call.
Note that in their documentation Microsoft says that the storage size for varchar and varbinary is the data length + 2 bytes.
This is probably an origin of a duplicated #81 and fixed with #294. I think it is OK to close this (and reopen if necessary)...