[freetds] dbbind rejects -1 varlen

James K. Lowden jklowden at freetds.org
Sun Dec 2 22:23:52 EST 2007


The FreeTDS implementation of dbbind() was at odds with the documentation:
it accepted -1 as a length to mean "buffer is big enough".  Documentation
from both vendors says the proper value is zero, not -1.  I must say I'm
amazed no one pointed that out before.  

dbbind() now fails if varlen < 0.  I was unable to find an appropriate
error message, so it doesn't call the error handler; it just fails with a
message to the log.  

I changed dbbind, bsqldb, and about 15 unittests.  Unfortunately, I can't
commit the changes now because SF is having server difficulties afaict. 
So the patch is attached in case you want it.  

--jkl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbbind.unittests.diff
Type: application/octet-stream
Size: 17770 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20071202/e53f2751/attachment.obj 


More information about the FreeTDS mailing list