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: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] dblib bcp, t0017 broken
  • Date: Sun, 29 Jan 2006 10:30:55 +0100

Il giorno sab, 28/01/2006 alle 13.57 -0500, James K. Lowden ha scritto:
> Frediano Ziglio wrote:
> > Il giorno ven, 27/01/2006 alle 15.10 -0500, Lowden, James K ha scritto:
> > >
> > > 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
> > >
> >
> > Mmm... here there should be no error, probably bcp.c detect eof like
> > error.
>
> There shouldn't be an error if the eof is normal -- when we're looking for
> column 1 data. If we hit eof while reading data in the middle of a row,
> it's an error. I haven't looked at t0017.in carefully, but if the file
> doesn't match the table, it's quite common to hit eof unexpectedly (even
> with the vendors' bcp).
>

well, if file format is not what bcp thinks you will only get garbage...
bcp file do not store format so you only can compute format from table
(witch may be different)... is something like using a int pointer for a
float :)
I fixed some problems with EOF (not detected on prefix code that is
native format). Now tests work correctly. It would be fun it you and
Bill could revise tests (t0016, t0017 and bcp) so I could backport to
0.64 branch.

> > > Normally I agree. The problem is that unit test errors can be
> > > confusing.
> >
> > This has to to with buffering using setbuf(stdout, NULL); setbuf(stderr,
> > NULL) will fix this problem.
>
> OK. I knew it was caused by buffering. We can set stdout to be
> unbuffered in the unit tests. That way the errors will show up where they
> belong.
>

Just to be sure I disabled buffering on both stdout and stderr :)

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page