[freetds] SQLGetData (bug in ODBC driver)
James K. Lowden
jklowden at freetds.org
Wed Jun 11 23:19:47 EDT 2008
Suren A. Chilingaryan wrote:
> Dear developers,
> FreeTDS 0.82 ODBC driver is corrupting data if SQLGetData is called
> multiple times on a single column and if the data conversion have been
> The patch is available at:
Thank you kindly for your analysis and patch. I modified it to conform
with FreeTDS style (and some preferences of my own) and applied it to CVS
HEAD. I also posted the modified patch at
Checking in src/odbc/odbc.c;
/cvsroot/freetds/freetds/src/odbc/odbc.c,v <-- odbc.c
new revision: 1.482; previous revision: 1.481
I applied your patch because it looks reasonable and doesn't break any
unit tests, and to save Frediano some effort. I'm not set up to test
If you would like to, there are a couple of other things you could do that
would be very helpful:
1. Apply my modification of your patch to your 0.82 installation, to
confirm it still works as it should.
2. Modify src/odbc/unittests/getdata.c to test the condition addressed by
3. Let us know.
This sort of thing is quite tricky to get right. A unit test could
confirm it's correct at the lowest level.
 My test server went down halfway through the tests, but getdata.c ran.
More information about the FreeTDS