[freetds] _SQLExecute clearing of current_statement member

Aaron crackajaxx at gmail.com
Fri Apr 29 13:11:15 EDT 2005


FreeTDS version: 0.62.3
UnixODBC version: 2.2.8
Platform: Gentoo Linux 2.6

I'm using DTL (and this could clearly be an issue with DTL) and I
noticed an issue when performing a query on something that returns an
empty set.  The path follows its way down to _SQLExecute() and the
statement succeeds.  It performs a test and finds the value to be
TDS_NO_MORE_RESULTS.  It sets stmt->dbc->current_statement to null and
returns SQL_SUCCESS.  No problems so far.

DTL in response to this calls SQLFetch which makes its way to
_SQLFetch().  The call returns SQL_SUCCESS_WITH_INFO.  The call to
_SQLFetch() checks that the calling statement is the same as
current_statement (which is now NULL) and it raises an error 24000
indicating that the cursor is invalid.

Any thoughts on this?


More information about the FreeTDS mailing list