https://bugs.winehq.org/show_bug.cgi?id=46581
Bug ID: 46581 Summary: HeidiSQL generates OLE error when executing custom queries against MSSQL server. Product: Wine Version: 4.1 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: comsvcs Assignee: wine-bugs@winehq.org Reporter: wine@zootal.com Distribution: ---
HeidiSQL generates OLE error when executing custom queries against MSSQL server.
The program will run and open a connection to a MS SQL server. It will display data in the normal manner, table information, etc. It will allow updates to data in data grid.
However, if you try to run a custom query via the query tab, no matter you type in (valid query or not), it will generate an error:
OLE error 800401F0
It also gives the suggestion to install mdac28, and set mdac native_mdac, neither of which help. You have to have mdac install to get it to open a connection the server, so you would not get this far if mdac was not installed.
To duplicate: Create a clean wine prefix. Install mdac28, set native_mdac. I did this with winetricks:
sh winetricks mdac28 sh winetricks native_mdac
Run Heidisql. Connect to a Microsoft SQL Server. You should be able to connect, view data, etc. Click the Query tab. Enter a simple query, such as select * from <some table>. Execute the query. The error occurs immediately.
This line appears in console:
0054:err:ole:CoCreateInstanceEx apartment not initialised
This did not occur in wine versions from 3.0 through 3.14.
On a closely related topic, in wine 3.15 through 3.21, a similar error occurs when trying to open a connection to a MS SQL Server. This was apparently fixed with wine 4.0, in that now the error only occurs when trying to run a custom query as described above. Prior to wine 3.15, this worked just fine.
Slackware 14.2 64 bit. Tested in clean wine prefix, both 32 and 64 bit, with mdac28 and native_mdac via winetricks.
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #1 from Matthew Reed wine@zootal.com --- PS This occurs with HeidiSQL versions 9.5, 10.0, and the most current release of 10.1. I tested these older version to make sure it wasn't a recent change to HeidiSQL. I went back to version 9.5, and that older version does the same thing.
https://bugs.winehq.org/show_bug.cgi?id=46581
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|comsvcs |-unknown CC| |z.figura12@gmail.com
--- Comment #2 from Zebediah Figura z.figura12@gmail.com --- Thanks for the detailed bug report. Can you please attach a log with WINEDEBUG=+ole?
If you have the time and ability, performing a regression test between 3.14 and 3.15 would also be helpful.
https://bugs.winehq.org/show_bug.cgi?id=46581
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression
https://bugs.winehq.org/show_bug.cgi?id=46581
Matthew Reed wine@zootal.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |wine@zootal.com
--- Comment #3 from Matthew Reed wine@zootal.com --- Created attachment 63466 --> https://bugs.winehq.org/attachment.cgi?id=63466 Wine 4.1 trace with ole logging.
Note message at line 41735 and 41755. At this point, the error has already occurred.
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #4 from Matthew Reed wine@zootal.com --- Created attachment 63467 --> https://bugs.winehq.org/attachment.cgi?id=63467 Wine 3.14 trace with ole logging.
This is a trace made with wine 3.14. NO ERROR OCCURS. I performed the exact same sequence events to generate this as I did with the wine 4.1 log, except no error occurs. I'm including it in case anyone wants to see what the log looks like when it was working.
Steps to generate log. Run HeidiSQL. Open connection to MSSQL server. Run custom query in query tab. Close Heidi. I did the same thing to obtain both logs.
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #5 from Matthew Reed wine@zootal.com --- Created attachment 63468 --> https://bugs.winehq.org/attachment.cgi?id=63468 Error dump from Heidi
For those interested, this is the error dump that Heidi produces. Note the Recordset is not open message.
Delphi? Do people still use Delphi today? Huh...
https://bugs.winehq.org/show_bug.cgi?id=46581
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |leslie_alistair@hotmail.com Regression SHA1| |9b9b4c0dda66f4f950df489bb98 | |2b2ebbc4bbc31
--- Comment #6 from Zebediah Figura z.figura12@gmail.com --- Thanks. The logs show, in the "good" case, the application tries to create a dispenser manager, fails, and then initializes a thread whose only purpose seems to be to create an MTA. In the "bad" case, the dispenser manager is successfully created, and no such thread is created. The implication seems to be that the application expects the dispenser manager to create an MTA, but testing shows that's not what happens.
I'm not really sure at all where the bug is. Somewhere I guess an MTA has to be created, but it's not clear at all where. Maybe some method needs to be called on the dispenser manager first? Can you please add +comsvcs,+win, and see if that adds any clues?
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #7 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- (In reply to Zebediah Figura from comment #6)
Thanks. The logs show, in the "good" case, the application tries to create a dispenser manager, fails, and then initializes a thread whose only purpose seems to be to create an MTA. In the "bad" case, the dispenser manager is successfully created, and no such thread is created. The implication seems to be that the application expects the dispenser manager to create an MTA, but testing shows that's not what happens.
I'm not really sure at all where the bug is. Somewhere I guess an MTA has to be created, but it's not clear at all where. Maybe some method needs to be called on the dispenser manager first? Can you please add +comsvcs,+win, and see if that adds any clues?
Yes, a log of +comsvcs would be nice.
It would be good to know if GetDispenserManager (mtxdm.dll) is called, in this case the MTA might be automatic.
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #8 from Matthew Reed wine@zootal.com --- Created attachment 63476 --> https://bugs.winehq.org/attachment.cgi?id=63476 Wine 3.14 trace with +comsvc,+win
This is a run with wine 3.14 with WINEDEBUG=+comsvcs,+win.
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #9 from Matthew Reed wine@zootal.com --- Created attachment 63477 --> https://bugs.winehq.org/attachment.cgi?id=63477 This is a run with wine 4.1 with WINEDEBUG=+comsvcs,+win
Wine 4.1 trace with +comsvc,+win.
In both cases, I enabled logging right before running the query that crashes. This was because otherwise the log file would have been *huge* as +comsvcs,+win outputs a ton of stuff.
If you want a log of the entire run, not just from running the offending query, let me know and I'll log everything from program open to program close.
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #10 from Zebediah Figura z.figura12@gmail.com --- (In reply to Matthew Reed from comment #9)
Created attachment 63477 [details] This is a run with wine 4.1 with WINEDEBUG=+comsvcs,+win
Wine 4.1 trace with +comsvc,+win.
In both cases, I enabled logging right before running the query that crashes. This was because otherwise the log file would have been *huge* as +comsvcs,+win outputs a ton of stuff.
If you want a log of the entire run, not just from running the offending query, let me know and I'll log everything from program open to program close.
Yes, please, and make that +ole,+comsvcs,+win as well. If the log file is too big to upload, try compressing it first.
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #11 from Matthew Reed wine@zootal.com --- Created attachment 63479 --> https://bugs.winehq.org/attachment.cgi?id=63479 Wine 4.12 trace with +ole,+comsvcs,+win. This is the entire trace from program start to program terminate.
Here it is! The entire run from start to finish, with +ole,+comsvcs,+win. It wasn't as big as I thought it would be but I went ahead and compressed it. Let me know what else I can do to help.
https://bugs.winehq.org/show_bug.cgi?id=46581
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW
--- Comment #12 from Zebediah Figura z.figura12@gmail.com --- Aha, that does it. Calling RegisterDispenser() creates an MTA thread, which then apparently seems to hang around forever.
https://bugs.winehq.org/show_bug.cgi?id=46581
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |comsvcs
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #13 from Matthew Reed wine@zootal.com --- Is this something the developer of Heidi needs to address, or is it an internal Wine issue?
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #14 from Zebediah Figura z.figura12@gmail.com --- (In reply to Matthew Reed from comment #13)
Is this something the developer of Heidi needs to address, or is it an internal Wine issue?
Eh. The program is depending on undocumented behaviour, which is not great, so the best is probably for the application developer to fix it. But it is a bug in Wine, and can be fixed here, and I've submitted patches for it.
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #15 from Matthew Reed wine@zootal.com --- You submitted patches? That was fast :). Where do I find them? I'll run it in my test environment and see how it does.
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #16 from Zebediah Figura z.figura12@gmail.com --- (In reply to Matthew Reed from comment #15)
You submitted patches? That was fast :). Where do I find them? I'll run it in my test environment and see how it does.
Sure, https://source.winehq.org/patches/data/158001 and https://source.winehq.org/patches/data/158000.
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #17 from Matthew Reed wine@zootal.com --- TYVM! I'll test them asap - today if I can, if not then Monday morning.
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #18 from Zebediah Figura z.figura12@gmail.com --- This is committed now, https://source.winehq.org/git/wine.git/commit/ac1bb4536473eb705d5fa828406fa4eb473b9f41. Please retest with current git or when 4.2 is released.
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #19 from Matthew Reed wine@zootal.com --- I used wine 4.1 and patched the source, compiled. I didn't test extensively, but what I did try worked perfectly! I'll run it through it's paces today and let you know if I run into any problems, but so far it works great.
https://bugs.winehq.org/show_bug.cgi?id=46581
--- Comment #20 from Matthew Reed wine@zootal.com --- PS TYVM for the quick fix!
https://bugs.winehq.org/show_bug.cgi?id=46581
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |ac1bb4536473eb705d5fa828406 | |fa4eb473b9f41 Status|NEW |RESOLVED
--- Comment #21 from Zebediah Figura z.figura12@gmail.com --- Marking fixed then, thanks!
https://bugs.winehq.org/show_bug.cgi?id=46581
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #22 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 4.2.
https://bugs.winehq.org/show_bug.cgi?id=46581
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |4.0.x
https://bugs.winehq.org/show_bug.cgi?id=46581
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.0.x |---
--- Comment #23 from Michael Stefaniuc mstefani@winehq.org --- Removing the 4.0.x milestone from bug fixes included in 4.0.1.