freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Craig A. Berry" <craigberry AT mac.com>
- To: freetds AT lists.ibiblio.org
- Subject: RE: [freetds] BCP performance
- Date: Thu, 6 Feb 2003 17:20:50 -0600
At 4:55 PM -0500 2/5/03, Lowden, James K wrote:
>
>The assert should express:
>
> if host_term is not null then host_termlen >= 0
> if host_term is null, then host_termlen == -1
>
>But if host_termlen is -1 the value of host_term is moot, really. Perhaps:
>
> assert ((host_termlen >= 0)? (host_term != NULL) : (host_term ==
>-1));
>
>expresses it better.
In your revised assert(), when host_termlen == 0, host_term is
required to be non-null, but if I understood your explanation, that's
the normal state of affairs for Microsoft servers when host_term is
not present. I *think* what you need is this (or some less verbose
expression of the same logic):
--- src/dblib/bcp.c;-0 Wed Feb 5 13:17:08 2003
+++ src/dblib/bcp.c Thu Feb 6 17:15:28 2003
@@ -309,7 +309,10 @@
return FAIL;
/* if there's a valid terminator, it needs a nonzero length. If
there's no terminator, its length should show that. */
- assert ((host_term != NULL && host_termlen >= 0) || (host_term ==
NULL && host_termlen == -1));
+ assert ((host_term != NULL)
+ ? (host_termlen > 0)
+ : ((host_termlen == -1) /* Sybase says no terminator
*/
+ || (host_termlen == 0))); /* Microsoft says no
terminator */
hostcol = dbproc->host_columns[host_colnum - 1];
[end of patch]
t0017 stops blowing up for me when I do that.
--
________________________________________
Craig A. Berry
mailto:craigberry AT mac.com
"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser
-
[freetds] BCP performance,
Lowden, James K, 02/04/2003
- <Possible follow-up(s)>
- RE: [freetds] BCP performance, Lowden, James K, 02/05/2003
-
RE: [freetds] BCP performance,
Lowden, James K, 02/05/2003
- RE: [freetds] BCP performance, Frediano Ziglio, 02/05/2003
-
RE: [freetds] BCP performance,
Lowden, James K, 02/05/2003
- RE: [freetds] BCP performance, Craig A. Berry, 02/06/2003
- RE: [freetds] BCP performance, Lowden, James K, 02/07/2003
Archive powered by MHonArc 2.6.24.