MXS-1275: SetSqlModeParser moved under MySQLClient

That's where it belongs as it is only the mysql client protocol that
will use it. It's a bit unfortunate that the qc test program compare
now needs to include a file from a protocol module directory, but
the fact is that the query classifier implementation and the test
programs should actually be *under* the mysql client protocol module.
This commit is contained in:
Johan Wikman
2017-06-05 10:27:33 +03:00
parent 25314b6662
commit 12a291919a
6 changed files with 11 additions and 13 deletions

View File

@ -29,7 +29,7 @@
#include <maxscale/log_manager.h> #include <maxscale/log_manager.h>
#include <maxscale/protocol/mysql.h> #include <maxscale/protocol/mysql.h>
#include <maxscale/query_classifier.h> #include <maxscale/query_classifier.h>
#include "../../server/core/maxscale/setsqlmodeparser.hh" #include "../../server/modules/protocol/MySQL/MySQLClient/setsqlmodeparser.hh"
#include "testreader.hh" #include "testreader.hh"
using std::cerr; using std::cerr;
using std::cin; using std::cin;
@ -41,7 +41,6 @@ using std::map;
using std::ostream; using std::ostream;
using std::string; using std::string;
using std::stringstream; using std::stringstream;
using maxscale::SetSqlModeParser;
#if MYSQL_VERSION_MAJOR == 10 && MYSQL_VERSION_MINOR == 3 #if MYSQL_VERSION_MAJOR == 10 && MYSQL_VERSION_MINOR == 3
#define USING_MARIADB_103 #define USING_MARIADB_103

View File

@ -12,7 +12,6 @@ add_executable(test_poll testpoll.c)
add_executable(test_queuemanager testqueuemanager.c) add_executable(test_queuemanager testqueuemanager.c)
add_executable(test_server testserver.c) add_executable(test_server testserver.c)
add_executable(test_service testservice.c) add_executable(test_service testservice.c)
add_executable(test_setsqlmodeparser test_setsqlmodeparser.cc)
add_executable(test_spinlock testspinlock.c) add_executable(test_spinlock testspinlock.c)
add_executable(test_trxcompare testtrxcompare.cc ../../../query_classifier/test/testreader.cc) add_executable(test_trxcompare testtrxcompare.cc ../../../query_classifier/test/testreader.cc)
add_executable(test_trxtracking testtrxtracking.cc) add_executable(test_trxtracking testtrxtracking.cc)
@ -36,7 +35,6 @@ target_link_libraries(test_poll maxscale-common)
target_link_libraries(test_queuemanager maxscale-common) target_link_libraries(test_queuemanager maxscale-common)
target_link_libraries(test_server maxscale-common) target_link_libraries(test_server maxscale-common)
target_link_libraries(test_service maxscale-common) target_link_libraries(test_service maxscale-common)
target_link_libraries(test_setsqlmodeparser maxscale-common)
target_link_libraries(test_spinlock maxscale-common) target_link_libraries(test_spinlock maxscale-common)
target_link_libraries(test_trxcompare maxscale-common) target_link_libraries(test_trxcompare maxscale-common)
target_link_libraries(test_trxtracking maxscale-common) target_link_libraries(test_trxtracking maxscale-common)
@ -62,7 +60,6 @@ add_test(TestPoll test_poll)
add_test(TestQueueManager test_queuemanager) add_test(TestQueueManager test_queuemanager)
add_test(TestServer test_server) add_test(TestServer test_server)
add_test(TestService test_service) add_test(TestService test_service)
add_test(test_setsqlmodeparser test_setsqlmodeparser)
add_test(TestSpinlock test_spinlock) add_test(TestSpinlock test_spinlock)
add_test(TestUsers test_users) add_test(TestUsers test_users)
add_test(TestModulecmd testmodulecmd) add_test(TestModulecmd testmodulecmd)

View File

@ -2,3 +2,7 @@ add_library(MySQLClient SHARED mysql_client.cc)
target_link_libraries(MySQLClient maxscale-common MySQLCommon) target_link_libraries(MySQLClient maxscale-common MySQLCommon)
set_target_properties(MySQLClient PROPERTIES VERSION "1.0.0") set_target_properties(MySQLClient PROPERTIES VERSION "1.0.0")
install_module(MySQLClient core) install_module(MySQLClient core)
if(BUILD_TESTS)
add_subdirectory(test)
endif()

View File

@ -17,10 +17,7 @@
#include <maxscale/protocol/mysql.h> #include <maxscale/protocol/mysql.h>
namespace maxscale class SetSqlModeParser : public maxscale::CustomParser
{
class SetSqlModeParser : public CustomParser
{ {
public: public:
enum sql_mode_t enum sql_mode_t
@ -652,5 +649,3 @@ private:
return token; return token;
} }
}; };
}

View File

@ -0,0 +1,4 @@
add_executable(test_setsqlmodeparser test_setsqlmodeparser.cc)
target_link_libraries(test_setsqlmodeparser maxscale-common)
add_test(test_setsqlmodeparser test_setsqlmodeparser)

View File

@ -11,14 +11,13 @@
* Public License. * Public License.
*/ */
#include "../core/maxscale/setsqlmodeparser.hh" #include "../setsqlmodeparser.hh"
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <iostream> #include <iostream>
#include <maxscale/buffer.h> #include <maxscale/buffer.h>
#include <maxscale/paths.h> #include <maxscale/paths.h>
using namespace maxscale;
using namespace std; using namespace std;
namespace namespace