From: Hiroshi Inoue Date: Wed, 2 May 2018 02:09:30 +0000 (+0900) Subject: Fix SQLGetTypeInfo() so that it filters SQL_TYPE_DATE, SQL_TYPE_TIME or SQL_TYPE_TIME... X-Git-Tag: REL-10_03_0000~8 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=7785712b495e79e47067a10617fba962b4be4f72;p=psqlodbc.git Fix SQLGetTypeInfo() so that it filters SQL_TYPE_DATE, SQL_TYPE_TIME or SQL_TYPE_TIMESTAMP for ODBC 2.x applications. Per report from Oleg Tonkikh. --- diff --git a/info.c b/info.c index 1f0818f..8fa0b9b 100644 --- a/info.c +++ b/info.c @@ -1151,6 +1151,20 @@ PGAPI_GetTypeInfo(HSTMT hstmt, for (i = 0, sqlType = sqlTypes[0]; sqlType; sqlType = sqlTypes[++i]) { + EnvironmentClass *env = CC_get_env(conn); + + /* Filter unsupported data types */ + if (EN_is_odbc2(env)) + { + switch (sqlType) + { + case SQL_TYPE_DATE: + case SQL_TYPE_TIME: + case SQL_TYPE_TIMESTAMP: + continue; + } + } + pgType = sqltype_to_pgtype(conn, sqlType); if (sqlType == SQL_LONGVARBINARY)