[Bug 58140] New: ODBC using unixodbc stopped working due to regression merge between 9.0 and 10.0
http://bugs.winehq.org/show_bug.cgi?id=58140 Bug ID: 58140 Summary: ODBC using unixodbc stopped working due to regression merge between 9.0 and 10.0 Product: Wine Version: 10.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: blocker Priority: P2 Component: odbc Assignee: wine-bugs(a)winehq.org Reporter: heiko.rabe+winehq(a)peopleware.com Distribution: --- The following fix prevent proper usage of ODBC interface based on unixodbc provided DSN's: https://gitlab.winehq.org/wine/wine/-/commit/85047505f342b6767b9f48cbcdae2b4... I'm using an odbc.ini as follows located at `/etc/odbc.ini` ``` [test] Driver=PostgreSQL Unicode Description=PostgreSQL Data Source Servername=xyz.internal.com Port=5432 UserName=xyz Password=xyz_password Database=test SSLMode=prefer Debug=0 CommLog=0 ``` This leads to following wine registry entries in `system.reg` file: ``` [Software\\ODBC\\ODBC.INI\\test] 1744806811 #time=1dbaecbc3836bb4 "Driver"="PostgreSQL Unicode" [Software\\ODBC\\ODBCINST.INI\\ODBC Drivers] 1744806811 #time=1dbaecbc3834d1e "PostgreSQL ANSI"="Installed" "PostgreSQL Unicode"="Installed" ``` Testing it with `isql` tool on linux the connect is successful and i can select data from database: ``` isql test +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> ``` The Windows application using a driverconnect with connect string "DSN=test". Unfortunately the fix linked above searches the driver key now on a complete different registry key and tries only to open it from there. Versions previous to 10.0 are using the registry keys shown above and are working, version 10.0 now tries only: ``` [Software\\ODBC\\ODBC.INI\\ODBC Data Sources] 1744806811 #time=1dbaecbc3836bb4 ``` which is not present, will be created by requesting the driver and fails, cause the driver key can only be found on the above shown reg key, that 9.0 correctly supports. This stops working with ODBC based on unixodbc in version 10.0 and higher now. To me it's not clears, what problem the fix linked above should address. My guess would be, that one of following relates to the problem: - ODBC supports user and system DNS (system DNS seems now not longer be valid) - Wine runtime doesn't create the correct registry entries on 'wineboot' (leads to failing fix) - overlooked to support unixodbc at all and only tested with Microsoft ODBC drivers only. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 Heiko Rabe <heiko.rabe+winehq(a)peopleware.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |85047505f342b6767b9f48cbcda | |e2b45ecc6823b -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 Heiko Rabe <heiko.rabe+winehq(a)peopleware.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |heiko.rabe+winehq(a)peoplewar | |e.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #1 from Hans Leidekker <hans(a)meelstraat.net> --- What does your /etc/odbcinst.ini look like? That's where the ODBCINST.INI key is created from and it should list installed drivers with their files. Mine has these entries: [PostgreSQL ANSI] Description=PostgreSQL ODBC driver (ANSI version) Driver=psqlodbca.so Setup=libodbcpsqlS.so Debug=0 CommLog=1 UsageCount=1 [PostgreSQL Unicode] Description=PostgreSQL ODBC driver (Unicode version) Driver=psqlodbcw.so Setup=libodbcpsqlS.so Debug=0 CommLog=1 UsageCount=1 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #2 from Heiko Rabe <heiko.rabe+winehq(a)peopleware.com> --- The odbcinst.ini looks like: [PostgreSQL_ANSI] Description=PostgreSQL ODBC driver (ANSI version) Driver=psqlodbca.so Setup=libodbcpsqlS.so Debug=0 CommLog=1 UsageCount=1 [PostgreSQL_Unicode] Description=PostgreSQL ODBC driver (Unicode version) Driver=psqlodbcw.so Setup=libodbcpsqlS.so Debug=0 CommLog=1 UsageCount=1 and odbcinst -j shows: unixODBC 2.3.9 DRIVERS............: /etc/odbcinst.ini SYSTEM DATA SOURCES: /etc/odbc.ini FILE DATA SOURCES..: /etc/ODBCDataSources USER DATA SOURCES..: /home/ubuntu/.odbc.ini SQLULEN Size.......: 8 SQLLEN Size........: 8 SQLSETPOSIROW Size.: 8 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #3 from Heiko Rabe <heiko.rabe+winehq(a)peopleware.com> --- Sorry, the underscore in driver section name are only a test try due to assuming it was related to whitespace, intially it looks like: [PostgreSQL ANSI] Description=PostgreSQL ODBC driver (ANSI version) Driver=psqlodbca.so Setup=libodbcpsqlS.so Debug=0 CommLog=1 UsageCount=1 [PostgreSQL Unicode] Description=PostgreSQL ODBC driver (Unicode version) Driver=psqlodbcw.so Setup=libodbcpsqlS.so Debug=0 CommLog=1 UsageCount=1 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #4 from Hans Leidekker <hans(a)meelstraat.net> --- (In reply to Heiko Rabe from comment #3)
Sorry, the underscore in driver section name are only a test try due to assuming it was related to whitespace, intially it looks like:
[PostgreSQL ANSI] Description=PostgreSQL ODBC driver (ANSI version) Driver=psqlodbca.so Setup=libodbcpsqlS.so Debug=0 CommLog=1 UsageCount=1
[PostgreSQL Unicode] Description=PostgreSQL ODBC driver (Unicode version) Driver=psqlodbcw.so Setup=libodbcpsqlS.so Debug=0 CommLog=1 UsageCount=1
Looks good. Can you run these commands? $ wine reg export HKEY_LOCAL_MACHINE\\Software\\ODBC\\ODBCINST.INI odbcinst.reg $ iconv -futf16 odbcinst.reg Output should be something like this: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI] [HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\ODBC Drivers] "PostgreSQL ANSI"="Installed" "PostgreSQL Unicode"="Installed" [HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PostgreSQL ANSI] "Driver"="psqlodbca.so" [HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PostgreSQL Unicode] "Driver"="psqlodbcw.so" -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #5 from Heiko Rabe <heiko.rabe+winehq(a)peopleware.com> --- Currently I've installed winehq 9 version. There are no system.reg entries and the commands fails to export. Will need some time to revert to winehq 10 version, will be able to test it tomorrow and will return the results. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #6 from Heiko Rabe <heiko.rabe+winehq(a)peopleware.com> --- I did uninstall v9.0, installed again v10.0 and unsuccessful tried to start the executable. Still DB connect fails. I had to modify the export to 64bit otherwise no result or bad key error: $ wine reg export HKEY_LOCAL_MACHINE\\Software\\ODBC\\ odbcinst.reg /reg:64 and got following results: ??Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\ODBC] [HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI] [HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\test] "Driver"="PostgreSQL Unicode" [HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\ODBC Data Sources] [HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI] [HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\ODBC Drivers] "PostgreSQL ANSI"="Installed" "PostgreSQL Unicode"="Installed" [HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PostgreSQL ANSI] "Driver"="psqlodbca.so" [HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PostgreSQL Unicode] "Driver"="psqlodbcw.so" -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #7 from Hans Leidekker <hans(a)meelstraat.net> --- (In reply to Heiko Rabe from comment #6)
I did uninstall v9.0, installed again v10.0 and unsuccessful tried to start the executable. Still DB connect fails.
I had to modify the export to 64bit otherwise no result or bad key error:
Those settings look good but if your app is 32-bit (and you're not running a new-style wow64 build) then that might be your problem. Try installing 32-bit PostgreSQL ODBC drivers. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #8 from Heiko Rabe <heiko.rabe+winehq(a)peopleware.com> --- The app is 64bit an uses 64bit driver and 64bit ODBC. It works in Wine 9.0 but not at Wine 10.0. configured as: export WINEPREFIX=/home/ubuntu/.wine export WINEARCH=win64 export WINEDEBUG=-all -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #9 from Heiko Rabe <heiko.rabe+winehq(a)peopleware.com> --- - static const WCHAR sourcesW[] = L"Software\\ODBC\\ODBC.INI"; + static const WCHAR sourcesW[] = L"Software\\ODBC\\ODBC.INI\\ODBC Data Sources"; In my opinion the problem arised from lookup for the driver at the wrong key. [HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\test] "Driver"="PostgreSQL Unicode" [HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\ODBC Data Sources] The DSN is test and the driver can only be found at ODBC.INI\test and not at ODBC.INI\ODBC Data Sources\test This is what I read from the code changes made. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #10 from Hans Leidekker <hans(a)meelstraat.net> --- (In reply to Heiko Rabe from comment #9)
- static const WCHAR sourcesW[] = L"Software\\ODBC\\ODBC.INI"; + static const WCHAR sourcesW[] = L"Software\\ODBC\\ODBC.INI\\ODBC Data Sources";
In my opinion the problem arised from lookup for the driver at the wrong key.
[HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\test] "Driver"="PostgreSQL Unicode"
[HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\ODBC Data Sources]
The DSN is test and the driver can only be found at ODBC.INI\test and not at ODBC.INI\ODBC Data Sources\test
This is what I read from the code changes made.
There should be a 'test' value under both keys. They should be created automatically from the values in /etc/odbc.ini (or ~/.odbc.ini). Can you remove the ODBC key and attach a WINEDEBUG=+odbc,+reg trace from running your app? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #11 from Hans Leidekker <hans(a)meelstraat.net> --- Sorry, one is a string value and the other is a key. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #12 from Heiko Rabe <heiko.rabe+winehq(a)peopleware.com> --- Created attachment 78433 --> http://bugs.winehq.org/attachment.cgi?id=78433 trace log with WINEDEBUG=+odbc,+reg Attached the trace log with the requested WINEDEBUG=+odbc,+reg config. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #13 from Hans Leidekker <hans(a)meelstraat.net> --- (In reply to Heiko Rabe from comment #12)
Created attachment 78433 [details] trace log with WINEDEBUG=+odbc,+reg
Attached the trace log with the requested WINEDEBUG=+odbc,+reg config.
I see driver names PostgreSQL_ANSI PostgreSQL_Unicode (with underscore). They must match the name in the data source but the one you posted earlier didn't have an underscore. Can you make sure they match and try again? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #14 from Heiko Rabe <heiko.rabe+winehq(a)peopleware.com> --- my current /etc/odbc.ini [test] Driver=PostgreSQL_Unicode Description=PostgreSQL Data Source Servername=*** Port=5432 UserName=s*** Password=*** Database=*** SSLMode=prefer Debug=0 CommLog=0 my current /etc/odbcinst.ini [PostgreSQL_ANSI] Description=PostgreSQL ODBC driver (ANSI version) Driver=psqlodbca.so Setup=libodbcpsqlS.so Debug=0 CommLog=1 UsageCount=1 [PostgreSQL_Unicode] Description=PostgreSQL ODBC driver (Unicode version) Driver=psqlodbcw.so Setup=libodbcpsqlS.so Debug=0 CommLog=1 UsageCount=1 So the trace is correct. If I run: $ sudo apt purge wine winehq-stable -y $ sudo apt install --install-recommends winehq-stable=9.0.0.0~jammy-1 wine-stable=9.0.0.0~jammy-1 wine-stable-amd64=9.0.0.0~jammy-1 wine-stable-i386:i386=9.0.0.0~jammy-1 and afterwards start my application it works without any changes on ODBC setting. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression CC| |hans(a)meelstraat.net Severity|blocker |major -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #15 from Hans Leidekker <hans(a)meelstraat.net> --- (In reply to Heiko Rabe from comment #14)
So the trace is correct.
Thanks for verifying that, I see what's wrong now. Using the ODBC Data Sources key is correct, it's also populated on Windows when you configure a data source, but our logic for replicating data sources to the registry is wrong. I'll submit a fix. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 --- Comment #16 from Hans Leidekker <hans(a)meelstraat.net> --- Patch committed as 1c73bc4c7725d80b9f478fcdf984f0d4c7bdcee6. Please test when you get a chance. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 Gijs Vermeulen <gijsvrm(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |1c73bc4c7725d80b9f478fcdf98 | |4f0d4c7bdcee6 Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED --- Comment #17 from Gijs Vermeulen <gijsvrm(a)gmail.com> --- (In reply to Hans Leidekker from comment #16) Assuming fixed by 1c73bc4c7725d80b9f478fcdf984f0d4c7bdcee6. Please reopen if you can still reproduce. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58140 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #18 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 10.19. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla