SQLGetConnectAttrW + SQL_ATTR_CURRENT_CATALOG => wrong byte count?

From: Marsupilami79 <marsupilami79(at)gmx(dot)de>
To: pgsql-odbc(at)lists(dot)postgresql(dot)org
Subject: SQLGetConnectAttrW + SQL_ATTR_CURRENT_CATALOG => wrong byte count?
Date: 2022-11-22 15:56:54
Message-ID: 39e35073-0cac-5d64-9a72-b47ea671fb20@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hello,

I am a co author of a data access library and we recently added an ODBC
bridge. This bridge has the capability to detemine the current Catalog /
Database. This is done by calling SQLGetConnectAttrW.

We try to determine the size of the buffer that is needed for the
catalog name in the following manner:
SQLGetConnectAttrW(fHDBC, SQL_ATTR_CURRENT_CATALOG, null, 0, &aLen)

The ODBC driver for Microsoft SQL server correctly returns the number of
bytes required (10 bytes for the Database name "Stork") in the aLen
parameter. The ODBC driver for PostgreSQL returns the number of
characters (8 characters for a database named "topsales"), where it
should return 16 for the number of bytes required.

I tested this with the psqlodbc_13_02_0000-x86 download for Windows 10
and installed the Unicode ODBC driver.

I assume this is a bug and needs to be fixed. I just don't know if this
is the right place to report the bug to?

With best regards,

Jan

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Wal, Jan Tjalling van der 2022-11-22 16:21:56 RE: SQLGetConnectAttrW + SQL_ATTR_CURRENT_CATALOG => wrong byte count?
Previous Message foxi_yiyi12081003 2022-11-10 10:20:01 [ Bug Report ]Re: column_query buffer in PGAPI ColumnPrivileges