Merge branch 'release-1.0beta-refresh' into filter_harness

This commit is contained in:
Markus Makela
2014-09-17 11:07:12 +03:00
158 changed files with 10243 additions and 1001 deletions

View File

@ -21,15 +21,16 @@
include ../../../build_gateway.inc
LOGPATH := $(ROOT_PATH)/log_manager
QCLASSPATH := $(ROOT_PATH)/query_classifier
UTILSPATH := $(ROOT_PATH)/utils
CC=cc
CFLAGS=-c -fPIC -I/usr/include -I../include -I../../include -I$(LOGPATH) \
-I$(UTILSPATH) -Wall -g
CFLAGS=-c -fPIC -I/usr/include -I../include -I../../include -I$(LOGPATH) -I$(QCLASSPATH) \
-I$(UTILSPATH) -I$(MYSQL_ROOT) -Wall -g
include ../../../makefile.inc
LDFLAGS=-shared -L$(LOGPATH) -Wl,-rpath,$(DEST)/lib \
LDFLAGS=-shared -L$(LOGPATH) -L$(EMBEDDED_LIB) -L$(QCLASSPATH) -Wl,-rpath,$(DEST)/lib \
-Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH)
TESTSRCS=testfilter.c
@ -42,17 +43,31 @@ TOPNSRCS=topfilter.c
TOPNOBJ=$(TOPNSRCS:.c=.o)
TEESRCS=tee.c
TEEOBJ=$(TEESRCS:.c=.o)
MQSRCS=mqfilter.c
MQOBJ=$(MQSRCS:.c=.o)
SRCS=$(TESTSRCS) $(QLASRCS) $(REGEXSRCS) $(TOPNSRCS) $(TEESRCS)
OBJ=$(SRCS:.c=.o)
LIBS=$(UTILSPATH)/skygw_utils.o -lssl -llog_manager
MODULES= libtestfilter.so libqlafilter.so libregexfilter.so libtopfilter.so libtee.so libhintfilter.so
MODULES= libtestfilter.so libqlafilter.so libregexfilter.so libtopfilter.so libhintfilter.so libtee.so
ifndef BUILD_RABBITMQ
BUILD_RABBITMQ=N
endif
ifeq ($(BUILD_RABBITMQ),Y)
SRCS += $(MQSRCS)
MODULES += libmqfilter.so
LIBS += -lrabbitmq -lquery_classifier
endif
all: $(MODULES)
libtestfilter.so: $(TESTOBJ)
$(CC) $(LDFLAGS) $(TESTOBJ) $(LIBS) -o $@
libmqfilter.so: $(MQOBJ)
$(CC) $(LDFLAGS) $(MQOBJ) $(LIBS) -o $@
libqlafilter.so: $(QLAOBJ)
$(CC) $(LDFLAGS) $(QLAOBJ) $(LIBS) -o $@
@ -65,10 +80,9 @@ libtopfilter.so: $(TOPNOBJ)
libtee.so: $(TEEOBJ)
$(CC) $(LDFLAGS) $(TEEOBJ) $(LIBS) -o $@
libhintfilter.so:
libhintfilter.so:
(cd hint; touch depend.mk ; make; cp $@ ..)
.c.o:
$(CC) $(CFLAGS) $< -o $@
@ -81,7 +95,7 @@ tags:
(cd hint; touch depend.mk; make tags)
depend:
@$(DEL) depend.mk
@rm -f depend.mk
cc -M $(CFLAGS) $(SRCS) > depend.mk
(cd hint; touch depend.mk; make depend)
@ -90,14 +104,14 @@ install: $(MODULES)
cleantests:
$(MAKE) -C test cleantests
buildtests:
$(MAKE) -C test DEBUG=Y buildtests
runtests:
$(MAKE) -C test runtests
testall:
$(MAKE) -C test testall
include depend.mk

View File

@ -231,18 +231,9 @@ HINT_MODE mode = HM_EXECUTE;
goto retblock;
}
/** This is not MaxScale hint because it doesn't start with 'maxscale' */
if (tok->token != TOK_MAXSCALE)
{
LOGIF(LT, (skygw_log_write(
LOGFILE_TRACE,
"Error : Invalid hint string '%s'. Hint should start "
"with keyword 'maxscale'. Hint ignored.",
token_get_keyword(tok))));
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error : Invalid hint string '%s'. Hint should start "
"with keyword 'maxscale'. Hint ignored.",
token_get_keyword(tok))));
token_free(tok);
goto retblock;
}
@ -270,6 +261,11 @@ HINT_MODE mode = HM_EXECUTE;
hint_pop(session);
state = HS_INIT;
break;
case TOK_START:
hintname = NULL;
mode = HM_START;
state = HS_INIT;
break;
default:
/* Error: expected hint, name or STOP */
LOGIF(LT, (skygw_log_write(
@ -450,7 +446,7 @@ HINT_MODE mode = HM_EXECUTE;
/*
* We are starting either a predefined set of hints,
* creating a new set of hints and starting in a single
* operation or starting an annonymous block of hints.
* operation or starting an anonymous block of hints.
*/
if (hintname == NULL && rval != NULL)
{
@ -532,6 +528,7 @@ hint_next_token(GWBUF **buf, char **ptr)
{
char word[100], *dest;
int inword = 0;
int endtag = 0;
char inquote = '\0';
int i, found;
HINT_TOKEN *tok;
@ -562,6 +559,18 @@ HINT_TOKEN *tok;
else if (**ptr == '\'')
inquote = **ptr;
/** Any other character which belongs to the word, move ahead */
else if(**ptr == '/' && endtag)
{
/** Comment end tag found, rewind the pointer back and return the token */
inword = 0;
(*ptr)--;
break;
}
else if(**ptr == '*' && !endtag)
{
endtag = 1;
}
else if (inword || (isspace(**ptr) == 0))
{
*dest++ = **ptr;
@ -583,7 +592,7 @@ HINT_TOKEN *tok;
/* We now have a word in the local word, check to see if it is a
* token we recognise.
*/
if (word[0] == '\0')
if (word[0] == '\0' || (word[0] == '*' && word[1] == '/'))
{
tok->token = TOK_EOL;
return tok;
@ -758,4 +767,4 @@ HINTSTACK* free_hint_stack(
{
return NULL;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -320,12 +320,14 @@ SESSION *bsession;
if (my_session->active)
{
bsession = my_session->branch_session;
router = bsession->service->router;
router_instance = bsession->service->router_instance;
rsession = bsession->router_session;
/** Close router session and all its connections */
router->closeSession(router_instance, rsession);
if ((bsession = my_session->branch_session) != NULL)
{
router = bsession->service->router;
router_instance = bsession->service->router_instance;
rsession = bsession->router_session;
/** Close router session and all its connections */
router->closeSession(router_instance, rsession);
}
dcb_free(my_session->branch_dcb);
/* No need to free the session, this is done as
* a side effect of closing the client DCB of the