Skip to Content.
Sympa Menu

freetds - RE: [freetds] freebcp loads -1 rows

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] freebcp loads -1 rows
  • Date: Fri, 6 Jun 2003 15:39:21 -0400

> From: Lowden, James K [mailto:LowdenJK AT bernstein.com]
> Sent: June 5, 2003 1:35 PM
>
> The message from freebcp is "-1 rows copied."
>
> I have a feeling tds_process_simple_query() isn't playing
> nicely in _bcp_exec_in(), but it's not clear to me what
> should be done.

Freddy,

For the time being, I added "tds_do_until_done()" and substituted it for
tds_process_simple_query() at the tail end of _bcp_exec_in(). freebcp now
loads the table it was failing to load, as it had done with bcp.c revision
1.65.

My fix probably leaves TDS 5.0 broken, because that branch of the code
relies on tds_process_simple_query(). I left it that way in case you're
intending to fix/replace tds_process_simple_query() yourself. Let me know
which way you want to go.

The problem, as you can see by comparing the two functions, is that
tds_process_simple_query() wasn't setting tds->rows_affected. I think
that's because it doesn't insist on seeing a TDS_DONE_TOKEN before it
returns. That is, it returns too early, resulting in an incomplete TDS
conversation, and the server never commits the row(s).

Perhaps tds_process_simple_query() should be called
"tds_discard_query_results()"?

Bill, Marc, please try tonight's snapshot and tell me how you fare.

--jkl
-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information 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.






Archive powered by MHonArc 2.6.24.

Top of Page