You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
60 lines
2.6 KiB
Diff
60 lines
2.6 KiB
Diff
From ccd84e24c5af9ef8a99f19a3e0fa67a062cf5c1b Mon Sep 17 00:00:00 2001
|
|
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
|
Date: Fri, 2 May 2025 12:13:30 +1000
|
|
Subject: [PATCH] odbc32: SQLBindCol remap unicode field when using ANSI driver
|
|
|
|
---
|
|
dlls/odbc32/proxyodbc.c | 33 +++++++++++++++++++++++++++++++++
|
|
1 file changed, 33 insertions(+)
|
|
|
|
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
|
index 138ccb0f112..74d0ebe1db2 100644
|
|
--- a/dlls/odbc32/proxyodbc.c
|
|
+++ b/dlls/odbc32/proxyodbc.c
|
|
@@ -822,9 +822,42 @@ static SQLRETURN bind_col_unix( struct statement *stmt, SQLUSMALLINT column, SQL
|
|
}
|
|
}
|
|
|
|
+static BOOL driver_ansi_only( const struct win32_funcs *funcs )
|
|
+{
|
|
+ BOOL ansi = !( funcs->SQLBrowseConnectW || funcs->SQLColAttributeW || funcs->SQLColAttributesW ||
|
|
+ funcs->SQLColumnPrivilegesW || funcs->SQLColumnsW || funcs->SQLConnectW ||
|
|
+ funcs->SQLDescribeColW || funcs->SQLDriverConnectW || funcs->SQLErrorW ||
|
|
+ funcs->SQLExecDirectW || funcs->SQLGetConnectAttrW || funcs->SQLGetConnectOptionW ||
|
|
+ funcs->SQLGetCursorNameW || funcs->SQLGetDescFieldW || funcs->SQLGetDescRecW ||
|
|
+ funcs->SQLGetDiagFieldW || funcs->SQLGetDiagRecW || funcs->SQLGetInfoW ||
|
|
+ funcs->SQLGetStmtAttrW || funcs->SQLGetTypeInfoW || funcs->SQLNativeSqlW ||
|
|
+ funcs->SQLPrepareW || funcs->SQLPrimaryKeysW || funcs->SQLProceduresW ||
|
|
+ funcs->SQLSetConnectAttrW || funcs->SQLSetConnectOptionW || funcs->SQLSetCursorNameW ||
|
|
+ funcs->SQLSetDescFieldW || funcs->SQLSetStmtAttrW || funcs->SQLSpecialColumnsW ||
|
|
+ funcs->SQLStatisticsW || funcs->SQLTablePrivilegesW || funcs->SQLTablesW );
|
|
+
|
|
+ return ansi;
|
|
+}
|
|
+
|
|
static SQLRETURN bind_col_win32( struct statement *stmt, SQLUSMALLINT column, SQLSMALLINT type, SQLPOINTER value,
|
|
SQLLEN buflen, SQLLEN *retlen )
|
|
{
|
|
+ if ( driver_ansi_only(stmt->hdr.win32_funcs) )
|
|
+ {
|
|
+ UINT i = column - 1;
|
|
+ SQLSMALLINT orig_type = type;
|
|
+
|
|
+ /* For ANSI Drivers we need to remap to standard char binding to stop Fetch from causing an error */
|
|
+ if (type == SQL_C_WCHAR)
|
|
+ type = SQL_CHAR;
|
|
+
|
|
+ if (!alloc_binding( &stmt->bind_col, SQL_PARAM_INPUT_OUTPUT, column, stmt->row_count ))
|
|
+ return SQL_ERROR;
|
|
+
|
|
+ stmt->bind_col.param[i].col.target_type = type;
|
|
+ stmt->bind_col.param[i].col.target_value = value;
|
|
+ stmt->bind_col.param[i].col.buffer_length = orig_type;
|
|
+ }
|
|
if (stmt->hdr.win32_funcs->SQLBindCol)
|
|
return stmt->hdr.win32_funcs->SQLBindCol( stmt->hdr.win32_handle, column, type, value, buflen, retlen );
|
|
return SQL_ERROR;
|
|
--
|
|
2.50.1
|
|
|