Merge branch 'Z3' of https://github.com/skysql/MaxScale into Z3
This commit is contained in:
Binary file not shown.
BIN
Documentation/MaxScale Configuration And Usage Scenarios-Z3.pdf
Normal file
BIN
Documentation/MaxScale Configuration And Usage Scenarios-Z3.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
2
Makefile
2
Makefile
@ -42,13 +42,13 @@ all:
|
|||||||
(cd client; make)
|
(cd client; make)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
echo '#define MAXSCALE_VERSION "'`cat $(ROOT_PATH)/VERSION`'"' > $(ROOT_PATH)/server/include/version.h
|
||||||
(cd log_manager; make clean)
|
(cd log_manager; make clean)
|
||||||
(cd query_classifier; make clean)
|
(cd query_classifier; make clean)
|
||||||
(cd server; make clean)
|
(cd server; make clean)
|
||||||
(cd client; touch depend.mk; make clean)
|
(cd client; touch depend.mk; make clean)
|
||||||
|
|
||||||
depend:
|
depend:
|
||||||
echo '#define MAXSCALE_VERSION "'`cat $(ROOT_PATH)/VERSION`'"' > $(ROOT_PATH)/server/include/version.h
|
|
||||||
(cd log_manager; make depend)
|
(cd log_manager; make depend)
|
||||||
(cd query_classifier; make depend)
|
(cd query_classifier; make depend)
|
||||||
(cd server; make depend)
|
(cd server; make depend)
|
||||||
|
|||||||
@ -16,9 +16,9 @@ Group: Development/Tools
|
|||||||
#Requires:
|
#Requires:
|
||||||
|
|
||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
BuildRequires: gcc gcc-c++ ncurses-devel bison glibc-devel cmake libgcc_s1 perl make libtool libopenssl-devel libaio libaio-devel mariadb libedit-devel
|
BuildRequires: gcc gcc-c++ ncurses-devel bison glibc-devel cmake libgcc_s1 perl make libtool libopenssl-devel libaio libaio-devel mariadb libedit-devel librabbitmq-devel
|
||||||
%else
|
%else
|
||||||
BuildRequires: gcc gcc-c++ ncurses-devel bison glibc-devel cmake libgcc perl make libtool openssl-devel libaio libaio-devel
|
BuildRequires: gcc gcc-c++ ncurses-devel bison glibc-devel cmake libgcc perl make libtool openssl-devel libaio libaio-devel librabbitmq-devel
|
||||||
%if 0%{?rhel} == 6
|
%if 0%{?rhel} == 6
|
||||||
BuildRequires: libedit-devel
|
BuildRequires: libedit-devel
|
||||||
%endif
|
%endif
|
||||||
|
|||||||
@ -57,19 +57,33 @@ int main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
read(fdin,buffer,fsz);
|
read(fdin,buffer,fsz);
|
||||||
tok = strpbrk(buffer,"\n");
|
|
||||||
lines = 1;
|
|
||||||
|
|
||||||
while((tok = strpbrk(tok + 1,"\n"))){
|
|
||||||
lines++;
|
|
||||||
}
|
|
||||||
|
|
||||||
qbuff = malloc(sizeof(GWBUF*)*lines);
|
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
int bsz = 4,z=0;
|
||||||
|
qbuff = calloc(bsz,sizeof(GWBUF*));
|
||||||
tok = strtok(buffer,"\n");
|
tok = strtok(buffer,"\n");
|
||||||
|
|
||||||
while(tok){
|
while(tok){
|
||||||
|
|
||||||
|
if(i>=bsz){
|
||||||
|
GWBUF** tmp = calloc(bsz*2,sizeof(GWBUF*));
|
||||||
|
if(!tmp){
|
||||||
|
printf("Error: Failed to allocate memory.");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(z=0;z<bsz;z++){
|
||||||
|
tmp[z] = qbuff[z];
|
||||||
|
}
|
||||||
|
|
||||||
|
free(qbuff);
|
||||||
|
qbuff = tmp;
|
||||||
|
bsz *= 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strlen(tok) > 0){
|
||||||
qin = strdup(tok);
|
qin = strdup(tok);
|
||||||
psize = strlen(qin);
|
psize = strlen(qin);
|
||||||
qbuff[i] = gwbuf_alloc(psize + 6);
|
qbuff[i] = gwbuf_alloc(psize + 6);
|
||||||
@ -79,14 +93,16 @@ int main(int argc, char** argv)
|
|||||||
*(qbuff[i]->sbuf->data + 4) = 0x03;
|
*(qbuff[i]->sbuf->data + 4) = 0x03;
|
||||||
memcpy(qbuff[i]->sbuf->data + 5,qin,psize);
|
memcpy(qbuff[i]->sbuf->data + 5,qin,psize);
|
||||||
*(qbuff[i]->sbuf->data + 5 + psize) = 0x00;
|
*(qbuff[i]->sbuf->data + 5 + psize) = 0x00;
|
||||||
tok = strtok(NULL,"\n");
|
tok = strtok(NULL,"\n\0");
|
||||||
free(qin);
|
free(qin);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fdout = open(argv[2],O_TRUNC|O_CREAT|O_WRONLY,S_IRWXU|S_IXGRP|S_IXOTH);
|
fdout = open(argv[2],O_TRUNC|O_CREAT|O_WRONLY,S_IRWXU|S_IXGRP|S_IXOTH);
|
||||||
|
|
||||||
for(i = 0;i<lines;i++){
|
for(i = 0;i<bsz;i++){
|
||||||
|
if(qbuff[i]){
|
||||||
parse_query(qbuff[i]);
|
parse_query(qbuff[i]);
|
||||||
tok = skygw_get_canonical(qbuff[i]);
|
tok = skygw_get_canonical(qbuff[i]);
|
||||||
write(fdout,tok,strlen(tok));
|
write(fdout,tok,strlen(tok));
|
||||||
@ -94,6 +110,9 @@ int main(int argc, char** argv)
|
|||||||
gwbuf_free(qbuff[i]);
|
gwbuf_free(qbuff[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
free(qbuff);
|
||||||
|
free(buffer);
|
||||||
close(fdin);
|
close(fdin);
|
||||||
close(fdout);
|
close(fdout);
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,10 @@ OBJ=$(SRCS:.c=.o)
|
|||||||
LIBS=$(UTILSPATH)/skygw_utils.o -lssl -llog_manager
|
LIBS=$(UTILSPATH)/skygw_utils.o -lssl -llog_manager
|
||||||
MODULES= libtestfilter.so libqlafilter.so libregexfilter.so libtopfilter.so libtee.so
|
MODULES= libtestfilter.so libqlafilter.so libregexfilter.so libtopfilter.so libtee.so
|
||||||
|
|
||||||
|
ifndef BUILD_RABBITMQ
|
||||||
|
BUILD_RABBITMQ=Y
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(BUILD_RABBITMQ),Y)
|
ifeq ($(BUILD_RABBITMQ),Y)
|
||||||
SRCS += $(MQSRCS)
|
SRCS += $(MQSRCS)
|
||||||
MODULES += libmqfilter.so
|
MODULES += libmqfilter.so
|
||||||
|
|||||||
@ -981,6 +981,14 @@ routeQuery(FILTER *instance, void *session, GWBUF *queue)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(my_instance->trgtype == TRG_ALL){
|
||||||
|
skygw_log_write_flush(LOGFILE_TRACE,"Trigger is TRG_ALL");
|
||||||
|
schema_ok = true;
|
||||||
|
src_ok = true;
|
||||||
|
obj_ok = true;
|
||||||
|
goto validate_triggers;
|
||||||
|
}
|
||||||
|
|
||||||
if(my_instance->trgtype & TRG_SOURCE && my_instance->src_trg){
|
if(my_instance->trgtype & TRG_SOURCE && my_instance->src_trg){
|
||||||
|
|
||||||
if(session_isvalid(my_session->session)){
|
if(session_isvalid(my_session->session)){
|
||||||
@ -1131,9 +1139,6 @@ routeQuery(FILTER *instance, void *session, GWBUF *queue)
|
|||||||
obj_ok = true;
|
obj_ok = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(my_instance->trgtype == TRG_ALL){
|
|
||||||
skygw_log_write_flush(LOGFILE_TRACE,"Trigger is TRG_ALL");
|
|
||||||
}
|
|
||||||
|
|
||||||
validate_triggers:
|
validate_triggers:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user