Bug #107762 MySQL ODBC 8.0.29 ANSI Driver returns nvarchar instead of varchar in SQLColumns
Submitted: 5 Jul 2022 16:00 Modified: 5 Jul 2022 18:52
Reporter: Pierre le Riche Email Updates:
Status: Closed Impact on me:
Category:Connector / ODBC Severity:S1 (Critical)
Version:8.0.29 OS:Any (Windows)
Assigned to: CPU Architecture:Any

[5 Jul 2022 16:00] Pierre le Riche
In commit 0e98f67d2 ("Bug #33772516: ODBC function SQLGetTypeInfo does not return Wide character types") changes were made to the "SQL_GET_TYPE_INFO_values" lookup. This has had the unfortunate side-effect that certain calls, like SQLColumns, now report nvarchar for columns that reported varchar in 8.0.28 and older ANSI drivers.

How to repeat:
1) Connect to a database using the ANSI ODBC driver
2) Call SQLColumns and inspect the reported field type for a varchar field
Expected: varchar
Actual: nvarchar

Suggested fix:
Please restore the behaviour of 8.0.28 and before.
[5 Jul 2022 16:27] Pierre le Riche
I can confirm that it works correctly in 8.0.27, but it appears the bug is already present in 8.0.28, so it is probably not the commit I mentioned above that is at fault.
[5 Jul 2022 18:40] Pierre le Riche
I will resubmit the bug with a more accurate description.
[5 Jul 2022 18:52] Pierre le Riche
Resubmitted as #107766