[freetds] [patch] dbsetnull() support

MATSUMOTO, Tadashi pineroot at yahoo.co.jp
Mon Apr 23 07:11:05 EDT 2007


Hi all,

I have implemented dbsetnull() on DB-Library of FreeTDS 0.64.
Could someone give me some advice about my patch?

The specification is as follows.
1.  Dbsetnull() copies some values to null value preservation areas for each bind datatype
 added to the dbproc structure.
2.  The internal function _set_null_value() returns the values.

For example,this implementation returns  "n/a  " as null in a following CHARBIND case.
  char *nullstr = "n/a"; 
  dbsetnull(dbproc, CHARBIND, strlen(nullstr), (BYTE*)nullstr); 
  ... 
  dbbind(dbproc, n, CHARBIND, 5, (BYTE*)result); 

Compared with Syabase, this implementation has some restrictions as follows.
1.  It doesn't support VARYBINBIND,BOUNDARYBIND and SENSITIVITYBIND  of Sybase
2.  It supports BITBIND which doesn't exist in Sybase dbsetnull manual.
3.  It doesn't change dbconvert behavior.
    "0x00" or "NULL value" will be returned according to a former implementation.
4. 
   If the Bind variable area for string datatype is smaller than that of the null value set in dbsetnull(), 
   the number of characters by Sybase Dblib is 1 fewer charactor than the number of ones by this implementation.
 (Sybase bug?)
 
Thanks.
--
MATSUMOTO, Tadashi


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dbsetnull.patch
Url: http://lists.ibiblio.org/pipermail/freetds/attachments/20070423/fe163ba7/attachment-0001.bat 


More information about the FreeTDS mailing list