freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
- To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
- Subject: [freetds] still dblib rpc problems??
- Date: Tue, 8 Feb 2005 10:39:12 +0100
It seems that on null output parameter dblib return still SYBINT4
however in dbconvert data is null if srclen == 0 and type is nullable.
It seems that this patch work:
@@ -1724,21 +1724,21 @@
int len;
DBNUMERIC *num;
tdsdump_log(TDS_DBG_INFO1, "dbconvert(%d [%s] len %d => %d [%s]
len %d)\n",
srctype, tds_prdatatype(srctype), srclen, desttype,
tds_prdatatype(desttype), destlen);
if (dbproc) {
tds = dbproc->tds_socket;
}
- if (src == NULL || (srclen == 0 && is_nullable_type(srctype))) {
+ if (src == NULL || (srclen == 0)) {
/* FIX set appropriate NULL value for destination type
*/
if (destlen > 0)
memset(dest, '\0', destlen);
if (destlen == -1 || destlen == -2)
*dest = '\0';
return 0;
}
/* srclen of -1 means the source data is definitely NULL
terminated */
>From Sybase doc:
srclen - The length, in bytes, of the data to be converted. If the
srclen is 0, the source data is assumed to be null and dbconvert will
place an appropriate null value in the destination variable. Otherwise,
this length is ignored for all datatypes except char, text, binary, and
image. For SYBCHAR, SYBBOUNDARY, and SYBSENSITIVITY data, a length of -1
indicates that the string is null-terminated. You can use dbdatlen to
get the length of the server data.
doc state also that srctype cannot be SYBINTN...
freddy77
- [freetds] still dblib rpc problems??, ZIGLIO, Frediano, VF-IT, 02/08/2005
Archive powered by MHonArc 2.6.24.