2024-06-23 00:08:28 -07:00
|
|
|
From 7db07cc12c6e62ab86b429d0c0b0f88426ddb681 Mon Sep 17 00:00:00 2001
|
2023-02-16 15:44:46 -08:00
|
|
|
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
|
|
|
Date: Mon, 6 Feb 2023 08:55:12 +1100
|
2024-06-07 21:32:02 -07:00
|
|
|
Subject: [PATCH] odbc32: Foward SQLSetConnectAttr requets onto the driver
|
2023-02-16 15:44:46 -08:00
|
|
|
|
|
|
|
---
|
2024-06-07 21:32:02 -07:00
|
|
|
dlls/odbc32/proxyodbc.c | 49 ++++++++++++++++++++++++++++++++++++-----
|
|
|
|
1 file changed, 44 insertions(+), 5 deletions(-)
|
2023-02-16 15:44:46 -08:00
|
|
|
|
|
|
|
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
2024-06-23 00:08:28 -07:00
|
|
|
index 50083a23e25..f817b3b524c 100644
|
2023-02-16 15:44:46 -08:00
|
|
|
--- a/dlls/odbc32/proxyodbc.c
|
|
|
|
+++ b/dlls/odbc32/proxyodbc.c
|
2024-06-23 00:08:28 -07:00
|
|
|
@@ -1043,11 +1043,40 @@ SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount)
|
2024-06-07 21:32:02 -07:00
|
|
|
SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER StringLength)
|
|
|
|
{
|
|
|
|
- SQLRETURN ret = SQL_ERROR;
|
|
|
|
+ struct SQLHDBC_data *hdbc = ConnectionHandle;
|
|
|
|
+ SQLRETURN ret = SQL_SUCCESS;
|
|
|
|
|
|
|
|
- FIXME("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value,
|
|
|
|
+ TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value,
|
|
|
|
StringLength);
|
|
|
|
|
|
|
|
+ if (hdbc->type != SQL_HANDLE_DBC)
|
|
|
|
+ {
|
|
|
|
+ WARN("Wrong handle type %d\n", hdbc->type);
|
|
|
|
+ return SQL_ERROR;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ switch(Attribute)
|
|
|
|
+ {
|
|
|
|
+ case SQL_ATTR_LOGIN_TIMEOUT:
|
|
|
|
+ if (Value)
|
|
|
|
+ hdbc->login_timeout = (intptr_t)Value;
|
|
|
|
+ else
|
|
|
|
+ hdbc->login_timeout = 0;
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ if (hdbc->pSQLSetConnectAttr)
|
|
|
|
+ ret = hdbc->pSQLSetConnectAttr(hdbc->driver_hdbc, Attribute, Value, StringLength);
|
|
|
|
+ else if(hdbc->pSQLSetConnectOption)
|
|
|
|
+ ret = hdbc->pSQLSetConnectOption(hdbc->driver_hdbc, Attribute, (SQLULEN)Value);
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ FIXME("Unsupported Attribute %d\n", Attribute);
|
|
|
|
+ ret = SQL_ERROR;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ TRACE("ret %d\n", ret);
|
|
|
|
+
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2024-06-23 00:08:28 -07:00
|
|
|
@@ -1803,6 +1832,7 @@ SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu
|
2023-02-16 15:44:46 -08:00
|
|
|
SQLINTEGER StringLength)
|
|
|
|
{
|
|
|
|
struct SQLHDBC_data *hdbc = ConnectionHandle;
|
|
|
|
+ SQLRETURN ret = SQL_SUCCESS;
|
|
|
|
|
|
|
|
TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value,
|
|
|
|
StringLength);
|
2024-06-23 00:08:28 -07:00
|
|
|
@@ -1822,11 +1852,20 @@ SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu
|
2023-02-16 15:44:46 -08:00
|
|
|
hdbc->login_timeout = 0;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
- FIXME("Unhandle attribute %d\n", Attribute);
|
|
|
|
- return SQL_ERROR;
|
|
|
|
+ if (hdbc->pSQLSetConnectAttrW)
|
|
|
|
+ ret = hdbc->pSQLSetConnectAttrW(hdbc->driver_hdbc, Attribute, Value, StringLength);
|
2024-06-07 21:32:02 -07:00
|
|
|
+ else if(hdbc->pSQLSetConnectOptionW)
|
|
|
|
+ ret = hdbc->pSQLSetConnectOptionW(hdbc->driver_hdbc, Attribute, (SQLULEN)Value);
|
2023-02-16 15:44:46 -08:00
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ FIXME("Unsupported Attribute %d\n", Attribute);
|
|
|
|
+ ret = SQL_ERROR;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
- return SQL_SUCCESS;
|
|
|
|
+ TRACE("ret %d\n", ret);
|
|
|
|
+
|
|
|
|
+ return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
--
|
2024-06-07 21:32:02 -07:00
|
|
|
2.43.0
|
2023-02-16 15:44:46 -08:00
|
|
|
|