Removed libraries and headers referred to Query classifier because Qc is not needed in gateway and gateway needs MySQL Client library functions which can connect to remote server.

This commit is contained in:
vraatikka
2013-06-29 00:15:58 +03:00
parent 3e8b19733e
commit 2bce5415dc
2 changed files with 8 additions and 83 deletions

View File

@ -30,29 +30,27 @@
# lib to avoid conflicts. MARIADB_SRC_PATH # lib to avoid conflicts. MARIADB_SRC_PATH
# is set in build_gateway.inc. Examples # is set in build_gateway.inc. Examples
# are behind SS_DEBUG macros. # 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 include ../../build_gateway.inc
LOGPATH := $(ROOT_PATH)/log_manager LOGPATH := $(ROOT_PATH)/log_manager
UTILSPATH := $(ROOT_PATH)/utils UTILSPATH := $(ROOT_PATH)/utils
QCLASSPATH := $(ROOT_PATH)/query_classifier
CC=cc CC=cc
#CFLAGS=-c -I/usr/include -I../include -I../inih \
#-I/usr/include/mysql \
CFLAGS=-c -I/usr/include -I../include -I../inih \ CFLAGS=-c -I/usr/include -I../include -I../inih \
-I$(LOGPATH) -I$(UTILSPATH) -I$(QCLASSPATH) \ -I/usr/include/mysql \
-I$(MARIADB_SRC_PATH)/include \ -I$(LOGPATH) -I$(UTILSPATH) \
-Wall -g -Wall -g
ifdef DEBUG ifdef DEBUG
CFLAGS := $(CFLAGS) -DSS_DEBUG CFLAGS := $(CFLAGS) -DSS_DEBUG
endif endif
LDFLAGS=-rdynamic -L$(LOGPATH) -L$(QCLASSPATH) -L$(MARIADB_SRC_PATH)/libmysqld \ LDFLAGS=-rdynamic -L$(LOGPATH) \
-Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) -Wl,-rpath,$(QCLASSPATH) \ -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH)
-Wl,-rpath,$(MARIADB_SRC_PATH)/libmysqld
SRCS= atomic.c buffer.c spinlock.c gateway.c gateway_mysql_protocol.c \ 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 \ 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 ../include/users.h ../include/hashtable.h
OBJ=$(SRCS:.c=.o) 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++ \ 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) gateway: $(OBJ)
$(CC) $(LDFLAGS) $(OBJ) $(UTILSPATH)/skygw_utils.o $(LIBS) -o $@ $(CC) $(LDFLAGS) $(OBJ) $(UTILSPATH)/skygw_utils.o $(LIBS) -o $@

View File

@ -48,13 +48,9 @@
#include <config.h> #include <config.h>
#include <poll.h> #include <poll.h>
#include <stdlib.h>
#include <mysql.h>
#if defined(SS_DEBUG) #if defined(SS_DEBUG)
# include <skygw_utils.h> # include <skygw_utils.h>
# include <log_manager.h> # include <log_manager.h>
# include <query_classifier.h>
#endif /* SS_DEBUG */ #endif /* SS_DEBUG */
/* basic signal handling */ /* basic signal handling */
@ -177,72 +173,6 @@ int handle_event_errors_backend(DCB *dcb) {
return 0; 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 // main function
int int
@ -261,7 +191,6 @@ main(int argc, char **argv)
if (i != 0) { if (i != 0) {
fprintf(stderr, "Couldn't register exit function.\n"); fprintf(stderr, "Couldn't register exit function.\n");
} }
vilhos_test_for_query_classifier();
#endif #endif
if ((home = getenv("GATEWAY_HOME")) != NULL) if ((home = getenv("GATEWAY_HOME")) != NULL)
{ {