mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
ad13b6a9e1
This fixes issue with the current odcb32 for writing to database and support for ODBC v2.0. This is a replacement for odbc-remove-unixodbc as ODBC32 now supports both unixODBC and native drivers.
69 lines
3.4 KiB
Diff
69 lines
3.4 KiB
Diff
From e934286dc1be469392c92cbca9d862d33edfd9e7 Mon Sep 17 00:00:00 2001
|
|
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
|
Date: Fri, 12 Jul 2024 14:29:17 +1000
|
|
Subject: [PATCH] odbc32: SQLGetDiagRec/W handle fallback function
|
|
|
|
---
|
|
dlls/odbc32/proxyodbc.c | 37 ++++++++++++++++++++++++++++++++++---
|
|
1 file changed, 34 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
|
index 31a789b26a4..e955c5f86f7 100644
|
|
--- a/dlls/odbc32/proxyodbc.c
|
|
+++ b/dlls/odbc32/proxyodbc.c
|
|
@@ -1807,8 +1807,23 @@ SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMAL
|
|
}
|
|
else if (handle->win32_handle)
|
|
{
|
|
- ret = handle->win32_funcs->SQLGetDiagRec( HandleType, handle->win32_handle, RecNumber, SqlState, NativeError,
|
|
+ if (handle->win32_funcs->SQLGetDiagRec)
|
|
+ {
|
|
+ ret = handle->win32_funcs->SQLGetDiagRec( HandleType, handle->win32_handle, RecNumber, SqlState, NativeError,
|
|
MessageText, BufferLength, TextLength );
|
|
+ }
|
|
+ else if (handle->win32_funcs->SQLError)
|
|
+ {
|
|
+ if (HandleType == SQL_HANDLE_ENV)
|
|
+ ret = handle->win32_funcs->SQLError(handle->win32_handle, SQL_NULL_HDBC, SQL_NULL_HSTMT,
|
|
+ SqlState, NativeError, MessageText, BufferLength, TextLength);
|
|
+ else if (HandleType == SQL_HANDLE_DBC)
|
|
+ ret = handle->win32_funcs->SQLError(SQL_NULL_HENV, handle->win32_handle, SQL_NULL_HSTMT,
|
|
+ SqlState, NativeError, MessageText, BufferLength, TextLength);
|
|
+ else if (HandleType == SQL_HANDLE_STMT)
|
|
+ ret = handle->win32_funcs->SQLError(SQL_NULL_HENV, SQL_NULL_HDBC, handle->win32_handle,
|
|
+ SqlState, NativeError, MessageText, BufferLength, TextLength);
|
|
+ }
|
|
}
|
|
|
|
TRACE("Returning %d\n", ret);
|
|
@@ -4012,8 +4027,24 @@ SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA
|
|
}
|
|
else if (handle->win32_handle)
|
|
{
|
|
- ret = handle->win32_funcs->SQLGetDiagRecW( HandleType, handle->win32_handle, RecNumber, SqlState, NativeError,
|
|
- MessageText, BufferLength, TextLength );
|
|
+ if (handle->win32_funcs->SQLGetDiagRecW)
|
|
+ {
|
|
+ ret = handle->win32_funcs->SQLGetDiagRecW( HandleType, handle->win32_handle, RecNumber, SqlState,
|
|
+ NativeError, MessageText, BufferLength, TextLength );
|
|
+ }
|
|
+ else if (handle->win32_funcs->SQLErrorW)
|
|
+ {
|
|
+ /* ODBC v2 */
|
|
+ if (HandleType == SQL_HANDLE_ENV)
|
|
+ ret = handle->win32_funcs->SQLErrorW(handle->win32_handle, SQL_NULL_HDBC, SQL_NULL_HSTMT,
|
|
+ SqlState, NativeError, MessageText, BufferLength, TextLength);
|
|
+ else if (HandleType == SQL_HANDLE_DBC)
|
|
+ ret = handle->win32_funcs->SQLErrorW(SQL_NULL_HENV, handle->win32_handle, SQL_NULL_HSTMT,
|
|
+ SqlState, NativeError, MessageText, BufferLength, TextLength);
|
|
+ else if (HandleType == SQL_HANDLE_STMT)
|
|
+ ret = handle->win32_funcs->SQLErrorW(SQL_NULL_HENV, SQL_NULL_HDBC, handle->win32_handle,
|
|
+ SqlState, NativeError, MessageText, BufferLength, TextLength);
|
|
+ }
|
|
}
|
|
|
|
TRACE("Returning %d\n", ret);
|
|
--
|
|
2.43.0
|
|
|