Skip to Content.
Sympa Menu

freetds - Re: [freetds] CS_CMD_DONE is returned in error case

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] CS_CMD_DONE is returned in error case
  • Date: Fri, 3 Aug 2007 14:23:11 -0400

MATSUMOTO, Tadashi wrote:
> Hi all,
>
> The TDSDUMP is as follows.
>
> ct.c:1064:ct_results()
> ct.c:1117:ct_results() loop in.
> util.c:119:Changing query state from PENDING to READING
> net.c:446:Received header
> 0000 04 01 00 a0 00 33 01 00- |.....3..|
>
> net.c:542:Received packet
> 0000 aa 8c 00 fc 0a 00 00 3e-10 37 00 43 00 6f 00 75 |.......> .7.C.o.u|
> 0010 00 6c 00 64 00 20 00 6e-00 6f 00 74 00 20 00 66 |.l.d. .n .o.t. .f|
> 0020 00 69 00 6e 00 64 00 20-00 73 00 74 00 6f 00 72 |.i.n.d. .s.t.o.r|
> 0030 00 65 00 64 00 20 00 70-00 72 00 6f 00 63 00 65 |.e.d. .p .r.o.c.e|
> 0040 00 64 00 75 00 72 00 65-00 20 00 27 00 64 00 62 |.d.u.r.e . .'.d.b|
> 0050 00 6f 00 2e 00 73 00 70-00 5f 00 42 00 75 00 67 |.o...s.p ._.B.u.g|
> 0060 00 37 00 32 00 33 00 36-00 5f 00 54 00 65 00 73 |.7.2.3.6 ._.T.e.s|
> 0070 00 74 00 58 00 27 00 2e-00 09 47 00 54 00 32 00 |.t.X.'.. ..G.T.2.|
> 0080 31 00 31 00 31 00 31 00-38 00 31 00 00 01 00 fe |1.1.1.1. 8.1.....|
> 0090 02 00 e0 00 00 00 00 00- |........|
>
> token.c:526:processing result tokens. marker is aa(ERROR)
> token.c:105:tds_process_default_tokens() marker is aa(ERROR)
> token.c:2439:tds_process_msg() reading message from server
> read.c:179:tds_get_string: reading 110 from wire to give 55 to client.
> read.c:179:tds_get_string: reading 18 from wire to give 9 to client.
> token.c:2501:tds_process_msg() calling client msg handler
> token.c:2514:tds_process_msg() returning TDS_SUCCEED
> token.c:526:processing result tokens. marker is fe(DONEPROC)
> token.c:2143:tds_process_end: more_results = 0
> was_cancelled = 0
> error = 1
> done_count_valid = 0
> token.c:2159:tds_process_end() state set to TDS_IDLE
> util.c:119:Changing query state from READING to IDLE
> util.c:119:Changing query state from IDLE to PENDING
> ct.c:1123:ct_results() process_result_tokens returned 1 (type 4053)
> <--CS_CMD_FAIL was not returned. ct.c:1308:ct_results() results state =
> 0 token.c:514:tds_process_tokens() state is COMPLETED
> ct.c:1123:ct_results() process_result_tokens returned 2 (type 4052)
> <--CS_END_RESULTS ct.c:214:setting command state from SENT to READY
> ct.c:1773:ct_cmd_drop()
>
> MATSUMOTO, Tadashi wrote:
> > Hi all,
> >
> > I executed the following SQL by using the ct_send function.
> > " exec sp_XXXX "
> > (But "sp_XXXX" is not registered in DB.)
> >
> > The SQL was normally transmitted to Server, then "CS_SUCCEED" has
> > returned. The return value of result_type of the ct_results function
> > is "CS_CMD_DONE" in case of FreeTDS. but is "CS_CMD_FAIL" in case of
> > sybase,
> >
> > I think this is abnormal case, and I think sybase's behavior is
> > correct. How can I catch this error?

Thank you for this report. I added it to our TODO file.

The interesting part is this:

> ct.c:1123:ct_results() process_result_tokens returned 1 (type 4053)
> <--CS_CMD_FAIL was not returned.


I think that means our ct-lib error handler is not returning a value to
ct_results() that would cause it to fail.

If you want to try to fix it yourself, look at the ct-lib default error
handler.

HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page