public inbox for [email protected]  
help / color / mirror / Atom feed
From: V T <[email protected]>
To: [email protected]
Subject: SQLGetDiagField bug
Date: Thu, 7 Oct 2021 02:22:31 +0300
Message-ID: <CALAVXY5JMTkKvXWDEOyBwVb1t2M1-pqop7oNpkZC6bQgTskEcw@mail.gmail.com> (raw)

SQLGetDiagField(SQL_DIAG_NUMBER) with SQL_HANDLE_DBC returns SQL_NO_DATA
even if an error record exists.

if I request one of unimplemented info types
SQL_DATETIME_LITERALS
SQL_STANDARD_CLI_CONFORMANCE
SQL_XOPEN_CLI_YEAR

    SQLUINTEGER bitmask;
    SQLRETURN rc;

    rc = SQLGetInfo(hdbc, SQL_DATETIME_LITERALS, &bitmask, sizeof(bitmask),
NULL); // _ASSERT(rc == 0);
    if (rc != SQL_SUCCESS)
    {
        SQLLEN numRecs;
        SQLCHAR Msg[SQL_MAX_MESSAGE_LENGTH + 1];

        rc = SQLGetDiagField(SQL_HANDLE_DBC, hdbc, 0, SQL_DIAG_NUMBER,
&numRecs, 0, nullptr); // _ASSERT(rc == 0);
        // returns SQL_NO_DATA

        // but this returns valid message
        rc = SQLGetDiagRec(SQL_HANDLE_DBC, hdbc, 1, NULL, NULL, Msg,
sizeof(Msg), NULL); _ASSERT(rc == 0);
        __debugbreak();
    }


Also there is a typo in function PGAPI_GetTypeInfo(HSTMT hstmt, SQLSMALLINT
fSqlType) [info.c]
https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=blob;f=info.c;h=2ce1a5acd19052c2525bdd5b2ab02701...
"RECISION" should be "PRECISION"


view thread (3+ messages)  latest in thread

reply

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: SQLGetDiagField bug
  In-Reply-To: <CALAVXY5JMTkKvXWDEOyBwVb1t2M1-pqop7oNpkZC6bQgTskEcw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox