Re: pgsql-odbc SQLGetDiagRec() API issue.

From: Craig Ringer <craig(dot)ringer(at)enterprisedb(dot)com>
To: Tukaram Gaikwad <tukaramgaikwad10(at)gmail(dot)com>
Cc: pgsql-odbc(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql-odbc SQLGetDiagRec() API issue.
Date: 2020-12-09 11:58:17
Message-ID: CAGRY4nxMjYonA94RYzDvJYoq1RaPxA2kKsuHqA8kkfL=54oaQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

On Wed, 9 Dec 2020 at 17:55, Tukaram Gaikwad <tukaramgaikwad10(at)gmail(dot)com>
wrote:

> Hi team,
>
>
>
> We killed Postgress node and called *SQLExecute()*.
>
>
>
> *SQLExecute() *function fail and return *-1*, to get diagnostic info I
> called *SQLGetDiagRec()*
>
> this function but it gives me *SQLState* as *"00000"* which is
> *SQL_SUCCESS*,
>
> in failure case which wrong.
>
>
>
> Actually it should give *NO_CONNECTION* SQLState.
>
>
> *PostgreSQL running vesion on env*: *psql (PostgreSQL) 12.1*
>
>
>
> *CODE Snippet.*
>
>
>
> long retcode = SQLExecute(this->m_OdbcStmt);
>
>
>
> SQLCHAR messageText[SQL_MAX_MESSAGE_LENGTH + 1] = {0};
>
> SQLCHAR state[SQL_SQLSTATE_SIZE + 1] = {0};
>
> SQLSMALLINT textLength = SQL_MAX_MESSAGE_LENGTH + 1;
>
>
>
> SQLSMALLINT idx = 1;
>
> sqlgetdiagrecret = SQLGetDiagRec(SQL_HANDLE_STMT,
>
> this->m_OdbcStmt,
>
> idx,
> //record Number
>
>
> state, //
>
>
> &o_errorNo, //native Error Pointer
>
> messageText,
> //Message Text
>
>
> SQL_MAX_MESSAGE_LENGTH + 1, //buffer length
>
> &textLength
> //length of message text
>
> );
>
>
> Please help us to resolve this issue.
>

I suggest starting with a complete and compileable test case.

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Ingmar Koecher 2020-12-09 19:52:32 ODBC Driver Crash
Previous Message Tukaram Gaikwad 2020-12-09 09:54:30 pgsql-odbc SQLGetDiagRec() API issue.