Skip to Content.
Sympa Menu

freetds - [freetds] ODBC bug: server errors not reported

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: [freetds] ODBC bug: server errors not reported
  • Date: Tue, 9 Mar 2004 17:21:30 -0500

> > I don't understand how SQLExecDirect() can (correctly) stop before
> > DONEPROC. How is the application expected to learn of the ERROR?
>
> I think on next SQLMoreResults or perhaps on SQLFetch (I didn't test
> it)...

Please try the attached diff. It creates a stored procedure that returns an
error behind a good resultset, and calls SQLBindCol() and SQLFetch(). It
does not see an error.

There is another problem:

if (discard_test < 1) {
/* generate an error */
printf("discard_test is %d\n", discard_test);
result = CommandWithResult(Statement, "EXEC testerror");

If this block of code is executed more than once -- "if (discard_test < 2)",
say -- the second time the Test() function is called will yield a 24000
cursor state error. The error is produced regardless of what command is
executed; it can be "testinsert". I don't know if that's my failure to use
the API correctly or a lingering problem in CVS head.

I have tested the "testerror" procedure with DBD::ODBC. It also does not
notice any error. For that reason, I think this is a FreeTDS bug.

Naturally I would be delighted to learn that my methodology is wrong. If you
can modify transaction.c to report the server's error message, that would be
great.

Thanks for your time, Freddy.

--jkl

-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the original
message. Please note that we do not accept account orders and/or instructions
by e-mail, and therefore will not be responsible for carrying out such orders
and/or instructions.
If you, as the intended recipient of this message, the purpose of which is to
inform and update our clients, prospects and consultants of developments
relating to our services and products, would not like to receive further
e-mail correspondence from the sender, please "reply" to the sender
indicating your wishes. In the U.S.: 1345 Avenue of the Americas, New York,
NY 10105.

Attachment: transaction.diff
Description: transaction.diff




Archive powered by MHonArc 2.6.24.

Top of Page