[freetds] tds_process_result_tokens/tds_process_row_tokens change

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Mon Feb 16 08:08:06 EST 2004


I would like to change these functions. The reason is to fix some issue:
- on last TDS_DONE token rows is stored in TDSSOCKET and state goes to
IDLE. This can cause some race conditions using multiple statement
- the only difference between
tds_process_result_tokens/tds_process_row_tokens/tds_process_row_tokens_
ct is the token type it handle.
I propose a new function that can handle all token

int tds_process_tokens(TDSSOCKET *tds, unsigned token_types,
TDSTOKENRESULT *results);

where TDSTOKENRESULT it's a structure like

typedef struct {
	TDS_INT type; /* DONE/DONEINPROC/RESULT/ROW/COMPUTE_ROW and so
on */
	union {
		TDS_INT computeid;
		struct {
			int flags;
			TDS_UINT count;
		} done;
		...
	} r;
} TDSTOKENRESULT;

and token_types is a set of flags that describe what class of tokens to
handle (ROWS/METADATA/DONE, etc.)

freddy77



More information about the FreeTDS mailing list