Skip to Content.
Sympa Menu

freetds - [freetds] SQLDescribeCol, current_statement and TDS_NO_MORE_RESULTS

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] SQLDescribeCol, current_statement and TDS_NO_MORE_RESULTS
  • Date: Tue, 27 Jan 2004 17:42:33 +0100

About this change:
http://cvs.sourceforge.net/viewcvs.py/freetds/freetds/src/odbc/odbc.c?r1
=1.291&r2=1.292&sortby=date

I don't really understand the problem and I don't think change is
correct...
The only reason SQLDescribeCol should fail with former code is when we
fetched all results, however why SQLDescribeCol should success in this
situation? Peter state that this was caused by a empty rowset with a
numeric but looking at the code and doing some tests do not help
(problem do not occur).
current_statement is used to store current statement, if statement is no
more active it's nosense to still retain old statement. Also issuing
another query on another statement cause current_statement to change so
SQLDescribeCol on first statement fails too.
A better workaround would be to comment these lines in SQLDescribeCol:

if (stmt->dbc->current_statement != stmt) {
odbc_errs_add(&stmt->errs, "24000", NULL, NULL);
ODBC_RETURN(stmt, SQL_ERROR);
}
IRD_CHECK;

so SQLDescribeCol return data from IRD without any check.
Naturally it would be better to understand the real problem... why and
when does SQLDescribeCol fail??

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page