diff --git a/core/Makefile b/core/Makefile index cfd40d162..e5dfaa485 100644 --- a/core/Makefile +++ b/core/Makefile @@ -30,29 +30,27 @@ # lib to avoid conflicts. MARIADB_SRC_PATH # is set in build_gateway.inc. Examples # are behind SS_DEBUG macros. +# 29/06/13 Vilho Raatikka Reverted Query classifier changes because +# gateway needs mysql client lib, not qc. include ../../build_gateway.inc LOGPATH := $(ROOT_PATH)/log_manager UTILSPATH := $(ROOT_PATH)/utils -QCLASSPATH := $(ROOT_PATH)/query_classifier CC=cc -#CFLAGS=-c -I/usr/include -I../include -I../inih \ -#-I/usr/include/mysql \ CFLAGS=-c -I/usr/include -I../include -I../inih \ - -I$(LOGPATH) -I$(UTILSPATH) -I$(QCLASSPATH) \ - -I$(MARIADB_SRC_PATH)/include \ + -I/usr/include/mysql \ + -I$(LOGPATH) -I$(UTILSPATH) \ -Wall -g ifdef DEBUG CFLAGS := $(CFLAGS) -DSS_DEBUG endif -LDFLAGS=-rdynamic -L$(LOGPATH) -L$(QCLASSPATH) -L$(MARIADB_SRC_PATH)/libmysqld \ - -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) -Wl,-rpath,$(QCLASSPATH) \ - -Wl,-rpath,$(MARIADB_SRC_PATH)/libmysqld +LDFLAGS=-rdynamic -L$(LOGPATH) \ + -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) SRCS= atomic.c buffer.c spinlock.c gateway.c gateway_mysql_protocol.c \ gw_utils.c utils.c dcb.c load_utils.c session.c service.c server.c \ @@ -65,11 +63,9 @@ HDRS= ../include/atomic.h ../include/buffer.h ../include/dcb.h \ ../include/users.h ../include/hashtable.h OBJ=$(SRCS:.c=.o) -#LIBS=-L../inih/extra -linih -lssl -lstdc++ \ -# -L/packages/mariadb-5.5.25/libmysql -lmysqlclient \ - LIBS=-L../inih/extra -linih -lssl -lstdc++ \ - -lz -lm -lcrypto -ldl -pthread -llog_manager -lquery_classifier -lmysqld + -L/packages/mariadb-5.5.25/libmysql -lmysqlclient \ + -lz -lm -lcrypto -ldl -pthread -llog_manager gateway: $(OBJ) $(CC) $(LDFLAGS) $(OBJ) $(UTILSPATH)/skygw_utils.o $(LIBS) -o $@ diff --git a/core/gateway.c b/core/gateway.c index d3de29a7b..30e4d42eb 100644 --- a/core/gateway.c +++ b/core/gateway.c @@ -48,13 +48,9 @@ #include #include -#include -#include - #if defined(SS_DEBUG) # include # include -# include #endif /* SS_DEBUG */ /* basic signal handling */ @@ -177,72 +173,6 @@ int handle_event_errors_backend(DCB *dcb) { return 0; } -#if defined(SS_DEBUG) -static char* server_options[] = { - "raatikka", - "--datadir=/home/raatikka/data/skygw_parse/", - "--skip-innodb", - "--default-storage-engine=myisam", - NULL -}; - -const int num_elements = (sizeof(server_options) / sizeof(char *)) - 1; - -static char* server_groups[] = { - "embedded", - "server", - "server", - "server", - NULL -}; - - -static void vilhos_test_for_query_classifier(void) -{ - bool failp; - MYSQL* mysql; - - /** - * Init libmysqld. - */ - failp = mysql_library_init(num_elements, server_options, server_groups); - - if (failp) { - MYSQL* mysql = mysql_init(NULL); - ss_dassert(mysql != NULL); - fprintf(stderr, - "mysql_init failed, %d : %s\n", - mysql_errno(mysql), - mysql_error(mysql)); - goto return_without_server; - } - - char* str = (char *)calloc(1, - sizeof("Query type is ")+ - sizeof("QUERY_TYPE_SESSION_WRITE")); - /** - * Call query classifier. - */ - sprintf(str, - "Query type is %s\n", - STRQTYPE( - skygw_query_classifier_get_type( - "SELECT user from mysql.user", 0))); - /** - * generate some log - */ - skygw_log_write(NULL, LOGFILE_MESSAGE,str); - -return_with_handle: - mysql_close(mysql); - mysql_thread_end(); - mysql_library_end(); - -return_without_server: - ss_dfprintf(stderr, "\n<< testmain\n"); - fflush(stderr); -} -#endif /* SS_DEBUG */ // main function int @@ -261,7 +191,6 @@ main(int argc, char **argv) if (i != 0) { fprintf(stderr, "Couldn't register exit function.\n"); } - vilhos_test_for_query_classifier(); #endif if ((home = getenv("GATEWAY_HOME")) != NULL) {