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:
@ -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)
|
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 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,--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})
|
install(TARGETS query_classifier COMPONENT lib DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_subdirectory(qc_mysqlembedded)
|
add_subdirectory(qc_mysqlembedded)
|
||||||
|
@ -1818,6 +1818,9 @@ void qc_thread_end()
|
|||||||
* EXPORTS
|
* EXPORTS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
|
||||||
static char version_string[] = "V1.0.0";
|
static char version_string[] = "V1.0.0";
|
||||||
|
|
||||||
static QUERY_CLASSIFIER qc =
|
static QUERY_CLASSIFIER qc =
|
||||||
@ -1862,4 +1865,4 @@ QUERY_CLASSIFIER* GetModuleObject()
|
|||||||
return &qc;
|
return &qc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
global:
|
global:
|
||||||
info;
|
info;
|
||||||
version;
|
version;
|
||||||
GetModuleInfo;
|
GetModuleObject;
|
||||||
ModuleInit;
|
ModuleInit;
|
||||||
local:
|
local:
|
||||||
*;
|
*;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -507,7 +507,15 @@ static void libmysqld_done(void)
|
|||||||
{
|
{
|
||||||
if (libmysqld_started)
|
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*/
|
/** Release mysql thread context*/
|
||||||
mysql_thread_end();
|
mysql_thread_end();
|
||||||
|
|
||||||
|
qc_end();
|
||||||
|
|
||||||
utils_end();
|
utils_end();
|
||||||
datadir_cleanup();
|
datadir_cleanup();
|
||||||
MXS_NOTICE("MaxScale shutdown completed.");
|
MXS_NOTICE("MaxScale shutdown completed.");
|
||||||
|
@ -4,7 +4,9 @@ target_link_libraries(binlogrouter maxscale-common)
|
|||||||
install(TARGETS binlogrouter DESTINATION ${MAXSCALE_LIBDIR})
|
install(TARGETS binlogrouter DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_executable(maxbinlogcheck maxbinlogcheck.c blr_file.c blr_cache.c blr_master.c blr_slave.c blr.c)
|
add_executable(maxbinlogcheck maxbinlogcheck.c blr_file.c blr_cache.c blr_master.c blr_slave.c blr.c)
|
||||||
target_link_libraries(maxbinlogcheck maxscale-common query_classifier)
|
# maxbinlogcheck refers to my_uuid_init and my_uuin. They are non-public functions and
|
||||||
|
# should not be used. They are found only from the embedded lib.
|
||||||
|
target_link_libraries(maxbinlogcheck maxscale-common query_classifier ${EMBEDDED_LIB})
|
||||||
|
|
||||||
install(TARGETS maxbinlogcheck DESTINATION bin)
|
install(TARGETS maxbinlogcheck DESTINATION bin)
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
if(BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
add_executable(testbinlogrouter testbinlog.c ../blr.c ../blr_slave.c ../blr_master.c ../blr_file.c ../blr_cache.c)
|
add_executable(testbinlogrouter testbinlog.c ../blr.c ../blr_slave.c ../blr_master.c ../blr_file.c ../blr_cache.c)
|
||||||
target_link_libraries(testbinlogrouter maxscale-common query_classifier)
|
# testbinlogrouter refers to my_uuid_init and my_uuin. They are non-public functions and
|
||||||
|
# should not be used. They are found only from the embedded lib.
|
||||||
|
target_link_libraries(testbinlogrouter maxscale-common query_classifier ${EMBEDDED_LIB})
|
||||||
add_test(TestBinlogRouter ${CMAKE_CURRENT_BINARY_DIR}/testbinlogrouter)
|
add_test(TestBinlogRouter ${CMAKE_CURRENT_BINARY_DIR}/testbinlogrouter)
|
||||||
endif()
|
endif()
|
||||||
|
Reference in New Issue
Block a user