[freetds] HELP - Freetds-0.60 (issue in fatching the data from the sybase DB)

abhay goel goel_abhay at yahoo.co.in
Tue Oct 30 23:32:53 EST 2007


  Hi All,
   
  I required some help regarding the freetds.
   
  As I am using the freetds-0.60 libraries for connecting the Sybase database come along with NetCool tool. 
   
  Our one application (written in C) got crashed, after analyzing the things I come to know the issue, that in the “status” table in the Sybase DB, there is one column called “Summary” which length in the DB is “text 255”.
   
  If I have inserted the data exact 255/254 characters into the Summary column and then trying to extract the value of Summary field using freetds libraries, in that case the application got crashed.
   
  As I checked the code of freetds library, there is one condition into the freetds-0.60\src\ctlib  “cs_convert” function to check the length of the Summary field should not be equal to the length of the data. 
   
  To avoid this problem I have modified the code in “freetds-0.60/src/ctlib/ct.c” function “_ct_bind_data”  at line number 567  “curcol->column_bindlen = curcol->column_bindlen +1 ”. So it will increase the length of the Summary field by 1 only in the code to ignore the condition in “cs_convert”.  
   
  But my concern is as follows
   
  1)      What is the significance for checking such condition  (if (src_len > destlen) { ret = CS_FAIL; })
  2)      What will be the impact after my changes to ignoring this condition everytime.
   
  Please suggest me, as this has become the critical issue.
   
  Thanks & Regards,
  Abhay Goel
  System Analyst
  Nihilent Technoligies Pvt Ltd.
  

       
---------------------------------
 Why delete messages? Unlimited storage is just a click away.


More information about the FreeTDS mailing list