[freetds] a few ctlib issues

Mark J. Lilback mark at lilback.com
Tue Dec 17 10:49:45 EST 2002


I've traced down the ct_cancel error I'm getting and wanted to ask 
opinions on fixing it.

According to the ctlib reference docs, ct_fetch should only be called 
if ct_results returns a value indicating fetchable results. In the 
case of an error, ct_results returns CS_CMD_FAIL which does not 
indicate fetchable results.

I see a couple of places that could be adjusted based on this.

1) make ct_fetch return CT_FAIL if cmd->curr_result_type does not 
indicate fetchable results.

2) have ct_cancel check the curr_result_type of the cmd being 
canceled and not call ct_fetch if there is nothing to fetch. It 
should also return CS_SUCCEED and not CS_FAIL if there are no 
fetchable results.

I've made both changes locally and will commit them unless someone 
thinks only one of them should be made.

Also, the cs_command struct has a variable named cmd_done that is 
never used in any of the soure files in src/ctlib. Any reason to keep 
it?


-- 
__________________________________________________________________________
                                   "They that can give up essential liberty
Mark J. Lilback                    to obtain a little temporary safety
<mark at lilback.com>                 deserve neither liberty or safety."
http://www.lilback.com/                               -- Benjamin Franklin



More information about the FreeTDS mailing list