Fixed internal test failures
The tests failed due old style initialization of the embedded server. This is fixed by using the new qc_init and qc_thread_init functions.
This commit is contained in:
@ -7,26 +7,6 @@
|
|||||||
#include <buffer.h>
|
#include <buffer.h>
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
|
|
||||||
static char* server_options[] =
|
|
||||||
{
|
|
||||||
"MariaDB Corporation MaxScale",
|
|
||||||
"--datadir=./",
|
|
||||||
"--language=./",
|
|
||||||
"--skip-innodb",
|
|
||||||
"--default-storage-engine=myisam",
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
const int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
|
|
||||||
|
|
||||||
static char* server_groups[] =
|
|
||||||
{
|
|
||||||
"embedded",
|
|
||||||
"server",
|
|
||||||
"server",
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
unsigned int psize;
|
unsigned int psize;
|
||||||
@ -48,11 +28,8 @@ int main(int argc, char** argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mysql_library_init(num_elements, server_options, server_groups))
|
qc_init("qc_mysqlembedded");
|
||||||
{
|
qc_thread_init();
|
||||||
printf("Embedded server init failed.\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
infile = fopen(argv[1],"rb");
|
infile = fopen(argv[1],"rb");
|
||||||
outfile = fopen(argv[2],"wb");
|
outfile = fopen(argv[2],"wb");
|
||||||
@ -87,7 +64,7 @@ int main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
fclose(infile);
|
fclose(infile);
|
||||||
fclose(outfile);
|
fclose(outfile);
|
||||||
mysql_library_end();
|
qc_thread_end();
|
||||||
|
qc_end();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -8,25 +8,6 @@
|
|||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
static char* server_options[] = {
|
|
||||||
"MariaDB Corporation MaxScale",
|
|
||||||
"--no-defaults",
|
|
||||||
"--datadir=.",
|
|
||||||
"--language=.",
|
|
||||||
"--skip-innodb",
|
|
||||||
"--default-storage-engine=myisam",
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
const int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
|
|
||||||
|
|
||||||
static char* server_groups[] = {
|
|
||||||
"embedded",
|
|
||||||
"server",
|
|
||||||
"server",
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
if(argc < 3){
|
if(argc < 3){
|
||||||
@ -37,11 +18,8 @@ int main(int argc, char** argv)
|
|||||||
char buffer[1024], *strbuff = (char*)calloc(buffsz,sizeof(char));
|
char buffer[1024], *strbuff = (char*)calloc(buffsz,sizeof(char));
|
||||||
FILE *input,*expected;
|
FILE *input,*expected;
|
||||||
|
|
||||||
if(mysql_library_init(num_elements, server_options, server_groups))
|
qc_init("qc_mysqlembedded");
|
||||||
{
|
qc_thread_init();
|
||||||
printf("Error: Cannot initialize Embedded Library.");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
input = fopen(argv[1],"rb");
|
input = fopen(argv[1],"rb");
|
||||||
|
|
||||||
@ -189,7 +167,8 @@ int main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
fclose(input);
|
fclose(input);
|
||||||
fclose(expected);
|
fclose(expected);
|
||||||
mysql_library_end();
|
qc_thread_end();
|
||||||
|
qc_end();
|
||||||
free(strbuff);
|
free(strbuff);
|
||||||
return ex_val;
|
return ex_val;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user