Skip to Content.
Sympa Menu

freetds - [freetds] tds/convert.c

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Simon Young" <simony AT ps.gen.nz>
  • To: "freetds" <freetds AT lists.ibiblio.org>
  • Subject: [freetds] tds/convert.c
  • Date: Thu, 18 Dec 2003 18:12:37 +1300

Looking at the two functions in convert.c - tds_convert_char() and
tds_convert_binary(), it looks to me (and experiment seems to confirm this)
that the code that does conversion of SYBBINARY fields in tds_convert_char
should be swapped with the code that handles SYBTEXT fields that is in
tds_convert_binary.

In more detail: in tds_convert_char which converts text or character data
fields from the database to a different sort, when it want to convert to a
SYBBINARY, SYBIMAGE and SYBVARBINARY field, it should not be looking in the
source buffer for 0x... something hex strings, but should be creating such a
string.
And similarly in tds_convert_binary which changes a binary (hex string) to
something else, the SYBCHAR, SYBVARCHAR and SYBTEXT handling is trying to
turn the hex binary string into another hex binary string instead of decoding
it.
I noticed this because of an error "error_handler: attempt to convert data
stopped by syntax error in source field" being displayed.
Thus the two bits of code need swapping. Someone else may have already
reported this, I didn't read through all of the archives to check.









Archive powered by MHonArc 2.6.24.

Top of Page