Skip to Content.
Sympa Menu

freetds - Re: dg/ux challenges

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Jeff Driscoll" <jdriscol AT gate.net>
  • To: freetds
  • Subject: Re: dg/ux challenges
  • Date: Sun, 26 Sep 1999 18:28:38


I also included another clue after the code.

gcc -v reports:
gcc version 2.7.2 (ix86 DG/ux, DG-2.7.2.9, Feb 3 1998)

>From src/tds/token.c:

int tds_process_result_tokens(TDSSOCKET *tds)
{
int result=0;
int marker;
int more_results = 0;
int cancelled;
fprintf(stderr, "inside tds_proc_res_toks()\n");
if (tds->res_info && tds->res_info->state==TDS_COMPLETED) {
/* tds_process_row() now eats the end marker and sets
** state to TDS_COMPLETED
*/
return TDS_NO_MORE_RESULTS;
}

/* get_incoming(tds->s); */
do {
marker=tds_get_byte(tds);
tdsdump_log("%L processing result tokens. marker is %x\n", marker);
fprintf(stderr,"processing result tokens. marker is %d\n",marker);

switch(marker) {
case TDS_ERR_TOKEN:
case TDS_MSG_TOKEN:
case TDS_EED_TOKEN:
tds_process_msg(tds,marker);
break;
case TDS_RESULT_TOKEN:
if (!result) {
tds_process_result(tds);
result++;
} else {
tds_unget_byte(tds);
return TDS_SUCCEED;
}
break;
case TDS_COL_NAME_TOKEN:
if (!result) {
tds_process_col_name(tds);
result++;
} else {
tds_unget_byte(tds);
return TDS_SUCCEED;
}
break;
case TDS_ROW_TOKEN:
if (!result) {
} else {
tds->res_info->rows_exist=1;
tds_unget_byte(tds);
return TDS_SUCCEED;
}
case TDS_RET_STAT_TOKEN:
tds->res_info->has_status=1;
tds->res_info->ret_status=tds_get_int(tds);
/* return TDS_SUCCEED; */
break;
case TDS_END_TOKEN:
case TDS_END2_TOKEN:
case TDS_END3_TOKEN:
tds_process_end(tds, marker,
&more_results,
&cancelled);
break;
default:
tds_process_default_tokens(tds, marker);
break;
}
} while (!is_end_token(marker) || more_results);

if (tds->res_info)
tds->res_info->state=TDS_COMPLETED;

if (tds->msg_info && tds->msg_info->priv_msg_type==1)
return TDS_FAIL;

return TDS_NO_MORE_RESULTS;
}

Possible clue. This is what happens when the first sql statement succeeds
and then the bogus sql statement is entered.

1> select count(*) from OWNERS
2> go
entering ct_results()
inside tds_proc_res_toks()
processing result tokens. marker is 160
processing result tokens. marker is 161
processing result tokens. marker is 209
ct_results() returning CS_SUCCEED res_type = 4

-----------
257838
entering ct_results()
entering ct_results()
inside tds_proc_res_toks()
ct_results() returning CS_END_RESULTS res_type = CS_CMD_DONE

(1 row affected)

1> select * from sys_users
2> go
entering ct_results()
inside tds_proc_res_toks()
processing result tokens. marker is 170
Msg 208, Level 16, State 1
Server 'VSTNCDB', Line 1
Invalid object name 'sys_users'.
processing result tokens. marker is 253
ct_results() returning CS_SUCCEED res_type = CS_CMD_FAIL
entering ct_results()
inside tds_proc_res_toks()
ct_results() returning CS_END_RESULTS res_type = CS_CMD_DONE


On 09/26/99, "Brian Bruns <camber AT umcc.ais.org>" wrote:
> This makes no logical sense. I hate to say it but I have no other
> explaination than compiler or OS bug. Please check to see if gcc is being
> invoked with -O something, if so remove the -O flag. Maybe over agressive
> optimization is biting us. Also, can you post your version of
> tds_process_result_tokens() to make sure it matches mine?
>




Archive powered by MHonArc 2.6.24.

Top of Page