Skip to Content.
Sympa Menu

freetds - Re: [freetds] possible bug: bcp_bind seems to be broken when using variables assignment

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] possible bug: bcp_bind seems to be broken when using variables assignment
  • Date: Thu, 30 Jan 2003 02:31:27 -0500

On Wed, 29 Jan 2003 22:12:55 -0800, "Anwar, Mohammed"
<mohammed.anwar AT intel.com> wrote:
> Hi,
> When using bcp_init followed by bcp_bind the bcp_bind will always
> fail (for me anyway, and I have tried a number of variations on
> the parameters to bcp_bind).
>
> Once I looked at the code I realized why the bind was failing.
>
> I looked at the source in bcp.c and it seems bcp_bind has a check
> for :
> if (table_column > dbproc->host_colcount)
> return FAIL;
>
>
> which will always be return FAIL as the dbproc->host_colcount
> variable is set to 0 in the bcp_init when calling :
> _bcp_clear_storage(dbproc);
>
> it seems this variable is only updated when the input file is
> provided and a call is made to
> bcp_columns
>
> the bcp_init function only updates the dbproc->bcp_colcount
> variable.

And my bcp_bind documentation says:

"It is an error to call bcp_columns when using bcp_bind."

Funny, there's no unit test for bcp_bind. Hmph.

Mohammed, a quick check of the CVS code confirms what Bill says, that
bcp_init() sets things up correctly. Rather than a log, could you just
send a little test case that demonstrates the problem? I'd like to add it
to our unit tests once the problem is solved, one way or the other.

Regards,

--jkl







Archive powered by MHonArc 2.6.24.

Top of Page