I'm trying to access an embedded innodb database using libmysqld from MySQL 5.1 but my program crashes on the query command. Everything works fine when I'm using MYISAM tables and I'm not really doing anything besides initializing and querying. I'm hoping you guys can shed some light on this problem. I've been searching all over the internet for a solution but it seems hardly anyone is using embedded databases.

The code is short and nothing out of the ordinary:

Thanks a lot for your time.