[PATCH 0/1] MR10556: odbc32: Report SQL_TIMESTAMP format for timestamp data in ODBC 2.x application.
From: Piotr Caban <piotr@codeweavers.com> --- dlls/odbc32/proxyodbc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 066e9c14064..362ca8646a7 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -472,6 +472,16 @@ static struct environment *create_environment( void ) return ret; } +static struct environment *get_environment( struct object *obj ) +{ + while (1) + { + if (obj->type == SQL_HANDLE_ENV) return (struct environment *)obj; + if (!obj->parent) return NULL; + obj = obj->parent; + } +} + /************************************************************************* * SQLAllocEnv [ODBC32.002] */ @@ -6156,6 +6166,12 @@ SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNu ColumnSize, DecimalDigits, Nullable ); } + if (ret == SQL_SUCCESS && DataType && *DataType == SQL_TYPE_TIMESTAMP) + { + struct environment *env = get_environment( &stmt->hdr ); + if (env && env->attr_version == SQL_OV_ODBC2) *DataType = SQL_TIMESTAMP; + } + TRACE("Returning %d\n", ret); unlock_object( &stmt->hdr ); return ret; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10556
One concern I can think of is that applying type fixup in one place creates inconsistency with other calls. MSDN says this:
These changes affect SQLDescribeCol, SQLDescribeParam, and SQLColAttributes; SQLBindCol, SQLBindParameter, and SQLGetData; and SQLColumns, SQLGetTypeInfo, SQLProcedureColumns, SQLStatistics, and SQLSpecialColumns.
This is of course a lot to fix at once, but maybe we should have visible warnings for such cases. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10556#note_135015
On Sat Apr 4 15:51:11 2026 +0000, Nikolay Sivov wrote:
One concern I can think of is that applying type fixup in one place creates inconsistency with other calls. MSDN says this:
These changes affect SQLDescribeCol, SQLDescribeParam, and SQLColAttributes; SQLBindCol, SQLBindParameter, and SQLGetData; and SQLColumns, SQLGetTypeInfo, SQLProcedureColumns, SQLStatistics, and SQLSpecialColumns. This is of course a lot to fix at once, but maybe we should have visible warnings for such cases. I'll try to add FIXME's for missing cases.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10556#note_135037
participants (3)
-
Nikolay Sivov (@nsivov) -
Piotr Caban -
Piotr Caban (@piotr)