Re: NTBSTRINGBIND in dbgetnull?

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Reid, Roger L. wrote:
> We had an app break with 0.82.    We worked around it, but I'm trying to
> figure out if it's an issue in dbgetnull, or if there's something up
> with our app.   It's worked for years with various Sybase dblibs, and
> then FreeTDS's up to 0.63 - but sometimes long standing "working bugs"
> get broken by a new release of something or other.
> 
>        dbbind (dbproc, i+1, NTBSTRINGBIND, MAXFIELD
> 	      , how == MANY ? (BYTE *)databuf[i] : (BYTE *)tmpbuf[i]);
> 
> I don't think any values are interesting here but NTBSTRINGBIND
> (maxfield is 256, databuf[i] and tmpbuf[i] are both pointers to 
> char[MAXFIELD+1])

Please try the attached patch (generated from CVS HEAD).  

I haven't tested it, but at this late hour it sure seems like a simple
fix. If it works, I'll commit it.  

The final switch in dbsetnull() should handle NTBSTRINGBIND in some way. 
That it's missing altogether looks like an oversight.  

Thanks for the problem report.  HTH.  

Regards, 

--jkl

_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
dbgetnull.diff (application/octet-stream, 517 B)
Index: src/dblib/dblib.c
===================================================================
RCS file: /cvsroot/freetds/freetds/src/dblib/dblib.c,v
retrieving revision 1.325
diff -u -r1.325 dblib.c
--- src/dblib/dblib.c	12 Jun 2008 01:00:48 -0000	1.325
+++ src/dblib/dblib.c	16 Jun 2008 04:19:34 -0000
@@ -619,6 +619,9 @@
 			memset(varaddr, ' ', varlen);
 			varaddr[varlen-1] = '\0';
 			break;
+		case NTBSTRINGBIND:
+			varaddr[0] = '\0';
+			break;
 		case BINARYBIND:
 			memset(varaddr, 0, varlen);
 			break;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.