pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND
3+ messages / 3 participants
[nested] [flat]
* BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND
@ 2014-04-07 11:36 gayathri.annur@gmail.com
2014-04-08 01:35 ` Re: BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND Michael Paquier <michael.paquier@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: gayathri.annur@gmail.com @ 2014-04-07 11:36 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 9894
Logged by: Gayathri
Email address: gayathri.annur@gmail.com
PostgreSQL version: 9.1.1
Operating system: redhat
Description:
Hi ALL,
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.
Please let me know how can I proceed further. Shall I need to handle each
state separately?
Thanks,
Gayathri
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND
2014-04-07 11:36 BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND gayathri.annur@gmail.com
@ 2014-04-08 01:35 ` Michael Paquier <michael.paquier@gmail.com>
2014-04-08 04:36 ` Re: BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND Gayathri Manoj <gayathri.annur@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Michael Paquier @ 2014-04-08 01:35 UTC (permalink / raw)
To: gayathri.annur@gmail.com; +Cc: 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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND
2014-04-07 11:36 BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND gayathri.annur@gmail.com
2014-04-08 01:35 ` Re: BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND Michael Paquier <michael.paquier@gmail.com>
@ 2014-04-08 04:36 ` Gayathri Manoj <gayathri.annur@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Gayathri Manoj @ 2014-04-08 04:36 UTC (permalink / raw)
To: Michael Paquier <michael.paquier@gmail.com>; +Cc: pgsql-bugs
Hi Michel,
Thanks for your response.
I changed SQLRETURN instead of RETCODE.
My postgress driver version is psqlodbc-09.01.0100.
my code is mentioned below and its worked fine for old version. For
missing table first i will get rc as HY000 and then next iteration i will
get 00000.
But in later version I am getting 42P01 and its looping. If i add an if
condition to to break the loop for the error case 42P01 then its working.
So please let me know do we have to handle each case separately or any
behavior change happens to the SQLError() API in later versions.
bool ODBCConn: errors(()
{
SQLRETURN rc = SQL_SUCCESS;
while (rc !=SQL_NO_DATA_FOUND) {
rc = SQLError(henv, hdbc, hstmt, sqlstate, &nativeerr, errmsg,
SQL_MAX_MESSAGE_LENGTH
- 1, &actualmsglen);
if (rc != SQL_NO_DATA_FOUND) {
if(strcmp(state,"01004")==0)
return true;
else {
code to compare some general error (
"08S01", "08001""08004",.."S1T00")
discoonect db;
}
}
}
return true;
}
Please let me know how can post this same mail thread to
pgsql-odbc<http://www.postgresql.org/mailpref/pgsql-odbc;
.
Thanks,
Gayathri
On Tue, Apr 8, 2014 at 7:05 AM, Michael Paquier
<michael.paquier@gmail.com>wrote:
> 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
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2014-04-08 04:36 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-04-07 11:36 BUG #9894: SQLError() is not returns SQL_NO_DATA_FOUND gayathri.annur@gmail.com
2014-04-08 01:35 ` Michael Paquier <michael.paquier@gmail.com>
2014-04-08 04:36 ` Gayathri Manoj <gayathri.annur@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox