Skip to Content.
Sympa Menu

freetds - RE: [freetds] BCP performance

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'freetds AT lists.ibiblio.org'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] BCP performance
  • Date: Wed, 5 Feb 2003 16:55:55 -0500

> From: Frediano Ziglio [mailto:freddyz77 AT tin.it]
> Sent: February 5, 2003 4:30 PM
>
> There is a patch after 0.61rc1 (in BRANCH0_61) that add an assert in
> bcp.c that cause t0017 test (dblib) to fail. I think we
> should fix this before 0.61...

I added that assertion. I'll look at t0017 tonight (if you don't first).

bcp_colfmt() was definitely broken: it relied on termlen being reasonable
for memcpy(), but one valid value for termlen, per Sybase, is -1 (no
terminator). Microsoft says no terminator means termlen should be zero,
with IMO is more sensible.

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.

Had I known the proper Sybase error code for those conditions, I would have
returned it before reaching the new assert statement.

--jkl


The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that we do not accept account orders and/or
instructions by e-mail, and therefore will not be responsible for carrying
out such orders and/or instructions.






Archive powered by MHonArc 2.6.24.

Top of Page