diff --git a/patches/odbc32-fixes/0016-odbc32-Always-pass-through-the-field-id-to-SQLColAtt.patch b/patches/odbc32-fixes/0016-odbc32-Always-pass-through-the-field-id-to-SQLColAtt.patch deleted file mode 100644 index 43b3c9e1..00000000 --- a/patches/odbc32-fixes/0016-odbc32-Always-pass-through-the-field-id-to-SQLColAtt.patch +++ /dev/null @@ -1,47 +0,0 @@ -From c32d12a345ce533dd7e785c439cede340cfef17e Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Tue, 27 Aug 2024 07:25:34 +1000 -Subject: [PATCH] odbc32: Always pass through the field id to - SQLColAttributes/W - ---- - dlls/odbc32/proxyodbc.c | 14 ++------------ - 1 file changed, 2 insertions(+), 12 deletions(-) - -diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index f6a5ea01e22..82859650993 100644 ---- a/dlls/odbc32/proxyodbc.c -+++ b/dlls/odbc32/proxyodbc.c -@@ -1004,13 +1004,8 @@ static SQLRETURN col_attribute_win32_a( struct statement *stmt, SQLUSMALLINT col - field_id = SQL_DESC_NULLABLE; - break; - -- case SQL_COLUMN_TYPE: -- case SQL_COLUMN_DISPLAY_SIZE: -- break; -- - default: -- FIXME( "field id %u not handled\n", field_id ); -- return SQL_ERROR; -+ /* Pass through field id. */ - } - - return stmt->hdr.win32_funcs->SQLColAttributes( stmt->hdr.win32_handle, col, field_id, char_attr, buflen, -@@ -6230,13 +6225,8 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col - field_id = SQL_DESC_NULLABLE; - break; - -- case SQL_COLUMN_TYPE: -- case SQL_COLUMN_DISPLAY_SIZE: -- break; -- - default: -- FIXME( "field id %u not handled\n", field_id ); -- return SQL_ERROR; -+ /* Pass through field id. */ - } - - ret = stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen, --- -2.45.2 - diff --git a/patches/odbc32-fixes/0016-odbc32-SQLColAttribute-W-pass-through-field-id-SQL_M.patch b/patches/odbc32-fixes/0016-odbc32-SQLColAttribute-W-pass-through-field-id-SQL_M.patch new file mode 100644 index 00000000..d3ac4fc2 --- /dev/null +++ b/patches/odbc32-fixes/0016-odbc32-SQLColAttribute-W-pass-through-field-id-SQL_M.patch @@ -0,0 +1,33 @@ +From b2a461e789d8602012328811451a39ebd4bb849d Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 28 Aug 2024 05:10:00 +1000 +Subject: [PATCH] odbc32: SQLColAttribute/W pass through field id + SQL_MAX_COLUMNS_IN_TABLE + +--- + dlls/odbc32/proxyodbc.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 49e16b1df08..26f38d63b63 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1003,6 +1003,7 @@ static SQLRETURN col_attribute_win32_a( struct statement *stmt, SQLUSMALLINT col + + case SQL_COLUMN_TYPE: + case SQL_COLUMN_DISPLAY_SIZE: ++ case SQL_MAX_COLUMNS_IN_TABLE: + break; + + default: +@@ -6188,6 +6189,7 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col + + case SQL_COLUMN_TYPE: + case SQL_COLUMN_DISPLAY_SIZE: ++ case SQL_MAX_COLUMNS_IN_TABLE: + break; + + default: +-- +2.45.2 + diff --git a/patches/odbc32-fixes/0017-odbc32-SQLColAttribute-W-Correcly-convert-columns-ID.patch b/patches/odbc32-fixes/0017-odbc32-SQLColAttribute-W-Correcly-convert-columns-ID.patch new file mode 100644 index 00000000..f483144f --- /dev/null +++ b/patches/odbc32-fixes/0017-odbc32-SQLColAttribute-W-Correcly-convert-columns-ID.patch @@ -0,0 +1,96 @@ +From a3e36e081e53a3e6b7275c27bc1e92ad555ad1b9 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 28 Aug 2024 05:25:23 +1000 +Subject: [PATCH] odbc32: SQLColAttribute/W Correcly convert columns ID for + ODBC v2.0 + +The current conversion is converting ODBC 2 to 3 which is backwards. +--- + dlls/odbc32/proxyodbc.c | 56 ++++++++++++++++++++++++++++++++--------- + 1 file changed, 44 insertions(+), 12 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 26f38d63b63..b0a7bf498e6 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -989,16 +989,32 @@ static SQLRETURN col_attribute_win32_a( struct statement *stmt, SQLUSMALLINT col + + switch (field_id) + { +- case SQL_COLUMN_COUNT: +- field_id = SQL_DESC_COUNT; ++ case SQL_DESC_COUNT: ++ field_id = SQL_COLUMN_COUNT; + break; + +- case SQL_COLUMN_NAME: +- field_id = SQL_DESC_NAME; ++ case SQL_DESC_TYPE: ++ field_id = SQL_COLUMN_TYPE; + break; + +- case SQL_COLUMN_NULLABLE: +- field_id = SQL_DESC_NULLABLE; ++ case SQL_DESC_LENGTH: ++ field_id = SQL_COLUMN_LENGTH; ++ break; ++ ++ case SQL_DESC_PRECISION: ++ field_id = SQL_COLUMN_PRECISION; ++ break; ++ ++ case SQL_DESC_SCALE: ++ field_id = SQL_COLUMN_SCALE; ++ break; ++ ++ case SQL_DESC_NULLABLE: ++ field_id = SQL_COLUMN_NULLABLE; ++ break; ++ ++ case SQL_DESC_NAME: ++ field_id = SQL_COLUMN_NAME; + break; + + case SQL_COLUMN_TYPE: +@@ -6175,16 +6191,32 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col + + switch (field_id) + { +- case SQL_COLUMN_COUNT: +- field_id = SQL_DESC_COUNT; ++ case SQL_DESC_COUNT: ++ field_id = SQL_COLUMN_COUNT; + break; + +- case SQL_COLUMN_NAME: +- field_id = SQL_DESC_NAME; ++ case SQL_DESC_TYPE: ++ field_id = SQL_COLUMN_TYPE; + break; + +- case SQL_COLUMN_NULLABLE: +- field_id = SQL_DESC_NULLABLE; ++ case SQL_DESC_LENGTH: ++ field_id = SQL_COLUMN_LENGTH; ++ break; ++ ++ case SQL_DESC_PRECISION: ++ field_id = SQL_COLUMN_PRECISION; ++ break; ++ ++ case SQL_DESC_SCALE: ++ field_id = SQL_COLUMN_SCALE; ++ break; ++ ++ case SQL_DESC_NULLABLE: ++ field_id = SQL_COLUMN_NULLABLE; ++ break; ++ ++ case SQL_DESC_NAME: ++ field_id = SQL_COLUMN_NAME; + break; + + case SQL_COLUMN_TYPE: +-- +2.45.2 + diff --git a/patches/odbc32-fixes/0018-odbc32-SQLColAttributes-W-fall-throught-for-unknown-.patch b/patches/odbc32-fixes/0018-odbc32-SQLColAttributes-W-fall-throught-for-unknown-.patch new file mode 100644 index 00000000..e4f7885a --- /dev/null +++ b/patches/odbc32-fixes/0018-odbc32-SQLColAttributes-W-fall-throught-for-unknown-.patch @@ -0,0 +1,33 @@ +From 2e310f42d27c6b26631124bc3622a7fc6c80167e Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 28 Aug 2024 07:57:17 +1000 +Subject: [PATCH] odbc32: SQLColAttributes/W fall throught for unknown field + ids + +--- + dlls/odbc32/proxyodbc.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index c2dcf76de07..4daa19140a3 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1027,7 +1027,6 @@ static SQLRETURN col_attribute_win32_a( struct statement *stmt, SQLUSMALLINT col + + default: + FIXME( "field id %u not handled\n", field_id ); +- return SQL_ERROR; + } + + return stmt->hdr.win32_funcs->SQLColAttributes( stmt->hdr.win32_handle, col, field_id, char_attr, buflen, +@@ -6270,7 +6269,6 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col + + default: + FIXME( "field id %u not handled\n", field_id ); +- return SQL_ERROR; + } + + ret = stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen, +-- +2.45.2 +