Make query_classifier a wrapper.

The query_classifier library is now only a wrapper that loads an
actual query classifier implementation. Currently it is hardwired
to load qc_mysqlembedded, which implements the query classifier
API using MySQL embedded.

This will be changed, so that the library to load is specified
when qc_init() is called. That will then allow the query classifier
to be specified in the config file.

Currently there seems to be a conflict between the mysql_library_end()
call made in qc_mysqlembedded and the mysql_library_end() call made in
gateway.c. The reason is that they both finalize a shared library.
For the time being mysql_library_end() is not called in gateway.c.
This problem is likely to go away by switching from the client
library to the connector-c library.
This commit is contained in:
Johan Wikman
2016-01-26 17:37:09 +02:00
parent 0d78b3f8cd
commit 0c6e9f3def
7 changed files with 145 additions and 1766 deletions

View File

@ -507,7 +507,15 @@ static void libmysqld_done(void)
{
if (libmysqld_started)
{
mysql_library_end();
// TODO: qc_end() (if qc_mysqlembedded is used) also calls mysql_library_end(),
// TODO: which refers to the mysql_library_end() in the embedded library. This
// TODO: one would call the mysql_library_end() in the client library. It seems
// TODO: that would work, but for the fact that both de-initialize some lower
// TODO: level library, which in turn does not work. Thus, for the time being
// TODO: this call is not made.
// TODO: Linking MaxScale with Connector-C would likely make this problem
// TODO: go away.
//mysql_library_end();
}
}
@ -2012,6 +2020,8 @@ int main(int argc, char **argv)
/** Release mysql thread context*/
mysql_thread_end();
qc_end();
utils_end();
datadir_cleanup();
MXS_NOTICE("MaxScale shutdown completed.");