Skip to Content.
Sympa Menu

freetds - Re: [freetds] dblib bcp, t0017 broken

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] dblib bcp, t0017 broken
  • Date: Fri, 27 Jan 2006 15:10:47 -0500

> From: ZIGLIO, Frediano, VF-IT
> Sent: Friday, January 27, 2006 11:31 AM
>
> I agree more verbose is better. I noted that in dblib unittests
> there are a lot of
>
> while (dbresults(dbproc) != NO_MORE_RESULTS) {
> /* nop */
> }

:-( Your're right, there should be a test for error. That's
actually related to the next point.

> I don't understand INT_CANCEL problem... which error is not reported?
> I noted that t0017 just store error in ret variable...

fprintf(stderr, "bcp_exec ... ");
ret = bcp_exec(dbproc, &rows_copied);
if (ret != SUCCEED)
failed = 1;
else
fprintf(stderr, "done\n");

Output:

bcp_exec... DB-LIBRARY error (severity 3, dberr 20070, oserr 0,
dberrstr I/O error while reading bcp datafile, oserrstr Undefined error:
0):
done

The error was not detected (ret == SUCCEED), but not for the reason I
thought. _bcp_read_hostfile had no way to return a fatal EOF condition,
so the caller never detected and never returned the error to the
application. Fixed in CVS HEAD.

> > 3. (small problem) the common.c error handler writes to stderr,
> > making it unclear amidst stdout where precisely the message
> > occured.
> > For that
> > reason, I modified t0017 to write some of its feedback to stderr.
> > Do you think the handler should use stdout instead?
> >
>
> I think stderr is for error while stdout for normal output.

Normally I agree. The problem is that unit test errors can be
confusing. When t0017 writes normal messages to stdout and its error
handler writes to stderr, I get this:

bcp_exec... done
DB-LIBRARY error (severity 3, dberr 20070, oserr 0, dberrstr I/O error
while reading bcp datafile, oserrstr Undefined error: 0):

which makes it look like the error came after successful completion of
bcp_exec. Writing "bcp_exec... done" to stderr causes the message to be
interleaved properly:

bcp_exec... DB-LIBRARY error (severity 3, dberr 20070, oserr 0, dberrstr
I/O error while reading bcp datafile, oserrstr Undefined error: 0):
done

> > I don't know how much of this affects 0.64.
>
> I think all :)

Then I think we should delay the release until we either fix it or give
up. I'll work on the RC anyway, betting Bill has his arms around this
one.


-----------------------------------------
The information contained in this transmission may be privileged and
confidential 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. If you, as the intended
recipient
of this message, the purpose of which is to inform and update our clients,
prospects
and consultants of developments relating to our services and products, would
not
like to receive further e-mail correspondence from the sender, please "reply"
to the
sender indicating your wishes. In the U.S.: 1345 Avenue of the Americas, New
York,
NY 10105.




Archive powered by MHonArc 2.6.24.

Top of Page