Re: [PATCH] Problem with VARCHAR in sybase.
"James K. Lowden" <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
Eddy Pronk wrote: > The way I solved it for now inside libdbi right now is like this: > > case CS_CHAR_TYPE: > case CS_TEXT_TYPE: > case CS_VARCHAR_TYPE: > _type = DBI_TYPE_STRING; > datafmt->format = CS_FMT_NULLTERM; > ++datafmt->maxlength; /* 1 extra byte for \0 */ > break; That will make ct-lib happy, but I would worry the cure might be worse than the disease. If datafmt->maxlength represents the size of an allocated buffer, increasing it without reallocating will write the NULL to unallocated memory, with predictable unpredictable [sic] results. Looking forward to your results. --jkl