Skip to Content.
Sympa Menu

freetds - RE: infinte loop

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Wilson, John" <John.Wilson AT savvis.net>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: infinte loop
  • Date: Fri, 25 Oct 2002 15:01:32 -0500


TDS Group:
I think I have figured out *where* the problem is with the code below. I'm
not sure how to fix or even if the res_type is appropriate return type for
ct_results.

This is the same TDSDUMP as before, but I've cleaned it up hopefully to make
it a little more clear where I think the problem is:
___________________________________________________________
0fc0 e2 e4 00 0e 00 31 36 37 2e 37 36 2e 31 32 37 2e |.....167.
76.127.|
0fd0 31 30 31 11 00 2e 31 2e 33 2e 36 2e 31 2e 32 2e |101...1.3
.6.1.2.|
0fe0 31 2e 31 2e 31 2e 01 00 30 d1 05 01 01 e2 e4 00 |1.1.1...0
.......|
0ff0 0e 00 31 36 37 2e 37 36 |..167.76|

2002-10-24 14:54:35.897704 processing result tokens. marker is 81
2002-10-24 14:54:35.897899 inside ct_results() process_result_tokens
returned 1 (type 4049)
2002-10-24 14:54:35.898077 processing result tokens. marker is d1
2002-10-24 14:54:35.898254 inside ct_results() process_result_tokens
returned 1 (type 4040)
2002-10-24 14:54:35.899049 inside ct_results()
etc...
__________________________________________________________

jdw> the first res_type is 4049, which is CS_ROWFMT_RESULT
(TDS_ROWFMT_RESULT).
Then what follows is the CS_ROW_RESULT type.

Looking at the switch() statement in ct.lib (v1.38) it appears that
CS_ROWFMT_RESULT is being handled, but I'm not sure what the real protocol
should be.

case CS_ROWFMT_RESULT:
if (context->config.cs_expose_formats) {
done = 1;
retcode = CS_SUCCEED;
*result_type = res_type;
}
break;

In addition, there is no CS_ROW_RESULT case here... and maybe because the
previous res_type was not handled properly, the CS_ROW_RESULT cannot be
handled inside this while loop inside ct.c.

If any one can help it would be much appreciated. Maybe I should find a
simpler way to process this sql statement. This is legacy perl code and it
has some error processing done to look for 1205 and deadlock issues. The
data that should be returned is about 24K rows.

I'm also curious about the tds dump above cutting one byte short of 4K.
Maybe there is a buffer issue here?

One think I considered to, is maybe there is something I need to setup in
calling ct_config() as I think this is where the cs_expose_formats is set,
but I'm not sure what to set that to, or if it's needed. It must be zero
since done does not get set to 1 above and thus the while loop continues
with a call to tds_process_result() picking up the 4040.

I would think if the res_type was 4040 and it was not handled in the case
statement, it would hit the default and still break out of the while() loop.
This is also not being done... at least the best I can determine.

thanks again,
john




Archive powered by MHonArc 2.6.24.

Top of Page