[PATCH 0/2] MR6098: odbc32 fixes transact
Wine doesn't handle Pooling as yet and in my scenario it's set to 0 (No Pooling), so not an issue but requires a successful return value. SQLTransact incorrectly assumed that if either handle was NULL an error occurred. I'm seeing a call where the Environment handle is NULL, even unixODBC handles this scenario. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6098
From: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- dlls/odbc32/proxyodbc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 46f96651b1d..e0262f0fa89 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -2386,6 +2386,10 @@ SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, handle->env_attr_version = (UINT32)(ULONG_PTR)Value; break; + case SQL_ATTR_CONNECTION_POOLING: + FIXME("Ignore Pooling value\n"); + break; + default: FIXME( "unhandled attribute %d\n", Attribute ); ret = SQL_ERROR; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6098
From: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- dlls/odbc32/proxyodbc.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index e0262f0fa89..e55549891fb 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -2664,16 +2664,23 @@ SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle TRACE("(EnvironmentHandle %p, ConnectionHandle %p, CompletionType %d)\n", EnvironmentHandle, ConnectionHandle, CompletionType); - if (!env || !con) return SQL_INVALID_HANDLE; + if (!env && !con) return SQL_INVALID_HANDLE; - if (env->unix_handle) + if ( (env && env->unix_handle) || (con && con->unix_handle)) { - struct SQLTransact_params params = { env->unix_handle, con->unix_handle, CompletionType }; + struct SQLTransact_params params = { env ? env->unix_handle : 0, + con ? con->unix_handle : 0, CompletionType }; ret = ODBC_CALL( SQLTransact, ¶ms ); } - else if (env->win32_handle) + else if ( (env && env->win32_handle) || (con && con->win32_handle)) { - ret = env->win32_funcs->SQLTransact( env->win32_handle, con->win32_handle, CompletionType ); + const struct win32_funcs *win32_funcs; + + if (env) win32_funcs = env->win32_funcs; + else win32_funcs = con->win32_funcs; + + ret = win32_funcs->SQLTransact( env ? env->win32_handle : NULL, + con ? con->win32_handle : NULL, CompletionType ); } TRACE("Returning %d\n", ret); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6098
This merge request was approved by Hans Leidekker. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6098
participants (3)
-
Alistair Leslie-Hughes -
Alistair Leslie-Hughes (@alesliehughes) -
Hans Leidekker (@hans)