pgsql-odbc SQLGetDiagRec() API issue. - Mailing list pgsql-odbc

From Tukaram Gaikwad
Subject pgsql-odbc SQLGetDiagRec() API issue.
Date
Msg-id CAKu4boGCoHjKTEuwjSf5J2PgnZ-GcVUAFiPVQKjTvAR3E3wCpQ@mail.gmail.com
Whole thread Raw
Responses Re: pgsql-odbc SQLGetDiagRec() API issue.  (Craig Ringer <craig.ringer@enterprisedb.com>)
List pgsql-odbc

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.    

pgsql-odbc by date:

Previous
From: Tukaram Gaikwad
Date:
Subject: pgsql-odbc SQLGetDiagRec() API issue
Next
From: Craig Ringer
Date:
Subject: Re: pgsql-odbc SQLGetDiagRec() API issue.