From e786909292a4ebd7e8e7a2c85d05d6464366e5f6 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Thu, 25 Jul 2019 12:51:13 +0900 Subject: [PATCH] Since commit 778571, SQLGetTypeInfo() filters SQL_TYPE_DATE, SQL_TYPE_TIME and SQL_TYPE_TIMESTAMP for ODBC 2.x applications. However it isn't appropriate to filter them for individual SQLGetTypeInfo(.., SQL_DATE/TIME/TIMESTAMP(9/10/11)) call because Microsoft ODBC driver manager calls SQLGetTypeInfo(.., SQL_TYPE_DATE/TIME/TIMESTAMP(91/92/93)) of ODBC 3.x drivers when ODBC 2.x applications call SQLGetTypeInfo(.., SQL_DATE/TIME/TIMESTAMP(9/10/11)). Per report from Michael Riksman. --- info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/info.c b/info.c index 452dabf..7626f3a 100644 --- a/info.c +++ b/info.c @@ -1155,8 +1155,8 @@ PGAPI_GetTypeInfo(HSTMT hstmt, { EnvironmentClass *env = CC_get_env(conn); - /* Filter unsupported data types */ - if (EN_is_odbc2(env)) + /* Filter unsupported data types when fSqlType = SQL_ALL_TYPES */ + if (SQL_ALL_TYPES == fSqlType && EN_is_odbc2(env)) { switch (sqlType) { -- 2.39.5