Re: BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: gayathri(dot)annur(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND
Date: 2014-04-08 01:35:27
Message-ID: CAB7nPqTDJ1D8W9S7StLmYfz4zwQH1QQqsfwFUzpnRWigw2V2Dw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Apr 7, 2014 at 8:36 PM, <gayathri(dot)annur(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Gayathri Manoj 2014-04-08 04:36:19 Re: BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND
Previous Message bricklen 2014-04-08 01:00:05 Re: BUG #9898: WindowAgg's causing horrific plans