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 5e5a522d27
commit e840f92cbb
7 changed files with 145 additions and 1766 deletions

View File

@ -3,7 +3,7 @@ add_library(query_classifier SHARED query_classifier.cc)
target_link_libraries(query_classifier ${MYSQL_EMBEDDED_LIB} aio crypt crypto dl m ${PCRE_LINK_FLAGS} ssl stdc++ z)
set_target_properties(query_classifier PROPERTIES VERSION "1.0.0")
set_target_properties(query_classifier PROPERTIES LINK_FLAGS -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/query_classifier.map)
#set_target_properties(query_classifier PROPERTIES LINK_FLAGS -Wl,-z,defs)
set_target_properties(query_classifier PROPERTIES LINK_FLAGS -Wl,-z,defs)
install(TARGETS query_classifier COMPONENT lib DESTINATION ${MAXSCALE_LIBDIR})
add_subdirectory(qc_mysqlembedded)

View File

@ -1818,6 +1818,9 @@ void qc_thread_end()
* EXPORTS
*/
extern "C"
{
static char version_string[] = "V1.0.0";
static QUERY_CLASSIFIER qc =
@ -1862,4 +1865,4 @@ QUERY_CLASSIFIER* GetModuleObject()
return &qc;
}
}

View File

@ -2,7 +2,7 @@
global:
info;
version;
GetModuleInfo;
GetModuleObject;
ModuleInit;
local:
*;

File diff suppressed because it is too large Load Diff