Bug #595 GPF when calling mySQL_server_init() from VB
Submitted: 5 Jun 2003 8:00 Modified: 3 Jul 2003 6:58
Reporter: [ name withheld ] Email Updates:
Status: Won't fix Impact on me:
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S3 (Non-critical)
Version:4.0.13 OS:Windows (Win2K)
Assigned to: Alexey Botchkov CPU Architecture:Any

[5 Jun 2003 8:00] [ name withheld ]

Technically, this is not a bug, but posting to the Win32 mailing list and searching on the web didn't return useful information.

The issue is simple : I need to use the embedded MySQL from VB (5 or 6). Here's the DECLARE and actual call:

'int mysql_server_init(int argc, char **argv, char **groups)
Declare Function mySQL_server_init Lib "libmysqld.dll" Alias "mysql_server_init" (ByVal d1 As Long, ByVal d2 As Double, ByVal d3 As Double) As Long

Call mySQL_server_init(0, vbNull, vbNull)

This generates a GPF. FYI, I can successfully make this call from an EXE written in PowerBasic, so I compiled the call as a PowerBasic DLL, which I call from VB : GPF again.

I wonder if libmysqld.dll is not compiled in a way that is incompatible with VisualBasic. Any idea?

Thx much for any tip

How to repeat:
Just copy paste the above code in either VB5 or 6, and watch the GPF.

Suggested fix:
Er... I'm in the dark as to why MySQL crashes...
[6 Jun 2003 12:46] MySQL Verification Team
Sorry currently the embedded server library only permits the static
load and presents the behavior reported when is loaded dynamically.
The fix there is in the TODO list, however without an estimated
time for.
[6 Jun 2003 16:26] [ name withheld ]
Thx Miguel for the confirmation :-) What is a static load? At compile-time? Is there a work-around?
[3 Jul 2003 6:58] Alexey Botchkov
Problem is that some structures are different for client and embedded
We plan to fix the structures to be similar in 4.1,x, but until that one must link mysql-embedded statically.
Sorry, but it's too big change to do it in 4.0.
[8 Nov 2005 17:37] Michael Piastro
Has this limitation been eliminated with version 4.1 / 5.0?