Re: BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND
Date
Msg-id CAB7nPqTDJ1D8W9S7StLmYfz4zwQH1QQqsfwFUzpnRWigw2V2Dw@mail.gmail.com
Whole thread Raw
In response to BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND  (gayathri.annur@gmail.com)
Responses Re: BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND  (Gayathri Manoj <gayathri.annur@gmail.com>)
List pgsql-bugs
On Mon, Apr 7, 2014 at 8:36 PM,  <gayathri.annur@gmail.com> wrote:
> The following bug has been logged on the website:
> PostgreSQL version: 9.1.1
You are missing years of bug fixing, some of them being critical from
security viewpoint. you should try to update to 9.1.13, the latest
minor release of Postgres 9.1 asap.

> SQLError() is not returning SQL_NO_DATA_FOUND after driver upgrade from 7 to
> 9.
>
> my code looks like
>
> RETCODE rc = SQL_SUCCESS;
> while ( rc != SQL_NO_DATA_FOUND)
> {
>     rc = SQLError(henv, hdbc, hstmt, sqlstate, &nativeerr, errmsg,
>                  SQL_MAX_MESSAGE_LENGTH - 1, &actualmsglen);
>
>  }
> And whenever I try to access an missing table, I am getting sqlstate as
> 42P01 and rc as SQL_SUCCESS and it is not coming out of the loop. The same
> code worked fine for earlier version.
A couple of things:
- SQLError is an API of the ODBC driver, this has directly nothing to
do with Postgres itself, so this bug report should be sent to
pgsql-odbc
- You should avoid RETCODE here, SQLRETURN should be used with
SQLError, even if intrinsically both are signed short integers...

> Please let me know how can I proceed further. Shall I need to handle each
> state separately?
It is hard to guess what you are doing wrong here without knowing the
version of the Postgres ODBC driver you are using. The settings of
your driver would also help. The code you cite here is incomplete as
well. It is not possible to guess what you are doing wrong with this
statement handle.
Regards,
--
Michael

pgsql-bugs by date:

Previous
From: bricklen
Date:
Subject: Re: BUG #9898: WindowAgg's causing horrific plans
Next
From: "Sofer, Yuval"
Date:
Subject: Re: Postgres 9.2.8 crash sporadically on Windows