Updated odbc32-fixes patchset

Thanks Steve Fawcett.
This commit is contained in:
Alistair Leslie-Hughes
2025-04-10 08:25:29 +10:00
parent 36020b4a0e
commit aa0c8391eb
2 changed files with 15 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
From 2d897946980e67f742b9f39f5f548cf0e2340510 Mon Sep 17 00:00:00 2001
From f16a96be2b219f8e7733a36dc147f5247b618870 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 17 Jul 2024 21:55:20 +1000
Subject: [PATCH] odbc32: SQLGetData support ODBC v2.0
@@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: SQLGetData support ODBC v2.0
1 file changed, 24 insertions(+)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index 3b3b198eaa8..c2748cd33d7 100644
index c16c9a6da69..18d3df1007f 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -2450,11 +2450,35 @@ static SQLRETURN get_data_unix( struct statement *stmt, SQLUSMALLINT column, SQL
@@ -2468,11 +2468,35 @@ static SQLRETURN get_data_unix( struct statement *stmt, SQLUSMALLINT column, SQL
return ret;
}
@@ -31,7 +31,7 @@ index 3b3b198eaa8..c2748cd33d7 100644
if (stmt->hdr.win32_funcs->SQLGetData)
+ {
+ struct environment *env = (struct environment *)find_object_type(SQL_HANDLE_ENV, stmt->hdr.parent);
+ if (env && env->attr_version == SQL_OV_ODBC2)
+ if (env && env->driver_ver == SQL_OV_ODBC2)
+ {
+ if (type == SQL_C_TYPE_TIME)
+ type = SQL_C_TIME;
@@ -48,5 +48,5 @@ index 3b3b198eaa8..c2748cd33d7 100644
}
--
2.45.2
2.47.2

View File

@@ -1,26 +1,27 @@
From 6b7448e5ebdc0b16f3af606a62e2ca465f3ae026 Mon Sep 17 00:00:00 2001
From 5874cf0a309a0ecfa97206b8b15734485920c325 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 17 Jul 2024 22:03:03 +1000
Subject: [PATCH] odbc32: SQLColAttributesW support ODBC v2.0
---
dlls/odbc32/proxyodbc.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
dlls/odbc32/proxyodbc.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index 71c853013fd..b5c0edb119e 100644
index 18d3df1007f..8d51ad37176 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -6195,6 +6195,8 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
@@ -6256,6 +6256,9 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
SQLPOINTER char_attr, SQLSMALLINT buflen, SQLSMALLINT *retlen,
SQLLEN *num_attr )
{
+ struct environment *env;
+ SQLRETURN ret = SQL_ERROR;
+
if (stmt->hdr.win32_funcs->SQLColAttributeW)
return stmt->hdr.win32_funcs->SQLColAttributeW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen,
retlen, num_attr );
@@ -6237,11 +6239,23 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
@@ -6315,11 +6318,23 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
return SQL_ERROR;
}
@@ -28,9 +29,9 @@ index 71c853013fd..b5c0edb119e 100644
+ ret = stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen,
retlen, num_attr );
+ /* Convert back for ODBC2 drivers */
+ env = (struct environment *)find_object_type(SQL_HANDLE_ENV, stmt->hdr.parent);
+ if (SQL_SUCCEEDED(ret) && num_attr && field_id == SQL_COLUMN_TYPE &&
+ ((struct environment*)(stmt->hdr.parent))->attr_version == SQL_OV_ODBC2 &&
+ ((struct environment*)(stmt->hdr.parent))->driver_ver == SQL_OV_ODBC2)
+ env && env->attr_version == SQL_OV_ODBC3 && env->driver_ver == SQL_OV_ODBC2)
+ {
+ if (*num_attr == SQL_TIME)
+ *num_attr = SQL_TYPE_TIME;
@@ -47,5 +48,5 @@ index 71c853013fd..b5c0edb119e 100644
/*************************************************************************
--
2.43.0
2.47.2