Allow query classifier to initialize itself

The process and thread initialization/finalization of the query
classifier plugins is handled using the process and thread
initialization/finalization functions in the module object.

However, the top-level query classifier will also need to perform
process and thread initialization when transaction boundaries are
detected using regular expressions.
This commit is contained in:
Johan Wikman
2017-03-10 14:01:36 +02:00
parent 669d6e95f4
commit a58f944f23
8 changed files with 68 additions and 25 deletions

View File

@ -47,7 +47,7 @@ int main(int argc, char** argv)
set_process_datadir(strdup("/tmp"));
qc_setup("qc_sqlite", NULL);
qc_process_init();
qc_process_init(QC_INIT_BOTH);
infile = fopen(argv[1], "rb");
outfile = fopen(argv[2], "wb");
@ -83,6 +83,6 @@ int main(int argc, char** argv)
}
fclose(infile);
fclose(outfile);
qc_process_end();
qc_process_end(QC_INIT_BOTH);
return 0;
}

View File

@ -314,10 +314,10 @@ int main(int argc, char** argv)
if (mxs_log_init(NULL, ".", MXS_LOG_TARGET_DEFAULT))
{
if (qc_setup(lib, NULL) && qc_process_init())
if (qc_setup(lib, NULL) && qc_process_init(QC_INIT_BOTH))
{
rc = run(input_name, expected_name);
qc_process_end();
qc_process_end(QC_INIT_BOTH);
}
else
{

View File

@ -41,7 +41,7 @@ int main()
set_libdir(strdup("../qc_sqlite"));
if (qc_setup("qc_sqlite", NULL) && qc_process_init())
if (qc_setup("qc_sqlite", NULL) && qc_process_init(QC_INIT_BOTH))
{
const char s[] = "SELECT @@global.max_allowed_packet";
@ -53,7 +53,7 @@ int main()
// code generator.
qc_parse(stmt);
qc_process_end();
qc_process_end(QC_INIT_BOTH);
rv = EXIT_SUCCESS;
}