[freetds] (-1 rows affected)

Thompson, Bill D (London) bill_d_thompson at ml.com
Thu Nov 6 17:01:07 EST 2003


I see,

defineitely sqsh 2.1 is to blame I think. I use 1.7....

here's the bottom of the dump

11:21:10.958278 processing result tokens.  marker is  79(RETURNSTATUS)
11:21:10.958408 ct_results() process_result_tokens returned 1 (type 4043)
11:21:10.958579 generating return status row. type = 56(int), varint_size 0
11:21:10.958708 ct_fetch()
11:21:10.958805 _ct_bind_data()
11:21:10.958901 _ct_get_server_type(0)
11:21:10.959029 ct_get_data() item = 1 buflen = 4
11:21:10.959157 ct_fetch()
11:21:10.959884 ct_results()
11:21:10.959999 processing result tokens.  marker is  fe(DONEPROC)
11:21:10.960137 tds_process_end: more_results = 0
11:21:10.960208                  was_cancelled = 0
11:21:10.960275                  error = 0
11:21:10.960335                  done_count_valid = 0
11:21:10.960443 tds_process_end() state set to TDS_IDLE
11:21:10.960544 ct_results() process_result_tokens returned 1 (type 4053)
11:21:10.960708 ct_results()
11:21:10.960813 ct_res_info()
11:21:10.960909 ct_res_info(): Number of rows is -1
11:21:10.961014 ct_results()
11:21:10.961108 tds_process_result_tokens() state is COMPLETED
11:21:10.961208 ct_results() process_result_tokens returned 2 (type 4052)
11:21:10.961391 ct_cmd_drop()
11:21:20.476229 ct_con_props() action = CS_GET property = 26
11:21:20.476436 ct_close()
11:21:20.476779 ct_con_drop()
11:21:20.476925 ct_exit()

We get a returnstatus token and a doneproc token
on the doneproc token you can see that the done count is not valid
(done_count_valid = 0)
You can see sqsh asking ctlibrary for the row count - the call to
ct_res_info - and we return CS_NO_COUNT (-1)

as the manual for ct_res_info states:

Applications that allow ad-hoc query entry may need to print a rows-affected
message (as done by the isql client application) when processing results. 
To do this, the application should do the following when ct_results
indicates a CS_CMD_DONE result_type value: 

Retrieve the row count with ct_res_info(CS_ROW_COUNT).

If the count is not CS_NO_COUNT, print it.

...It looks like sqsh is printing it even if it's CS_NO_COUNT....

(-1 rows affected, return status = 0)

sqsh 1.7 just prints 

(return_status = 0)


Bill


> -----Original Message-----
> From:	Lowden, James K [SMTP:LowdenJK at bernstein.com]
> Sent:	06 November 2003 16:36
> To:	'FreeTDS Development Group'
> Subject:	RE: [freetds] (-1 rows affected)
> 
> > From: Thompson, Bill D (London) [mailto:bill_d_thompson at ml.com]
> > Sent: November 6, 2003 9:42 AM
> > 
> > I tried the below test on latest snapshot of this a.m.
> > 
> > I got the same results, which look correct to me...have you 
> > anything I can reproduce my end ?
> 
> Attached is a script(1) session with sqsh and the corresponding TDSDUMP
> log.
> I'm using TDS 7.0, sqsh 2.1, and SQL Server 7.0.  And NetBSD, in case that
> matters.  The query is "sp_help systypes".  
> 
> If you run the same query, you should get the same log.  Perhaps something
> is different between our servers.  <shrug>
> 
> --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.
>  << File: evidence.tgz >>  << File: ATT3048398.txt >> 



More information about the FreeTDS mailing list