freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Thompson, Bill D (London)" <bill_d_thompson AT ml.com>
- To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
- Subject: RE: [freetds] Bug in ct_get_data
- Date: Mon, 17 Jan 2005 09:53:36 -0000
Eddy,
thanks for the report, and welcome to the project!
Your fix makes functional sense.
We have a function for determining the null-ness of a returned datum.
using this, I think your fix would look like:
- srclen = curcol->column_cur_size;
+ if (tds_get_null(resinfo->current_row, (item - 1)))
+ srclen = 0;
+ else
+ srclen = curcol->column_cur_size;
Would you like to check that out with your program ?
Thanks again,
Bill
-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Edward
Macnaghten
Sent: 17 January 2005 09:05
To: freetds AT lists.ibiblio.org
Subject: [freetds] Bug in ct_get_data
Hi
I am new to this list so please forgive me if this is out of order....
I have 2 pieces of news -
1 - I have found a bug
2 - I think I have fixed it
The bug is in ct_get_data. It manifests when you are returning a row
set, and a character type is null when the same column in the preceding
row was not. ct_get_data does not check the "Null" mask so therefore
the same value is returned again (as it still is in the buffer).
The fix..., in ctlib/ct.c - in th ct_get_data() function, about line
1988 replace
srclen = curcol->column_cur_size;
with
/*
* Fix by eddy AT edlsystems.com
*
* To take notice if column is null
*/
{
int bytenum = ((unsigned int) item - 1) / 8u;
int bit = ((unsigned int) item - 1) % 8u;
unsigned char mask = 1 << bit;
if(resinfo->current_row[bytenum] & mask)
srclen = 0;
else
srclen = curcol->column_cur_size;
}
/*
* End of FIX by eddy AT edlsystems.com
*/
seems to do the trick.
This is not a propper "patch" as there are probably better ways of doing
this. Also, I am not that familiar with freetds internals, and although
it may work for me, it may not be the "comprehensive" solution required.
I apologize if this has been covered, or if this is the wrong place for
this, or I have submitted this the wrong way...
Enjoy
Eddy
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
--------------------------------------------------------
If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy, retain or
redistribute it. Click here for important additional terms relating to this
e-mail. http://www.ml.com/email_terms/
--------------------------------------------------------
-
[freetds] Bug in ct_get_data,
Edward Macnaghten, 01/17/2005
- <Possible follow-up(s)>
- RE: [freetds] Bug in ct_get_data, Thompson, Bill D (London), 01/17/2005
- RE: [freetds] Bug in ct_get_data, ZIGLIO, Frediano, VF-IT, 01/17/2005
Archive powered by MHonArc 2.6.24.