Changed the test to use libmysqld

This commit is contained in:
Jan Lindström
2013-07-11 06:45:49 +03:00
parent ab294a18f0
commit 59b0eee999
3 changed files with 29 additions and 3 deletions

View File

@ -4,6 +4,25 @@
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <mysql.h>
static char* server_options[] = {
"jan test",
"--datadir=/tmp/",
"--skip-innodb",
"--default-storage-engine=myisam",
NULL
};
const int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
static char* server_groups[] = {
"embedded",
"server",
"server",
"server",
NULL
};
int main(int argc, char** argv)
{
@ -13,6 +32,13 @@ int main(int argc, char** argv)
replication_listener_t *mrl;
int err=0;
// This will initialize MySQL
if (mysql_server_init(num_elements, server_options, server_groups)) {
printf("MySQL server init failed\n");
exit(2);
}
mrl = (replication_listener_t*)calloc(argc, sizeof(replication_listener_t));
if (argc < 2) {