Merge branch 'Z3' of https://github.com/skysql/MaxScale into Z3
This commit is contained in:
commit
b8d7c3df9f
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)
|
||||
|
||||
clean:
|
||||
echo '#define MAXSCALE_VERSION "'`cat $(ROOT_PATH)/VERSION`'"' > $(ROOT_PATH)/server/include/version.h
|
||||
(cd log_manager; make clean)
|
||||
(cd query_classifier; make clean)
|
||||
(cd server; make clean)
|
||||
(cd client; touch depend.mk; make clean)
|
||||
|
||||
depend:
|
||||
echo '#define MAXSCALE_VERSION "'`cat $(ROOT_PATH)/VERSION`'"' > $(ROOT_PATH)/server/include/version.h
|
||||
(cd log_manager; make depend)
|
||||
(cd query_classifier; make depend)
|
||||
(cd server; make depend)
|
||||
|
@ -16,9 +16,9 @@ Group: Development/Tools
|
||||
#Requires:
|
||||
|
||||
%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
|
||||
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
|
||||
BuildRequires: libedit-devel
|
||||
%endif
|
||||
|
@ -57,43 +57,62 @@ int main(int argc, char** argv)
|
||||
}
|
||||
|
||||
read(fdin,buffer,fsz);
|
||||
tok = strpbrk(buffer,"\n");
|
||||
lines = 1;
|
||||
|
||||
while((tok = strpbrk(tok + 1,"\n"))){
|
||||
lines++;
|
||||
}
|
||||
|
||||
qbuff = malloc(sizeof(GWBUF*)*lines);
|
||||
|
||||
|
||||
|
||||
i = 0;
|
||||
int bsz = 4,z=0;
|
||||
qbuff = calloc(bsz,sizeof(GWBUF*));
|
||||
tok = strtok(buffer,"\n");
|
||||
|
||||
while(tok){
|
||||
qin = strdup(tok);
|
||||
psize = strlen(qin);
|
||||
qbuff[i] = gwbuf_alloc(psize + 6);
|
||||
*(qbuff[i]->sbuf->data + 0) = (unsigned char)psize;
|
||||
*(qbuff[i]->sbuf->data + 1) = (unsigned char)(psize>>8);
|
||||
*(qbuff[i]->sbuf->data + 2) = (unsigned char)(psize>>16);
|
||||
*(qbuff[i]->sbuf->data + 4) = 0x03;
|
||||
memcpy(qbuff[i]->sbuf->data + 5,qin,psize);
|
||||
*(qbuff[i]->sbuf->data + 5 + psize) = 0x00;
|
||||
tok = strtok(NULL,"\n");
|
||||
free(qin);
|
||||
i++;
|
||||
|
||||
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);
|
||||
psize = strlen(qin);
|
||||
qbuff[i] = gwbuf_alloc(psize + 6);
|
||||
*(qbuff[i]->sbuf->data + 0) = (unsigned char)psize;
|
||||
*(qbuff[i]->sbuf->data + 1) = (unsigned char)(psize>>8);
|
||||
*(qbuff[i]->sbuf->data + 2) = (unsigned char)(psize>>16);
|
||||
*(qbuff[i]->sbuf->data + 4) = 0x03;
|
||||
memcpy(qbuff[i]->sbuf->data + 5,qin,psize);
|
||||
*(qbuff[i]->sbuf->data + 5 + psize) = 0x00;
|
||||
tok = strtok(NULL,"\n\0");
|
||||
free(qin);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
fdout = open(argv[2],O_TRUNC|O_CREAT|O_WRONLY,S_IRWXU|S_IXGRP|S_IXOTH);
|
||||
|
||||
for(i = 0;i<lines;i++){
|
||||
parse_query(qbuff[i]);
|
||||
tok = skygw_get_canonical(qbuff[i]);
|
||||
write(fdout,tok,strlen(tok));
|
||||
write(fdout,"\n",1);
|
||||
gwbuf_free(qbuff[i]);
|
||||
for(i = 0;i<bsz;i++){
|
||||
if(qbuff[i]){
|
||||
parse_query(qbuff[i]);
|
||||
tok = skygw_get_canonical(qbuff[i]);
|
||||
write(fdout,tok,strlen(tok));
|
||||
write(fdout,"\n",1);
|
||||
gwbuf_free(qbuff[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
free(qbuff);
|
||||
free(buffer);
|
||||
close(fdin);
|
||||
close(fdout);
|
||||
|
||||
|
@ -50,6 +50,10 @@ OBJ=$(SRCS:.c=.o)
|
||||
LIBS=$(UTILSPATH)/skygw_utils.o -lssl -llog_manager
|
||||
MODULES= libtestfilter.so libqlafilter.so libregexfilter.so libtopfilter.so libtee.so
|
||||
|
||||
ifndef BUILD_RABBITMQ
|
||||
BUILD_RABBITMQ=Y
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_RABBITMQ),Y)
|
||||
SRCS += $(MQSRCS)
|
||||
MODULES += libmqfilter.so
|
||||
|
@ -980,6 +980,14 @@ routeQuery(FILTER *instance, void *session, GWBUF *queue)
|
||||
goto send_downstream;
|
||||
}
|
||||
}
|
||||
|
||||
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){
|
||||
|
||||
@ -1131,9 +1139,6 @@ routeQuery(FILTER *instance, void *session, GWBUF *queue)
|
||||
obj_ok = true;
|
||||
}
|
||||
|
||||
if(my_instance->trgtype == TRG_ALL){
|
||||
skygw_log_write_flush(LOGFILE_TRACE,"Trigger is TRG_ALL");
|
||||
}
|
||||
|
||||
validate_triggers:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user