Skip to Content.
Sympa Menu

freetds - Re: [freetds] A couple of bugs in 0.91 with dblib bcp library

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • 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: Sun, 22 May 2011 08:59:54 -0400

On Sun, 22 May 2011 11:02:46 +0200
Frediano Ziglio <freddy77 AT gmail.com> wrote:

> I did commit just some hour before :)
> You add a relaxation to term_len, not to bufpos.

I reverted that just now. Thanks for getting it right.

> I think that the idea behind Bill relaxation is really return: I have
> inserted 0 row (that is 0 return), not returning an error.
> For some reason Bill code issue an additional bcp_done without rows
> and Sybase code used to return 0 while FreeTDS returns error.

For now, until I hear from Bill, if bcp_done is called twice, it just
returns an error (-1). It used to invoke the error handler.

The programmer deserves to be told the function was called in
error. It is analogous to EBADF for close(2).

> Have you noted that this function is returning FAIL (0) instead of -1?

Er, no, bcp_done() returns DBINT, number of rows returned. Similar to
ffush(3). Maybe it *should* be a boolean, like fclose(3), but that's
another story.

> How I miss C++ and its type safety, I would use an enum and compiler
> gave me at least a warning :)

tds.h 144 #define TDS_SUCCESS 1

Your enum awaits, sire. ;-)

Regards,

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page