From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: SQLGetDiagRec should not clear error.
Date: Thu, 10 Apr 2014 22:01:30 +0300
Message-ID: <5346EA8A.5080902@vmware.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
A colleague of mine pointed out that calling SQLGetDiagRec on a
connection, after the connection has failed, clears the current error.
The consequence is that if you call SQLGetDiagRec twice, and the first
call returns an error, the second call might return no error. According
to the ODBC spec:
> Calls to SQLGetDiagRec are nondestructive to the header and record
> fields. The application can call SQLGetDiagRec again at a later time to
> retrieve a field from a record as long as no other function, except
> SQLGetDiagRec, SQLGetDiagField, or SQLError, has been called in the interim.
Digging into the commit log, the code line that clears the error message
in CC_get_error has been there since the very first commit.
I pushed a patch to fix that, removing the line in CC_get_error that
clears the error number. I also added a regression test that
demonstrates the issue.
- Heikki
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: hlinnakangas@vmware.com
Subject: Re: SQLGetDiagRec should not clear error.
In-Reply-To: <5346EA8A.5080902@vmware.com>
References: <5346EA8A.5080902@vmware.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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