MySQL Embedded server on Windows hang in mysql_init with INFINITE WaitForSingleObject
Posted by: Ismael Briones Vilar
Date: April 08, 2013 03:16PM

Hi.

I'm trying build a program with MinGW (4.7), using libmysqld, but it enter in a loop in mysql_init and never get out of this function. I debuged it and this is the call stack:

myslq_init
mysql_server_init
init_embedded_server
init_server_components
plugin_init
plugin_initialize
int (** plugin_type_initialize)(st_plugin_int *)
innobase_start_or_create_for_mysql
recv_recovery_from_checkpoint_start_func
recv_synchronize_groups
rw_lock_s_lock_spin
sync_array_wait_event
os_event_wait_low
WaitForSingleObject - with a wait time of INFINITE

What is the problem?

This is the program:

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <mysql.h>

MYSQL *mysql;
MYSQL_RES *results;
MYSQL_ROW record;

static char *server_options[] = {"mysql_test",
"--defaults-file=c:\\mysql_embedded\\my.ini",
NULL };
int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
static char *server_groups[] = {"embedded", "server", NULL };

int main(void)
{
mysql_library_init(num_elements, server_options, (char **)server_groups);

mysql = mysql_init(mysql);

mysql_library_end();

return 0;
}

This is my.ini:

[embedded]
basedir=C:/mysql_embedded
datadir=C:/mysql_embedded/data
language=C:/mysql_embedded/share/english

[server]
basedir=C:/mysql_embedded
datadir=C:/mysql_embedded/data
language=C:/mysql_embedded/share/english

I compile with:

g++ -o test test.cpp -Id:\MySQLServer5.6.10\include -Ld:\MySQLServer5.6.10\lib -l libmysqld -D__LCC__

I have tried with different version of libmysqld: MySQL 5.1.68, 5.5.30, 5.6.10 but all hangs in myslq_init.

I'm running it in VMware.

What's the problem?

Options: ReplyQuote


Subject
Written By
Posted
MySQL Embedded server on Windows hang in mysql_init with INFINITE WaitForSingleObject
April 08, 2013 03:16PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.