Bug #83315 vb6 - C API - Mysql Embedded Server - Assertion Failed
Submitted: 10 Oct 2016 5:34 Modified: 2 Mar 2017 11:23
Reporter: Vineet Gupta Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S1 (Critical)
Version:5.1.32/5.5.72 OS:Windows (XP)
Assigned to: CPU Architecture:Any
Tags: assertion, VB6

[10 Oct 2016 5:34] Vineet Gupta
Description:
According to the documentation while liking to libmysqld.dll after calling the function through vb6 first mysql_server_init and then calling mysql_init shows the Assertion Error. While Debug Library showing assertion error message but the release library dll crashes.

How to repeat:
VB6 Code

argv = {"test", "--datadir=" & Replace(App.Path, "\", "/") & "/sql/data", "--basedir=" & Replace(App.Path, "\", "/") & "/sql", "--no-defaults", "--skip-networking" }

groups   = {"embedded", "server", "test_SERVER"}

if mysql_server_init ( argc , argv , groups ) then
       mysql = mysql_init(0)   <==  Causing problem [ pic error message]
else
    MsgBox "Init not Done".
end if

Public Declare Function mysql_server_init Lib "libmysqld.dll" (ByVal Num As Long, abc As Any, def As Any) As Boolean

Public Declare Function mysql_init Lib "libmysqld.dll" (ByVal lMYSQL As Long) As Long
[17 Oct 2016 10:21] Bharathy Satish
Hello Vineet,

Modify this line groups   = {"embedded", "server", "test_SERVER"} to
groups   = {"embedded", "server", "test_SERVER", (char *)NULL}

From below link you can see that mysql_server_init() is deprecated, can you modify your application to use mysql_library_init()

http://dev.mysql.com/doc/refman/5.7/en/mysql-server-init.html
[17 Oct 2016 10:53] Vineet Gupta
Hi,

Thing Required attention:

1. If I view the library of version 5.1.32 and library of 5.5.52 through windows dependency walker there is no function mysql_library_init available in the dynamic dll library

2. Even though the mysql_server_init is deprecated and mysql_server_int is sucessful in calling. The error is not with the function mysql_server_int as such the error is with the mysql_init

3. I have uploading two images of error. 1st message is shown then I click on Ignore and then second message is shown and I click on Ignore and again second message is shown and I again click on Ignore and the application is crashed.

4. I have written the full code of vb6 and if you require to submit the copy of the project along with dll files. I am ready to submit them too. Just let me know.

Assertion error is with mysql_init not with mysql_server_init
[20 Oct 2016 12:51] Chiranjeevi Battula
Hello Vineet Gupta,

Thank you for your feedback.
Could you please provide repeatable test case (sample project, code, create table statements/database etc. - please make it as private if you prefer) to confirm this issue at our end?

Thanks,
Chiranjeevi.
[21 Oct 2016 9:03] Vineet Gupta
I have uploaded the file through sftp server with filename: mysql-bug-data-83315.zip which includes the library file i.e. libmysqld.dll along with code. The Project is Created in VB6 and while running it shows the error messages.
[2 Mar 2017 11:23] Chiranjeevi Battula
Hello Vineet Gupta,

Thank you for your feedback.
I could not repeat the issue at our end using with MySQL 5.7.17.
If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Thanks,
Chiranjeevi.