freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] A couple of bugs in 0.91 with dblib bcp library
- From: "James K. Lowden" <jklowden AT freetds.org>
- To: freetds AT lists.ibiblio.org
- Subject: Re: [freetds] A couple of bugs in 0.91 with dblib bcp library
- Date: Sat, 21 May 2011 14:32:15 -0400
On Sat, 21 May 2011 08:35:29 +0100
"Thompson, William" <bill.d.thompson AT baml.com> wrote:
Hi Bill,
> - assert(bufpos > 0);
> + assert(bufpos >= 0);
Committed.
> - CHECK_PARAMETER(dbproc->bcpinfo, SYBEBCPI, FAIL);
> + if (!(dbproc->bcpinfo))
> + return 0;
Committed, except IMO the return code should be -1. My reasoning is
the application should be able to detect a logical error, and the
function is misused if called twice without an intervening (and
successful) bcp_init().
If the application is cavalier:
bcp_done(dbproc);
bcp_done(dbproc);
will now succeed and fail silently, in that order. If it's careful:
if( bcp_done(dbproc) == -1 ) {
/* do error stuff */
}
if( bcp_done(dbproc) == -1 ) {
/* do error stuff */
}
it will break, as well it should, as the programmer should prefer.
If that doesn't suit you, I'll #ifdef it for you.
Regards,
--jkl
-
[freetds] A couple of bugs in 0.91 with dblib bcp library,
Thompson, William, 05/21/2011
-
Re: [freetds] A couple of bugs in 0.91 with dblib bcp library,
James K. Lowden, 05/21/2011
-
Re: [freetds] A couple of bugs in 0.91 with dblib bcp library,
Frediano Ziglio, 05/22/2011
-
Re: [freetds] A couple of bugs in 0.91 with dblib bcp library,
James K. Lowden, 05/22/2011
-
Re: [freetds] A couple of bugs in 0.91 with dblib bcp library,
Thompson, William, 05/23/2011
- Re: [freetds] A couple of bugs in 0.91 with dblib bcp library, Thompson, William, 05/23/2011
-
Re: [freetds] A couple of bugs in 0.91 with dblib bcp library,
Frediano Ziglio, 05/23/2011
- Re: [freetds] A couple of bugs in 0.91 with dblib bcp library, James K. Lowden, 05/24/2011
-
Re: [freetds] A couple of bugs in 0.91 with dblib bcp library,
Thompson, William, 05/23/2011
-
Re: [freetds] A couple of bugs in 0.91 with dblib bcp library,
James K. Lowden, 05/22/2011
-
Re: [freetds] A couple of bugs in 0.91 with dblib bcp library,
Frediano Ziglio, 05/22/2011
-
Re: [freetds] A couple of bugs in 0.91 with dblib bcp library,
James K. Lowden, 05/21/2011
Archive powered by MHonArc 2.6.24.