From 06c2d201e01182ed183230f9529f494f4fee9414 Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Wed, 14 Jan 2015 19:08:24 +0200 Subject: [PATCH 01/20] remove makefiles and other garbage --- Makefile | 79 - VERSION | 2 +- build_gateway.inc | 68 - client/Makefile | 83 - debian/changelog | 10 - debian/compat | 1 - debian/control | 15 - debian/install | 3 - debian/postinst | 4 - debian/rules | 11 - doxygate | 1520 ----------------- etc/init.d/maxscale | 157 -- etc/ubuntu/init.d/maxscale | 145 -- etc/ubuntu/init.d/maxscale.in | 0 log_manager/makefile | 72 - log_manager/test/makefile | 85 - makefile.inc | 53 - maxscale.conf | 2 - maxscale.spec | 66 - query_classifier/makefile | 79 - .../test/canonical_tests/Makefile | 62 - .../test/canonical_tests/expected.sql | 0 .../test/canonical_tests/input.sql | 0 query_classifier/test/makefile | 83 - rabbitmq_consumer/Makefile | 15 - rabbitmq_consumer/inih/LICENSE.txt | 0 rabbitmq_consumer/inih/README.txt | 0 rabbitmq_consumer/inih/cpp/INIReader.cpp | 0 rabbitmq_consumer/inih/cpp/INIReader.h | 0 rabbitmq_consumer/inih/cpp/INIReaderTest.cpp | 0 rabbitmq_consumer/inih/examples/config.def | 0 rabbitmq_consumer/inih/examples/ini_dump.c | 0 rabbitmq_consumer/inih/examples/ini_example.c | 0 rabbitmq_consumer/inih/examples/ini_xmacros.c | 0 rabbitmq_consumer/inih/examples/test.ini | 0 rabbitmq_consumer/inih/extra/Makefile.static | 19 - rabbitmq_consumer/inih/ini.c | 0 rabbitmq_consumer/inih/ini.h | 0 rabbitmq_consumer/inih/tests/bad_comment.ini | 0 rabbitmq_consumer/inih/tests/bad_multi.ini | 0 rabbitmq_consumer/inih/tests/bad_section.ini | 0 .../inih/tests/baseline_multi.txt | 0 .../inih/tests/baseline_single.txt | 0 rabbitmq_consumer/inih/tests/bom.ini | 0 rabbitmq_consumer/inih/tests/multi_line.ini | 0 rabbitmq_consumer/inih/tests/normal.ini | 0 rabbitmq_consumer/inih/tests/unittest.c | 0 rabbitmq_consumer/inih/tests/user_error.ini | 0 server/Makefile | 80 - server/core/Makefile | 132 -- server/core/test/makefile | 121 -- server/inih/LICENSE.txt | 0 server/inih/README.txt | 0 server/inih/cpp/INIReader.cpp | 0 server/inih/cpp/INIReader.h | 0 server/inih/cpp/INIReaderTest.cpp | 0 server/inih/examples/config.def | 0 server/inih/examples/ini_dump.c | 0 server/inih/examples/ini_example.c | 0 server/inih/examples/ini_xmacros.c | 0 server/inih/examples/test.ini | 0 server/inih/extra/Makefile.static | 19 - server/inih/ini.c | 0 server/inih/ini.h | 0 server/inih/tests/bad_comment.ini | 0 server/inih/tests/bad_multi.ini | 0 server/inih/tests/bad_section.ini | 0 server/inih/tests/baseline_multi.txt | 0 server/inih/tests/baseline_single.txt | 0 server/inih/tests/bom.ini | 0 server/inih/tests/multi_line.ini | 0 server/inih/tests/normal.ini | 0 server/inih/tests/unittest.bat | 0 server/inih/tests/unittest.c | 0 server/inih/tests/user_error.ini | 0 server/modules/filter/Makefile | 117 -- server/modules/filter/hint/Makefile | 70 - server/modules/filter/test/Makefile | 80 - .../filter/test/fwfilter/fwtest.cnf.in | 0 .../filter/test/fwfilter/fwtest.expected | 0 .../modules/filter/test/fwfilter/fwtest.input | 0 .../filter/test/fwfilter/fwtest.output | 0 .../filter/test/fwfilter/fwtest2.expected | 0 .../filter/test/fwfilter/fwtest2.input | 0 server/modules/filter/test/harness_ui.c | 0 .../filter/test/hintfilter/hint_testing.cnf | 0 .../test/hintfilter/hint_testing.expected | 0 .../test/regexfilter/regextest.expected | 0 server/modules/monitor/Makefile | 78 - server/modules/protocol/Makefile | 91 - server/modules/routing/Makefile | 109 -- server/modules/routing/binlog/Makefile | 69 - .../modules/routing/readwritesplit/Makefile | 78 - .../routing/readwritesplit/test/makefile | 36 - .../readwritesplit/test/test_hints/Makefile | 53 - server/modules/routing/test/makefile | 41 - server/test/makefile | 74 - test.inc | 47 - test/README | 66 - test/makefile | 65 - utils/makefile | 30 - utils/test/makefile | 30 - 102 files changed, 1 insertion(+), 4119 deletions(-) delete mode 100644 Makefile delete mode 100644 build_gateway.inc delete mode 100644 client/Makefile delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100644 debian/install delete mode 100644 debian/postinst delete mode 100755 debian/rules delete mode 100644 doxygate delete mode 100755 etc/init.d/maxscale delete mode 100755 etc/ubuntu/init.d/maxscale mode change 100644 => 100755 etc/ubuntu/init.d/maxscale.in delete mode 100644 log_manager/makefile delete mode 100644 log_manager/test/makefile delete mode 100644 makefile.inc delete mode 100644 maxscale.conf delete mode 100644 maxscale.spec delete mode 100644 query_classifier/makefile delete mode 100644 query_classifier/test/canonical_tests/Makefile mode change 100755 => 100644 query_classifier/test/canonical_tests/expected.sql mode change 100755 => 100644 query_classifier/test/canonical_tests/input.sql delete mode 100644 query_classifier/test/makefile delete mode 100644 rabbitmq_consumer/Makefile mode change 100755 => 100644 rabbitmq_consumer/inih/LICENSE.txt mode change 100755 => 100644 rabbitmq_consumer/inih/README.txt mode change 100755 => 100644 rabbitmq_consumer/inih/cpp/INIReader.cpp mode change 100755 => 100644 rabbitmq_consumer/inih/cpp/INIReader.h mode change 100755 => 100644 rabbitmq_consumer/inih/cpp/INIReaderTest.cpp mode change 100755 => 100644 rabbitmq_consumer/inih/examples/config.def mode change 100755 => 100644 rabbitmq_consumer/inih/examples/ini_dump.c mode change 100755 => 100644 rabbitmq_consumer/inih/examples/ini_example.c mode change 100755 => 100644 rabbitmq_consumer/inih/examples/ini_xmacros.c mode change 100755 => 100644 rabbitmq_consumer/inih/examples/test.ini delete mode 100755 rabbitmq_consumer/inih/extra/Makefile.static mode change 100755 => 100644 rabbitmq_consumer/inih/ini.c mode change 100755 => 100644 rabbitmq_consumer/inih/ini.h mode change 100755 => 100644 rabbitmq_consumer/inih/tests/bad_comment.ini mode change 100755 => 100644 rabbitmq_consumer/inih/tests/bad_multi.ini mode change 100755 => 100644 rabbitmq_consumer/inih/tests/bad_section.ini mode change 100755 => 100644 rabbitmq_consumer/inih/tests/baseline_multi.txt mode change 100755 => 100644 rabbitmq_consumer/inih/tests/baseline_single.txt mode change 100755 => 100644 rabbitmq_consumer/inih/tests/bom.ini mode change 100755 => 100644 rabbitmq_consumer/inih/tests/multi_line.ini mode change 100755 => 100644 rabbitmq_consumer/inih/tests/normal.ini mode change 100755 => 100644 rabbitmq_consumer/inih/tests/unittest.c mode change 100755 => 100644 rabbitmq_consumer/inih/tests/user_error.ini delete mode 100644 server/Makefile delete mode 100644 server/core/Makefile delete mode 100644 server/core/test/makefile mode change 100755 => 100644 server/inih/LICENSE.txt mode change 100755 => 100644 server/inih/README.txt mode change 100755 => 100644 server/inih/cpp/INIReader.cpp mode change 100755 => 100644 server/inih/cpp/INIReader.h mode change 100755 => 100644 server/inih/cpp/INIReaderTest.cpp mode change 100755 => 100644 server/inih/examples/config.def mode change 100755 => 100644 server/inih/examples/ini_dump.c mode change 100755 => 100644 server/inih/examples/ini_example.c mode change 100755 => 100644 server/inih/examples/ini_xmacros.c mode change 100755 => 100644 server/inih/examples/test.ini delete mode 100755 server/inih/extra/Makefile.static mode change 100755 => 100644 server/inih/ini.c mode change 100755 => 100644 server/inih/ini.h mode change 100755 => 100644 server/inih/tests/bad_comment.ini mode change 100755 => 100644 server/inih/tests/bad_multi.ini mode change 100755 => 100644 server/inih/tests/bad_section.ini mode change 100755 => 100644 server/inih/tests/baseline_multi.txt mode change 100755 => 100644 server/inih/tests/baseline_single.txt mode change 100755 => 100644 server/inih/tests/bom.ini mode change 100755 => 100644 server/inih/tests/multi_line.ini mode change 100755 => 100644 server/inih/tests/normal.ini mode change 100755 => 100644 server/inih/tests/unittest.bat mode change 100755 => 100644 server/inih/tests/unittest.c mode change 100755 => 100644 server/inih/tests/user_error.ini delete mode 100644 server/modules/filter/Makefile delete mode 100644 server/modules/filter/hint/Makefile delete mode 100644 server/modules/filter/test/Makefile mode change 100755 => 100644 server/modules/filter/test/fwfilter/fwtest.cnf.in mode change 100755 => 100644 server/modules/filter/test/fwfilter/fwtest.expected mode change 100755 => 100644 server/modules/filter/test/fwfilter/fwtest.input mode change 100755 => 100644 server/modules/filter/test/fwfilter/fwtest.output mode change 100755 => 100644 server/modules/filter/test/fwfilter/fwtest2.expected mode change 100755 => 100644 server/modules/filter/test/fwfilter/fwtest2.input mode change 100755 => 100644 server/modules/filter/test/harness_ui.c mode change 100755 => 100644 server/modules/filter/test/hintfilter/hint_testing.cnf mode change 100755 => 100644 server/modules/filter/test/hintfilter/hint_testing.expected mode change 100755 => 100644 server/modules/filter/test/regexfilter/regextest.expected delete mode 100644 server/modules/monitor/Makefile delete mode 100644 server/modules/protocol/Makefile delete mode 100644 server/modules/routing/Makefile delete mode 100644 server/modules/routing/binlog/Makefile delete mode 100644 server/modules/routing/readwritesplit/Makefile delete mode 100644 server/modules/routing/readwritesplit/test/makefile delete mode 100644 server/modules/routing/readwritesplit/test/test_hints/Makefile delete mode 100644 server/modules/routing/test/makefile delete mode 100644 server/test/makefile delete mode 100644 test.inc delete mode 100644 test/README delete mode 100644 test/makefile delete mode 100644 utils/makefile delete mode 100644 utils/test/makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index aee79e163..000000000 --- a/Makefile +++ /dev/null @@ -1,79 +0,0 @@ -# This file is distributed as part of the MariaDB Corporation MaxScale. It is free -# software: you can redistribute it and/or modify it under the terms of the -# GNU General Public License as published by the Free Software Foundation, -# version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright MariaDB Corporation Ab 2013 -# -# Revision History -# Date Who Description -# 16/07/13 Mark Riddoch Initial implementation - -include build_gateway.inc - -DEST=$(HOME)/usr/local/skysql - -# -# A special build of MaxScale is done for tests. -# HAVE_SRV carries information whether test MaxScale server -# is built already or not. -# HAVE_SRV == Y when test server is built, -# HAVE_SRV == N when not. -# It prevents unnecessary recompilation and also clean-up -# in the middle of the test. -# -HAVE_SRV := N - -.PHONY: buildtestserver - -all: - (cd log_manager; make) - (cd query_classifier; make) - (cd server; make) - (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: - (cd log_manager; make depend) - (cd query_classifier; make depend) - (cd server; make depend) - (cd client; touch depend.mk; make depend) - -install: - (cd server; make DEST=$(DEST) install) - (cd log_manager; make DEST=$(DEST) install) - (cd query_classifier;touch depend; make DEST=$(DEST) install) - (cd client; make DEST=$(DEST) install) - -cleantests: - $(MAKE) -C test cleantests - -buildtests: - $(MAKE) -C test buildtests - -testall: - $(MAKE) -C test HAVE_SRV=$(HAVE_SRV) testall - -buildtestserver: - $(MAKE) DEBUG=Y DYNLIB=Y DEST=$(ROOT_PATH)/server/test clean depend all install -$(eval HAVE_SRV := Y) - -documentation: - doxygen doxygate - - diff --git a/VERSION b/VERSION index ed69ddf2c..1464c521f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.2-beta +1.0.5 \ No newline at end of file diff --git a/build_gateway.inc b/build_gateway.inc deleted file mode 100644 index 035cf56d8..000000000 --- a/build_gateway.inc +++ /dev/null @@ -1,68 +0,0 @@ -# -# This file includes all dynamically changing build-related -# variables. -# -# Current values are to satisfy MaxScale build process. -# -# Modify to match with your needs. Do not commit any private -# changes to this file! -# -# - -# -# Set debug flags -# -DEBUG := ${MAXSCALE_DEBUG} - -# -# Set build env -# -UNIX := Y - -# -# Set MaxScale branch directory -# -ROOT_PATH := $(HOME)/${MAXSCALE_SOURCE} - -INC_PATH := $(HOME)/usr/include -# -# Set prefix to MySQL Resources -# -MYSQL_ROOT := $(INC_PATH)/mysql - -# -# Set prefix of the path to development headers -# -MYSQL_HEADERS := -I$(INC_PATH) -I$(MYSQL_ROOT)/ -I$(MYSQL_ROOT)/private/ -I$(MYSQL_ROOT)/extra/ - -# -# Set DYNLIB=Y if you want to link MaxScale with dynamic embedded lib -# -DYNLIB := ${MAXSCALE_DYNLIB} - -# -# Set path to Embedded MySQL Server -# -EMBEDDED_LIB := $(HOME)/usr/lib64 -ifdef DYNLIB - EMBEDDED_LIB := $(HOME)/usr/lib64/dynlib -endif -# -# Set path to MySQL errors file -# -ERRMSG := $(HOME)/usr/share/mysql - -# -# Build a binary that produces profile data -# -PROFILE := N - -# -# Build a binary that produces code coverage data -# -GCOV := N - -# Build optional RabbitMQ filter -# Requires librabbitmq-devel -# -BUILD_RABBITMQ := N diff --git a/client/Makefile b/client/Makefile deleted file mode 100644 index e97cc878b..000000000 --- a/client/Makefile +++ /dev/null @@ -1,83 +0,0 @@ -# This file is distributed as part of MaxScale. It is free -# software: you can redistribute it and/or modify it under the terms of the -# GNU General Public License as published by the Free Software Foundation, -# version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright MariaDB Corporation Ab 2014 -# -# Revision History -# Date Who Description -# 13/06/14 Mark Riddoch Initial implementation of MaxScale -# client program -# 18/06/14 Mark Riddoch Addition of conditional for histedit - -include ../build_gateway.inc -include ../makefile.inc - -ifeq ($(wildcard /usr/include/histedit.h), ) -HISTLIB= -HISTFLAG= -else -HISTLIB=-ledit -HISTFLAG=-DHISTORY -endif - -CC=cc - -CFLAGS=-c -Wall -g $(HISTFLAG) -I ../server/include - -SRCS= maxadmin.c - -HDRS= - -OBJ=$(SRCS:.c=.o) - -LIBS=$(HISTLIB) - -all: maxadmin - -cleantests: - $(MAKE) -C test cleantests - -buildtests: - $(MAKE) -C test buildtests - -runtests: - $(MAKE) -C test runtests - -testall: - $(MAKE) -C test testall - -maxadmin: $(OBJ) - $(CC) $(LDFLAGS) $(OBJ) $(LIBS) -o $@ - - -.c.o: - $(CC) $(CFLAGS) $< -o $@ - - -clean: - $(DEL) $(OBJ) maxadmin - $(DEL) *.so - -tags: - ctags $(SRCS) $(HDRS) - -depend: - @$(DEL) depend.mk - cc -M $(CFLAGS) $(SRCS) > depend.mk - -install: maxadmin - @mkdir -p $(DEST)/bin - install -D maxadmin $(DEST)/bin - -include depend.mk diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 846f67a10..000000000 --- a/debian/changelog +++ /dev/null @@ -1,10 +0,0 @@ -maxscale (1.0-beta) UNRELEASED; urgency=low - - * Beta release - - -- Timofey Turenko Fri, 05 Jul 2014 14:00:00 +0200 -maxscale (0.7-1) UNRELEASED; urgency=low - - * Initial release. (Closes: #XXXXXX) - - -- Timofey Turenko Tue, 11 Mar 2014 22:59:35 +0200 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 45a4fb75d..000000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -8 diff --git a/debian/control b/debian/control deleted file mode 100644 index cb85e28ea..000000000 --- a/debian/control +++ /dev/null @@ -1,15 +0,0 @@ -Source: maxscale -Maintainer: Timofey Turenko -Section: misc -Priority: optional -Standards-Version: 3.9.2 -Build-Depends: debhelper (>= 8), gcc, g++, ncurses-dev, bison, build-essential, libssl-dev, libaio-dev, libmariadbclient-dev, libmariadbd-dev, mariadb-server, cmake, perl, make, libtool, - -Package: maxscale -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: MaxScale - The MariaDB Corporation MaxScale is an intelligent proxy that allows forwarding of - database statements to one or more database servers using complex rules, - a semantic understanding of the database statements and the roles of - the various servers within the backend cluster of databases. diff --git a/debian/install b/debian/install deleted file mode 100644 index 2ac8a182e..000000000 --- a/debian/install +++ /dev/null @@ -1,3 +0,0 @@ -maxscale.conf etc/ld.so.conf.d/ -etc/ubuntu/init.d/maxscale etc/init.d/ -binaries/* /usr/local/skysql/maxscale/ diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index 59b18bb73..000000000 --- a/debian/postinst +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -ln -s /lib64/libaio.so.1 /lib64/libaio.so -/sbin/ldconfig diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 5acfaf7aa..000000000 --- a/debian/rules +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/make -f -%: - $(MAKE) ROOT_PATH=$(shell pwd) HOME="" clean - $(MAKE) ROOT_PATH=$(shell pwd) HOME="" depend - $(MAKE) ROOT_PATH=$(shell pwd) HOME="" - $(MAKE) DEST="$(shell pwd)/binaries" ROOT_PATH=$(shell pwd) HOME="" ERRMSG="/usr/share/mysql/english" EMBEDDED_LIB="$(mysql_config --variable=pkglibdir)" install - dh $@ -override_dh_usrlocal: -override_dh_auto_clean: -override_dh_auto_build: -override_dh_auto_install: diff --git a/doxygate b/doxygate deleted file mode 100644 index 7b7d39f37..000000000 --- a/doxygate +++ /dev/null @@ -1,1520 +0,0 @@ -# Doxyfile 1.6.1 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = MaxScale - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = Documentation - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it parses. -# With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this tag. -# The format is ext=language, where ext is a file extension, and language is one of -# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, -# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat -# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), -# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by -# doxygen. The layout file controls the global structure of the generated output files -# in an output format independent way. The create the layout file that represents -# doxygen's defaults, run doxygen with the -l option. You can optionally specify a -# file name after the option, if omitted DoxygenLayout.xml will be used as the name -# of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = README server/core server/modules server/include \ - log_manager query_classifier utils - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = *.c *.h - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# If the HTML_TIMESTAMP tag is set to YES then the generated HTML -# documentation will contain the timesstamp. - -HTML_TIMESTAMP = NO - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER -# are set, an additional index file will be generated that can be used as input for -# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated -# HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. -# For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's -# filter section matches. -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = YES - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) -# there is already a search function so this one should typically -# be disabled. - -SEARCHENGINE = YES - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = *.h - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/etc/init.d/maxscale b/etc/init.d/maxscale deleted file mode 100755 index 40f368326..000000000 --- a/etc/init.d/maxscale +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/sh -# -# maxscale: The MariaDB Corporation MaxScale database proxy -# -# description: MaxScale provides database specific proxy functionality -# -# processname: maxscale -# -### BEGIN INIT INFO -# Provides: maxscale -# Required-Start: $syslog $local_fs -# Required-Stop: $syslog $local_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: The maxscale database proxy -# Description: MaxScale is a database proxy server that can be used to front end -# database clusters offering different routing, filtering and protocol choices -### END INIT INFO - -############################################# -# MaxScale HOME, PIDFILE, LIB -############################################# - -export MAXSCALE_HOME=/usr/local/skysql/maxscale -export MAXSCALE_PIDFILE=$MAXSCALE_HOME/log/maxscale.pid -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MAXSCALE_HOME/lib - -############################### -# LSB Exit codes (non-Status) -############################### -_RETVAL_GENERIC=1 -_RETVAL_NOT_INSTALLED=5 -_RETVAL_NOT_RUNNING=7 - -############################### -# LSB Status action Exit codes -############################### -_RETVAL_STATUS_OK=0 -_RETVAL_STATUS_NOT_RUNNING=3 - -# Sanity checks. -[ -x $MAXSCALE_HOME/bin/maxscale ] || exit $_RETVAL_NOT_INSTALLED - -# Source function library. -. /etc/rc.d/init.d/functions - -# we can rearrange this easily -processname=maxscale -servicename=maxscale - -RETVAL=0 - -start() { - echo -n $"Starting MaxScale: " - my_check=`status -p $MAXSCALE_PIDFILE $MAXSCALE_HOME/bin/maxscale` - CHECK_RET=$? - [ $CHECK_RET -eq 0 ] && echo -n " found $my_check" && success && CHECK_RET=0 - - daemon --pidfile $MAXSCALE_PIDFILE $MAXSCALE_HOME/bin/maxscale >& /dev/null - - RETVAL=$? - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename - - if [ $CHECK_RET -ne 0 ]; then - sleep 2 - my_check=`status -p $MAXSCALE_PIDFILE $MAXSCALE_HOME/bin/maxscale` - CHECK_RET=$? - [ $CHECK_RET -eq 0 ] && echo -n $my_check && success || failure - fi - - # Return rigth code - if [ $RETVAL -ne 0 ]; then - failure - RETVAL=$_RETVAL_NOT_RUNNING - fi - - echo - - return $RETVAL -} - -stop() { - echo -n $"Stopping MaxScale: " - killproc -p $MAXSCALE_PIDFILE -TERM - - RETVAL=$? - - echo - - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$servicename - - # Return rigth code - if [ $RETVAL -ne 0 ]; then - RETVAL=$_RETVAL_NOT_RUNNING - fi - - return $RETVAL -} - -reload() { - echo -n $"Reloading MaxScale: " - - killproc -p $MAXSCALE_PIDFILE $MAXSCALE_HOME/bin/maxscale -HUP - RETVAL=$? - echo -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - # return 0 on success - # return 3 on any error - - echo -n $"Checking MaxScale status: " - status -p $MAXSCALE_PIDFILE 'MaxScale' - RETVAL=$? - - if [ $RETVAL -ne 0 ]; then - echo -ne "\033[1A" - [ $RETVAL -eq 1 ] && warning || failure - echo -ne "\033[1B" - - RETVAL=$_RETVAL_STATUS_NOT_RUNNING - else - echo -ne "\033[1A" - success - echo -ne "\033[1B" - RETVAL=$_RETVAL_STATUS_OK - fi - - exit $RETVAL - ;; - restart) - stop - start - ;; - condrestart) - if [ -f /var/lock/subsys/$servicename ]; then - stop - start - fi - ;; - reload) - reload - RETVAL=$? - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" - ;; -esac -exit $RETVAL diff --git a/etc/ubuntu/init.d/maxscale b/etc/ubuntu/init.d/maxscale deleted file mode 100755 index 82bc05632..000000000 --- a/etc/ubuntu/init.d/maxscale +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/sh -# -# maxscale: The MariaDB Corporation MaxScale database proxy -# -# description: MaxScale provides database specific proxy functionality -# -# processname: maxscale -# -### BEGIN INIT INFO -# Provides: maxscale -# Required-Start: $syslog $local_fs -# Required-Stop: $syslog $local_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: The maxscale database proxy -# Description: MaxScale is a database proxy server that can be used to front end -# database clusters offering different routing, filtering and protocol choices -### END INIT INFO - -############################################# -# MaxScale HOME, PIDFILE, LIB -############################################# - -export MAXSCALE_HOME=/usr/local/skysql/maxscale -export MAXSCALE_PIDFILE=$MAXSCALE_HOME/log/maxscale.pid -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MAXSCALE_HOME/lib - -############################### -# LSB Exit codes (non-Status) -############################### -_RETVAL_GENERIC=1 -_RETVAL_NOT_INSTALLED=5 -_RETVAL_NOT_RUNNING=7 - -############################### -# LSB Status action Exit codes -############################### -_RETVAL_STATUS_OK=0 -_RETVAL_STATUS_NOT_RUNNING=3 - -# Sanity checks. -[ -x $MAXSCALE_HOME/bin/maxscale ] || exit $_RETVAL_NOT_INSTALLED - -################################# -# stop/start/status related vars -################################# -NAME=maxscale -DAEMON=$MAXSCALE_HOME/bin/maxscale - -# Source function library. -. /lib/lsb/init-functions - -# we can rearrange this easily -processname=maxscale -servicename=maxscale - -RETVAL=0 - -start() { - log_daemon_msg "Starting MaxScale" - start_daemon -p $MAXSCALE_PIDFILE $DAEMON 2> /dev/null - - sleep 2 - - status_of_proc -p $MAXSCALE_PIDFILE $DAEMON $NAME - - log_end_msg $? -} - -stop() { - log_daemon_msg "Stopping MaxScale" - killproc -p $PIDFILE $DAEMON 2>&1 /dev/null - - maxscale_wait_stop - - log_end_msg $? -} - -reload() { - log_daemon_msg "Reloading MaxScale" - - killproc -p $MAXSCALE_PIDFILE $DAEMON 1 - - log_end_msg $? -} - -maxscale_wait_stop() { - PIDTMP=$(pidofproc -p $MAXSCALE_PIDFILE $MAXSCALE_HOME/bin/maxscale) - kill -TERM "${PIDTMP:-}" 2> /dev/null; - if [ -n "${PIDTMP:-}" ] && kill -0 "${PIDTMP:-}" 2> /dev/null; then - local i=0 - while kill -0 "${PIDTMP:-}" 2> /dev/null; do - if [ $i = '60' ]; then - break - STATUS=2 - fi - [ "$VERBOSE" != no ] && log_progress_msg "." - sleep 1 - i=$(($i+1)) - done - return $STATUS - else - return $STATUS - fi -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - # return 0 on success - # return 3 on any error - - log_daemon_msg "Checking MaxScale" - status_of_proc -p $MAXSCALE_PIDFILE $DAEMON $NAME - RETVAL=$? - - if [ $RETVAL -ne 0 ]; then - [ $RETVAL -eq 1 ] - - RETVAL=$_RETVAL_STATUS_NOT_RUNNING - else - RETVAL=$_RETVAL_STATUS_OK - fi - - log_end_msg $RETVAL - ;; - restart) - stop - start - ;; - reload) - reload - RETVAL=$? - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|reload}" - ;; -esac -exit $RETVAL diff --git a/etc/ubuntu/init.d/maxscale.in b/etc/ubuntu/init.d/maxscale.in old mode 100644 new mode 100755 diff --git a/log_manager/makefile b/log_manager/makefile deleted file mode 100644 index 7f35c13f6..000000000 --- a/log_manager/makefile +++ /dev/null @@ -1,72 +0,0 @@ -include ../build_gateway.inc -include ../makefile.inc - -CC = gcc -CPP = g++ - -SRCS := log_manager.cc -UTILS_PATH := $(ROOT_PATH)/utils -CUR_DIR := $(shell pwd) - -ifeq ($(ADD_DEBUG_TAGS),Y) -CFLAGS += -DSS_LOG_DEBUG -endif - - -makeall: clean all - -clean: - $(MAKE) -C $(UTILS_PATH) clean - - $(DEL) *.o - - $(DEL) *.so - - $(DEL) *.so.1.0.1 - - $(DEL) *~ - - $(DEL) depend - -all: utils lib - - -utils: - $(MAKE) -C $(UTILS_PATH) clean all - -lib: libcomp liblink - -libcomp: - $(CPP) -c $(CFLAGS) \ - $(MYSQL_HEADERS) \ - -I$(UTILS_PATH) -I./ \ - -fPIC ./log_manager.cc -o log_manager.o $(LDLIBS) - -liblink: - $(CPP) -shared \ - -Wl,-soname,liblog_manager.so \ - -o liblog_manager.so.1.0.1 log_manager.o \ - $(LDLIBS) $(CPP_LDLIBS) - $(DEL) ./liblog_manager.so - $(LINK) ./liblog_manager.so.1.0.1 ./liblog_manager.so - -install: liblink - install liblog_manager.so.1.0.1 liblog_manager.so $(DEST)/lib - -depend: - @$(DEL) depend - $(CPP) -M $(CFLAGS) \ - $(MYSQL_HEADERS) \ - -I$(UTILS_PATH) -I./ \ - $(SRCS) > depend - -cleantests: - $(MAKE) -C test cleantests - -buildtests: - $(MAKE) -C test DEBUG=Y buildtests - -runtests: - $(MAKE) -C test runtests - -testall: - $(MAKE) -C test testall - - - -include depend diff --git a/log_manager/test/makefile b/log_manager/test/makefile deleted file mode 100644 index f3e0dc362..000000000 --- a/log_manager/test/makefile +++ /dev/null @@ -1,85 +0,0 @@ -# cleantests - clean local and subdirectories' tests -# buildtests - build all local and subdirectories' tests -# runtests - run all local tests -# testall - clean, build and run local and subdirectories' tests - -include ../../build_gateway.inc -include ../../makefile.inc -include ../../test.inc - -CC = gcc -CPP = g++ - -TESTPATH := $(shell pwd) -TESTLOG := $(TESTPATH)/testlog.log -LOG_MANAGER_PATH:= $(ROOT_PATH)/log_manager -TESTAPP := $(TESTPATH)/testlog -UTILS_PATH := $(ROOT_PATH)/utils - -# Use two threads by default -ifndef NTHR - NTHR=2 -endif - -testall: - $(MAKE) cleantests - $(MAKE) DEBUG=Y buildtests - $(MAKE) runtests - -cleantests: - - $(DEL) *.o - - $(DEL) *.log - - $(DEL) testlog - - $(DEL) testorder - - $(DEL) *~ - -buildtests: - $(MAKE) -C $(LOG_MANAGER_PATH) ADD_DEBUG_TAGS=Y - $(CC) $(CFLAGS) \ - -L$(LOG_MANAGER_PATH) \ - -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(LOG_MANAGER_PATH)/ \ - -o testlog \ - -I$(MARIADB_SRC_PATH)/include \ - -I$(LOG_MANAGER_PATH) -I$(UTILS_PATH) testlog.c \ - -lstdc++ -llog_manager $(LDLIBS) \ - $(UTILS_PATH)/skygw_utils.o - $(CC) $(CFLAGS) \ - -L$(LOG_MANAGER_PATH) \ - -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(LOG_MANAGER_PATH)/ \ - -o testorder \ - -I$(MARIADB_SRC_PATH)/include \ - -I$(LOG_MANAGER_PATH) -I$(UTILS_PATH) testorder.c \ - -lstdc++ -llog_manager $(LDLIBS) \ - $(UTILS_PATH)/skygw_utils.o - - - - -runtests: - @echo "" > $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test Log Manager" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - @echo "Use 1 thread" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - @-$(LAUNCH_DEBUGGER) $(TESTAPP) "-t 1" 2>>$(TESTLOG) - @echo "" >> $(TESTLOG) - @echo "Use 8 threads" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - @-$(LAUNCH_DEBUGGER) $(TESTAPP) "-t 8" 2>>$(TESTLOG) - @echo "" >> $(TESTLOG) - @echo "Use 16 threads" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - @-$(LAUNCH_DEBUGGER) $(TESTAPP) "-t 16" 2>>$(TESTLOG) - @echo "" >> $(TEST_MAXSCALE_LOG) - @echo "Test Message Order" >> $(TEST_MAXSCALE_LOG) - @echo "" >> $(TEST_MAXSCALE_LOG) - ./logorder.sh 500 0 500 $(TEST_MAXSCALE_LOG) - @echo "Log Manager PASSED" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - -# @cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG) diff --git a/makefile.inc b/makefile.inc deleted file mode 100644 index 0d63b5192..000000000 --- a/makefile.inc +++ /dev/null @@ -1,53 +0,0 @@ -# -# This file is static. It handles the dynamic content of build.inc, -# for example, by setting compiler flags etc. - -# Changes to environment, such as building directories etc. are made to -# build_gateway.inc. -# A template file build_gateway_l2x64.inc is stored in directory 'config'. -# Template can't be used as such, but hopefully only little modifications are -# needed, such as setting build directory etc. -# - -#ifdef UNIX - DEL := rm -fr - LINK := ln -s - COPY := cp - NOHUP := nohup -#endif - -LIB := libmysqld.a - -ifdef DYNLIB - LIB := libmysqld.so.18 -endif - -# -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC - -CFLAGS := $(CFLAGS) -Wall -LDLIBS := $(LDLIBS) -pthread -lm -LDMYSQL := -lmysqld -CPP_LDLIBS := -lstdc++ - -# -# Compiler flags, httpd arguments and debugger options -# -ifdef DEBUG -DEBUG_FLAGS := -DSS_DEBUG -pipe -Wformat -Werror=format-security -fstack-protector --param=ssp-buffer-size=4 -fPIC - CFLAGS := $(CFLAGS) -ggdb -O0 -pthread $(DEBUG_FLAGS) -endif - - -ifdef PROF - CFLAGS := $(CFLAGS) -DSS_PROF -endif - -ifeq "$(PROFILE)" "Y" - CFLAGS += -pg - LDFLAGS += -pg -endif - -ifeq "$(GCOV)" "Y" - CFLAGS += -fprofile-arcs -ftest-coverage - LIBS += -lgcov -endif diff --git a/maxscale.conf b/maxscale.conf deleted file mode 100644 index ad7652647..000000000 --- a/maxscale.conf +++ /dev/null @@ -1,2 +0,0 @@ -/usr/local/skysql/maxscale/modules -/usr/local/skysql/maxscale/lib diff --git a/maxscale.spec b/maxscale.spec deleted file mode 100644 index 4519d77ad..000000000 --- a/maxscale.spec +++ /dev/null @@ -1,66 +0,0 @@ -%define _topdir %(echo $PWD)/ -%define name maxscale -%define release beta -%define version 1.0 -%define install_path /usr/local/skysql/maxscale/ - -BuildRoot: %{buildroot} -Summary: maxscale -License: GPL -Name: %{name} -Version: %{version} -Release: %{release} -Source: %{name}-%{version}-%{release}.tar.gz -Prefix: / -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 librabbitmq-devel -%else -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 -%if 0%{?rhel} == 7 -BuildRequires: mariadb-devel mariadb-embedded-devel libedit-devel -%else -BuildRequires: MariaDB-devel MariaDB-server -%endif -%endif - -%description -MaxScale - -%prep - -%setup -q - -%build -#ln -s /lib64/libaio.so.1 /lib64/libaio.so -make ROOT_PATH=`pwd` HOME="" $DEBUG_FLAG1 $DEBUG_FLAG2 clean -make ROOT_PATH=`pwd` HOME="" $DEBUG_FLAG1 $DEBUG_FLAG2 depend -make ROOT_PATH=`pwd` HOME="" $DEBUG_FLAG1 $DEBUG_FLAG2 -make DEST=`pwd`/binaries ROOT_PATH=`pwd` HOME="" ERRMSG="/usr/share/mysql/english" $DEBUG_FLAG1 $DEBUG_FLAG2 install - -%post -ln -s /lib64/libaio.so.1 /lib64/libaio.so -/sbin/ldconfig - -%install -mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d/ -mkdir -p $RPM_BUILD_ROOT/etc/init.d/ -mkdir -p $RPM_BUILD_ROOT%{install_path} -cp -r binaries/* $RPM_BUILD_ROOT%{install_path} -cp maxscale.conf $RPM_BUILD_ROOT/etc/ld.so.conf.d/ -cp etc/init.d/maxscale $RPM_BUILD_ROOT/etc/init.d/ - -%clean - -%files -%defattr(-,root,root) -%{install_path} -/etc/ld.so.conf.d/maxscale.conf -/etc/init.d/maxscale - -%changelog diff --git a/query_classifier/makefile b/query_classifier/makefile deleted file mode 100644 index 4f8cf34c8..000000000 --- a/query_classifier/makefile +++ /dev/null @@ -1,79 +0,0 @@ -include ../build_gateway.inc -include ../makefile.inc - -CC = gcc -CPP = g++ - -SRCS := query_classifier.cc -UTILS_PATH := $(ROOT_PATH)/utils -QUERY_CLASSIFIER_PATH := $(ROOT_PATH)/query_classifier -LOG_MANAGER_PATH := $(ROOT_PATH)/log_manager -SERVER_INC_PATH := $(ROOT_PATH)/server/include -MODULE_INC_PATH := $(ROOT_PATH)/server/modules/include - -makeall: clean all - -clean: - $(MAKE) -C $(UTILS_PATH) clean - - $(DEL) query_classifier.o - - $(DEL) libquery_classifier.so - - $(DEL) libquery_classifier.so.1.0.1 - - $(DEL) *~ - - $(DEL) depend - -all: utils lib - -cleantests: - $(MAKE) -C test cleantests - -buildtests: - $(MAKE) -C test DEBUG=Y DYNLIB=Y buildtests - -runtests: - $(MAKE) -C test runtests - -testall: - $(MAKE) -C test testall - -utils: - $(MAKE) -C $(UTILS_PATH) clean all - -lib: libcomp liblink - -libcomp: - $(CPP) -c $(CFLAGS) \ - $(MYSQL_HEADERS) \ - -I$(LOG_MANAGER_PATH) \ - -I$(SERVER_INC_PATH) \ - -I$(MODULE_INC_PATH) \ - -I$(UTILS_PATH) \ - -I./ \ - -fPIC ./query_classifier.cc -o query_classifier.o - -liblink: - $(CPP) -shared \ - -L$(EMBEDDED_LIB) \ - -Wl,-soname,libquery_classifier.so \ - -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(EMBEDDED_LIB) \ - -o libquery_classifier.so.1.0.1 ./query_classifier.o \ - $(LDLIBS) $(LDMYSQL) $(CPP_LDLIBS) - $(DEL) ./libquery_classifier.so - $(LINK) ./libquery_classifier.so.1.0.1 ./libquery_classifier.so - - -install: liblink - install ./libquery_classifier.so.1.0.1 ./libquery_classifier.so $(DEST)/lib - -depend: - @$(DEL) depend - $(CPP) -M $(CFLAGS) \ - $(MYSQL_HEADERS) \ - -I$(LOG_MANAGER_PATH) \ - -I$(SERVER_INC_PATH) \ - -I$(MODULE_INC_PATH) \ - -I$(UTILS_PATH) \ - -I./ \ - $(SRCS) > depend - -include depend diff --git a/query_classifier/test/canonical_tests/Makefile b/query_classifier/test/canonical_tests/Makefile deleted file mode 100644 index c5fe44fe9..000000000 --- a/query_classifier/test/canonical_tests/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# cleantests - clean local and subdirectories' tests -# buildtests - build all local and subdirectories' tests -# runtests - run all local tests -# testall - clean, build and run local and subdirectories' tests - -include ../../../build_gateway.inc -include ../../../makefile.inc -include ../../../test.inc - -CC = gcc -CPP = g++ - -TESTPATH := $(shell pwd) -TESTLOG := $(TESTPATH)/testqclass.log -QUERY_CLASSIFIER_PATH := $(ROOT_PATH)/query_classifier -LOG_MANAGER_PATH := $(ROOT_PATH)/log_manager -UTILS_PATH := $(ROOT_PATH)/utils -CORE_PATH := $(ROOT_PATH)/server/core -TESTAPP = $(TESTPATH)/canonizer - -LDFLAGS=-L$(QUERY_CLASSIFIER_PATH) \ - -L$(LOG_MANAGER_PATH) \ - -L$(EMBEDDED_LIB) \ - -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(EMBEDDED_LIB) \ - -Wl,-rpath,$(LOG_MANAGER_PATH) \ - -Wl,-rpath,$(QUERY_CLASSIFIER_PATH) - -LIBS=-lstdc++ -lpthread -lquery_classifier -lz -ldl -lssl -laio -lcrypt -lcrypto -lrt -lm \ - -llog_manager $(UTILS_PATH)/skygw_utils.o $(CORE_PATH)/buffer.o $(CORE_PATH)/atomic.o $(CORE_PATH)/spinlock.o $(CORE_PATH)/hint.o - -CFLAGS=-g $(MYSQL_HEADERS) \ - -I$(QUERY_CLASSIFIER_PATH) \ - $(MYSQL_HEADERS) \ - -I$(ROOT_PATH)/server/include \ - -I$(UTILS_PATH) - - -testall: - $(MAKE) cleantests - $(MAKE) buildtests - $(MAKE) runtests - -cleantests: - - $(DEL) *.o - - $(DEL) *~ - - $(DEL) canonizer - - $(DEL) aria_log* - - $(DEL) ib* - -buildtests: $(OBJS) - cp $(ERRMSG)/errmsg.sys . - $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) canonizer.c -o $(TESTAPP) $(LDLIBS) $(LDMYSQL) - -runtests: - @echo "" > $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Canonical Query Tests" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - ./canontest.sh $(TESTLOG) input.sql output.sql expected.sql diff --git a/query_classifier/test/canonical_tests/expected.sql b/query_classifier/test/canonical_tests/expected.sql old mode 100755 new mode 100644 diff --git a/query_classifier/test/canonical_tests/input.sql b/query_classifier/test/canonical_tests/input.sql old mode 100755 new mode 100644 diff --git a/query_classifier/test/makefile b/query_classifier/test/makefile deleted file mode 100644 index c42a795e3..000000000 --- a/query_classifier/test/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# cleantests - clean local and subdirectories' tests -# buildtests - build all local and subdirectories' tests -# runtests - run all local tests -# testall - clean, build and run local and subdirectories' tests - -include ../../build_gateway.inc -include ../../makefile.inc -include ../../test.inc - -CC = gcc -CPP = g++ - -TESTPATH := $(shell pwd) -TESTLOG := $(TESTPATH)/testqclass.log -QUERY_CLASSIFIER_PATH := $(ROOT_PATH)/query_classifier -LOG_MANAGER_PATH := $(ROOT_PATH)/log_manager -UTILS_PATH := $(ROOT_PATH)/utils -TESTAPP = $(TESTPATH)/testmain - -testall:buildtests - $(MAKE) -C canonical_tests testall -testalllaters: - $(MAKE) cleantests - $(MAKE) DEBUG=Y DYNLIB=Y buildtests - $(MAKE) runtests - - -cleantests: - - $(DEL) testmain.o - - $(DEL) testmain - - $(DEL) data - - $(DEL) *~ - -buildtests: - @echo "" - @echo "*********************************************************" - @echo "Query classifier test disabled for now. vraa 4.7.2014" - @echo "*********************************************************" - @echo "" - -buildtestslaters: - $(CC) $(CFLAGS) \ - -L$(QUERY_CLASSIFIER_PATH) \ - -L$(LOG_MANAGER_PATH) \ - -L$(EMBEDDED_LIB) \ - -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(EMBEDDED_LIB) \ - -Wl,-rpath,$(LOG_MANAGER_PATH) \ - -Wl,-rpath,$(QUERY_CLASSIFIER_PATH) \ - -o testmain -DSS_DEBUG \ - $(MYSQL_HEADERS) \ - -I$(QUERY_CLASSIFIER_PATH) \ - -I./ \ - -I$(UTILS_PATH) \ - testmain.c \ - $(UTILS_PATH)/skygw_utils.o \ - -lquery_classifier -lz -ldl -lssl -laio -lcrypt -lrt \ - -llog_manager \ - $(LDLIBS) $(LDMYSQL) - -runtests: - @echo "" > $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test Query Classifier" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo "Query Classifier NOT TESTED due deprecated tests. vraa 4.7.2014" >> $(TESTLOG) - @cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG) - - -runtestslaters: - @echo "" > $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test Query Classifier" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @ -$(LAUNCH_DEBUGGER) $(TESTAPP) $(BACKGR) 2>> $(TESTLOG) -ifeq ($?, 0) - @echo "Query Classifier PASSED" >> $(TESTLOG) -else - @echo "Query Classifier FAILED" >> $(TESTLOG) -endif - @cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG) diff --git a/rabbitmq_consumer/Makefile b/rabbitmq_consumer/Makefile deleted file mode 100644 index 456727ef8..000000000 --- a/rabbitmq_consumer/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -include buildconfig.inc - -CC=gcc -CFLAGS=-c -Wall -g -Iinih $(INCLUDE_DIRS) -LDFLAGS= $(LIBRARY_DIRS) -lrabbitmq -lmysqlclient -SRCS= inih/ini.c consumer.c -OBJ=$(SRCS:.c=.o) -all:$(OBJ) - $(CC) $(LDFLAGS) $(OBJ) -o consumer `mysql_config --cflags --libs` -%.o:%.c - $(CC) $(CFLAGS) $< -o $@ - -clean: - -rm *.o - -rm *~ diff --git a/rabbitmq_consumer/inih/LICENSE.txt b/rabbitmq_consumer/inih/LICENSE.txt old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/README.txt b/rabbitmq_consumer/inih/README.txt old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/cpp/INIReader.cpp b/rabbitmq_consumer/inih/cpp/INIReader.cpp old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/cpp/INIReader.h b/rabbitmq_consumer/inih/cpp/INIReader.h old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/cpp/INIReaderTest.cpp b/rabbitmq_consumer/inih/cpp/INIReaderTest.cpp old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/examples/config.def b/rabbitmq_consumer/inih/examples/config.def old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/examples/ini_dump.c b/rabbitmq_consumer/inih/examples/ini_dump.c old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/examples/ini_example.c b/rabbitmq_consumer/inih/examples/ini_example.c old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/examples/ini_xmacros.c b/rabbitmq_consumer/inih/examples/ini_xmacros.c old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/examples/test.ini b/rabbitmq_consumer/inih/examples/test.ini old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/extra/Makefile.static b/rabbitmq_consumer/inih/extra/Makefile.static deleted file mode 100755 index 0d6519e38..000000000 --- a/rabbitmq_consumer/inih/extra/Makefile.static +++ /dev/null @@ -1,19 +0,0 @@ -# Simple makefile to build inih as a static library using g++ - -SRC = ../ini.c -OBJ = $(SRC:.c=.o) -OUT = libinih.a -INCLUDES = -I.. -CCFLAGS = -g -O2 -CC = g++ - -default: $(OUT) - -.c.o: - $(CC) $(INCLUDES) $(CCFLAGS) $(EXTRACCFLAGS) -c $< -o $@ - -$(OUT): $(OBJ) - ar rcs $(OUT) $(OBJ) $(EXTRAARFLAGS) - -clean: - rm -f $(OBJ) $(OUT) diff --git a/rabbitmq_consumer/inih/ini.c b/rabbitmq_consumer/inih/ini.c old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/ini.h b/rabbitmq_consumer/inih/ini.h old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/tests/bad_comment.ini b/rabbitmq_consumer/inih/tests/bad_comment.ini old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/tests/bad_multi.ini b/rabbitmq_consumer/inih/tests/bad_multi.ini old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/tests/bad_section.ini b/rabbitmq_consumer/inih/tests/bad_section.ini old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/tests/baseline_multi.txt b/rabbitmq_consumer/inih/tests/baseline_multi.txt old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/tests/baseline_single.txt b/rabbitmq_consumer/inih/tests/baseline_single.txt old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/tests/bom.ini b/rabbitmq_consumer/inih/tests/bom.ini old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/tests/multi_line.ini b/rabbitmq_consumer/inih/tests/multi_line.ini old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/tests/normal.ini b/rabbitmq_consumer/inih/tests/normal.ini old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/tests/unittest.c b/rabbitmq_consumer/inih/tests/unittest.c old mode 100755 new mode 100644 diff --git a/rabbitmq_consumer/inih/tests/user_error.ini b/rabbitmq_consumer/inih/tests/user_error.ini old mode 100755 new mode 100644 diff --git a/server/Makefile b/server/Makefile deleted file mode 100644 index 93a181a07..000000000 --- a/server/Makefile +++ /dev/null @@ -1,80 +0,0 @@ -# This file is distributed as part of the MariaDB Corporation MaxScale. It is free -# software: you can redistribute it and/or modify it under the terms of the -# GNU General Public License as published by the Free Software Foundation, -# version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright MariaDB Corporation Ab 2013 -# -# Revision History -# Date Who Description -# 14/06/13 Mark Riddoch Initial implementation -# 17/06/13 Mark Riddoch Addition of documentation and depend -# targets -# 18/06/13 Mark Riddoch Addition of install target -# 21/06/13 Mark Riddoch Addition of inih -# 08/07/13 Mark Riddoch Addition of monitor modules -# 16/07/13 Mark Riddoch Renamed things to match the new naming - -include ../build_gateway.inc -include ../makefile.inc - -DEST=$(HOME)/usr/local/skysql - -all: - (cd inih/extra ; make -f Makefile.static) - (cd core ; touch depend.mk ; make) - (cd modules/routing; touch depend.mk ;make) - (cd modules/routing/readwritesplit; touch depend.mk ;make) - (cd modules/protocol; touch depend.mk ;make) - (cd modules/monitor; touch depend.mk ;make) - (cd modules/filter; touch depend.mk ;make) - -cleantests: - $(MAKE) -C test cleantests - -buildtests: - $(MAKE) -C test HAVE_SRV=$(HAVE_SRV) buildtests - -testall: - $(MAKE) -C test HAVE_SRV=$(HAVE_SRV) testall - -clean: - (cd Documentation; $(DEL) html) - (cd core; touch depend.mk ; make clean) - (cd modules/routing; touch depend.mk ; make clean) - (cd modules/protocol; touch depend.mk ; make clean) - (cd modules/monitor; touch depend.mk ; make clean) - (cd modules/filter; touch depend.mk ; make clean) - -depend: - (cd core; touch depend.mk ; make depend) - (cd modules/routing; touch depend.mk ; make depend) - (cd modules/protocol; touch depend.mk ; make depend) - (cd modules/monitor; touch depend.mk ; make depend) - (cd modules/filter; touch depend.mk ; make depend) - -install: - @mkdir -p $(DEST) - @mkdir -p $(DEST) - @mkdir -p $(DEST)/modules - @mkdir -p $(DEST)/log - @mkdir -p $(DEST)/etc - @mkdir -p $(DEST)/mysql - @mkdir -p $(DEST)/lib - @mkdir -p $(DEST)/Documentation - install -b MaxScale_template.cnf $(DEST)/etc - install ../Documentation/*.pdf $(DEST)/Documentation - (cd core; make DEST=$(DEST) install) - (cd modules/routing; make DEST=$(DEST) install) - (cd modules/protocol; make DEST=$(DEST) install) - (cd modules/monitor; make DEST=$(DEST) install) - (cd modules/filter; make DEST=$(DEST) install) diff --git a/server/core/Makefile b/server/core/Makefile deleted file mode 100644 index 4eab4162c..000000000 --- a/server/core/Makefile +++ /dev/null @@ -1,132 +0,0 @@ -# This file is distributed as part of the MariaDB Corporation MaxScale. It is free -# software: you can redistribute it and/or modify it under the terms of the -# GNU General Public License as published by the Free Software Foundation, -# version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright MariaDB Corporation Ab 2013 -# -# Revision History -# Date Who Description -# 13/06/13 Mark Riddoch Addition of -rdynamic to allow libraries -# to resolve symbols in the main executable -# 17/06/13 Mark Riddoch Addition of dependency generation -# 24/06/13 Massimiliano Pinto Addition of libmysqlclient and its -# includes do this for launching the -# gateway: export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH:/packages/mariadb-5.5.25/libmysql -# 27/06/13 Vilho Raatikka Added logmanager-related libs and -# headers so that liblog_manager.so can -# be linked in. -# 28/06/13 Vilho Raatikka Added query classifier-related libs and -# commented out mysql client headers and -# 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. -# 24/07/13 Mark Ridoch Addition of encryption routines -# 30/05/14 Mark Riddoch Filter API added -# 25/07/14 Mark Riddoch Addition of hints -# 29/08/14 Mark Riddoch Added housekeeper - -include ../../build_gateway.inc - -LOGPATH := $(ROOT_PATH)/log_manager -UTILSPATH := $(ROOT_PATH)/utils - -CC=cc - -CFLAGS=-c -I/usr/include -I../include -I../modules/include -I../inih \ - $(MYSQL_HEADERS) \ - -I$(LOGPATH) -I$(UTILSPATH) \ - -Wall -pedantic -g - -LDFLAGS=-rdynamic -L$(LOGPATH) \ - -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) \ - -Wl,-rpath,$(EMBEDDED_LIB) - - -LIBS=-L$(EMBEDDED_LIB) \ - -lmysqld \ - -lz -lm -lcrypt -lcrypto -ldl -laio -lrt -pthread -llog_manager \ - -L../inih/extra -linih -lssl -lstdc++ - -include ../../makefile.inc - -SRCS= atomic.c buffer.c spinlock.c gateway.c \ - gw_utils.c utils.c dcb.c load_utils.c session.c service.c server.c \ - poll.c config.c users.c hashtable.c dbusers.c thread.c gwbitmask.c \ - monitor.c adminusers.c secrets.c filter.c modutil.c hint.c \ - housekeeper.c memlog.c - -HDRS= ../include/atomic.h ../include/buffer.h ../include/dcb.h \ - ../include/gw.h ../modules/include/mysql_client_server_protocol.h \ - ../include/session.h ../include/spinlock.h ../include/thread.h \ - ../include/modules.h ../include/poll.h ../include/config.h \ - ../include/users.h ../include/hashtable.h ../include/gwbitmask.h \ - ../include/adminusers.h ../include/version.h ../include/maxscale.h \ - ../include/filter.h ../include/modutil.h ../hint.h \ - ../include/housekeeper.h ../include/memlog.h - -OBJ=$(SRCS:.c=.o) - -KOBJS=maxkeys.o secrets.o utils.o -POBJS=maxpasswd.o secrets.o utils.o - -all: maxscale maxkeys maxpasswd - -cleantests: - $(MAKE) -C test cleantests - -buildtests: - $(MAKE) -C test buildtests - -runtests: - $(MAKE) -C test runtests - -testall: - $(MAKE) -C test testall - -maxscale: $(OBJ) - $(CC) $(LDFLAGS) $(OBJ) $(UTILSPATH)/skygw_utils.o $(LIBS) -o $@ - -maxkeys: $(KOBJS) - $(CC) $(LDFLAGS) $(KOBJS) $(UTILSPATH)/skygw_utils.o $(LIBS) -o $@ - -maxpasswd: $(POBJS) - $(CC) $(LDFLAGS) $(POBJS) $(UTILSPATH)/skygw_utils.o $(LIBS) -o $@ - -.c.o: - $(CC) $(CFLAGS) $< -o $@ - - -../include/version.h: ../../VERSION - echo '#define MAXSCALE_VERSION "'`cat ../../VERSION`'"' > ../include/version.h - -clean: - $(DEL) $(OBJ) maxscale - $(DEL) *.so - -tags: - ctags $(SRCS) $(HDRS) - -depend: ../include/version.h - @$(DEL) depend.mk - cc -M $(CFLAGS) $(SRCS) > depend.mk - -install: maxscale maxkeys maxpasswd - @mkdir -p $(DEST)/bin - install -D maxscale maxkeys maxpasswd $(DEST)/bin - install -D $(EMBEDDED_LIB)/$(LIB) $(DEST)/lib - install -D $(ERRMSG)/errmsg.sys $(DEST)/mysql - -include depend.mk diff --git a/server/core/test/makefile b/server/core/test/makefile deleted file mode 100644 index e3d7a4ce5..000000000 --- a/server/core/test/makefile +++ /dev/null @@ -1,121 +0,0 @@ -# cleantests - clean local and subdirectories' tests -# buildtests - build all local and subdirectories' tests -# runtests - run all local tests -# testall - clean, build and run local and subdirectories' tests - -include ../../../build_gateway.inc -include ../../../makefile.inc -include ../../../test.inc - -CC=cc -TESTLOG := $(shell pwd)/testcore.log - -LOGPATH := $(ROOT_PATH)/log_manager -UTILSPATH := $(ROOT_PATH)/utils - -LDFLAGS=-rdynamic -L$(LOGPATH) -L$(EMBEDDED_LIB) \ - -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) \ - -Wl,-rpath,$(EMBEDDED_LIB) - -LIBS= -L$(EMBEDDED_LIB) -lmysqld \ - -lz -lm -lcrypt -lcrypto -ldl -laio -lrt -pthread -llog_manager \ - -L../../inih/extra -linih -lssl -lstdc++ - -TESTS=testhash testspinlock testbuffer testmodutil testpoll testservice testdcb testfilter testadminusers testmemlog - -cleantests: - - $(DEL) *.o - - $(DEL) testhash - - $(DEL) *~ - -testall: - $(MAKE) cleantests - $(MAKE) DEBUG=Y buildtests - $(MAKE) runtests - -buildtests : $(TESTS) - -testhash: testhash.c - $(CC) $(CFLAGS) \ - -I$(ROOT_PATH)/server/include \ - -I$(ROOT_PATH)/utils \ - testhash.c ../hashtable.o ../atomic.o ../spinlock.o -o testhash - -testmysqlusers: test_mysql_users.c - $(CC) $(CFLAGS) \ - -I$(ROOT_PATH)/server/include \ - -I$(ROOT_PATH)/utils \ - test_mysql_users.c ../hashtable.o ../atomic.o ../modutil.o ../spinlock.o -o testmysqlusers - - -testspinlock: testspinlock.c - $(CC) $(CFLAGS) \ - -I$(ROOT_PATH)/server/include \ - -I$(ROOT_PATH)/utils \ - testspinlock.c ../spinlock.o ../atomic.o ../thread.o -o testspinlock - -testmodutil: testmodutil.c - $(CC) $(CFLAGS) \ - -I$(ROOT_PATH)/server/include \ - -I$(ROOT_PATH)/utils \ - testmodutil.c ../modutil.o ../buffer.o ../atomic.o -o testmodutil - -testbuffer: testbuffer.c - $(CC) $(CFLAGS) \ - -I$(ROOT_PATH)/server/include \ - -I$(ROOT_PATH)/utils \ - testbuffer.c ../buffer.o ../atomic.o -o testbuffer - -testpoll: testpoll.c - $(CC) $(CFLAGS) $(LDFLAGS) \ - -I$(ROOT_PATH)/server/include \ - -I$(ROOT_PATH)/utils \ - -I$(ROOT_PATH)/log_manager \ - testpoll.c libcore.a $(UTILSPATH)/skygw_utils.o $(LIBS) -o testpoll - -testservice: testservice.c - $(CC) $(CFLAGS) $(LDFLAGS) \ - -I$(ROOT_PATH)/server/include \ - -I$(ROOT_PATH)/utils \ - -I$(ROOT_PATH)/log_manager \ - testservice.c libcore.a $(UTILSPATH)/skygw_utils.o $(LIBS) -o testservice - -testdcb: testdcb.c - $(CC) $(CFLAGS) $(LDFLAGS) \ - -I$(ROOT_PATH)/server/include \ - -I$(ROOT_PATH)/utils \ - -I$(ROOT_PATH)/log_manager \ - testdcb.c libcore.a $(UTILSPATH)/skygw_utils.o $(LIBS) -o testdcb - -testfilter: testfilter.c libcore.a - $(CC) $(CFLAGS) $(LDFLAGS) \ - -I$(ROOT_PATH)/server/include \ - -I$(ROOT_PATH)/utils \ - testfilter.c libcore.a $(UTILSPATH)/skygw_utils.o $(LIBS) -o testfilter - -testadminusers: testadminusers.c libcore.a - $(CC) $(CFLAGS) $(LDFLAGS) \ - -I$(ROOT_PATH)/server/include \ - -I$(ROOT_PATH)/utils \ - testadminusers.c libcore.a $(UTILSPATH)/skygw_utils.o $(LIBS) -o testadminusers - -testmemlog: testmemlog.c libcore.a - $(CC) $(CFLAGS) $(LDFLAGS) \ - -I$(ROOT_PATH)/server/include \ - -I$(ROOT_PATH)/utils \ - testmemlog.c libcore.a $(UTILSPATH)/skygw_utils.o $(LIBS) -o testmemlog - - -libcore.a: ../*.o - ar rv libcore.a ../*.o - -runtests: $(TESTS) - @echo "" > $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test MaxScale core" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - $(foreach var,$(TESTS),./runtest.sh $(var) $(TESTLOG);) - @echo "" >> $(TESTLOG) - @cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG) diff --git a/server/inih/LICENSE.txt b/server/inih/LICENSE.txt old mode 100755 new mode 100644 diff --git a/server/inih/README.txt b/server/inih/README.txt old mode 100755 new mode 100644 diff --git a/server/inih/cpp/INIReader.cpp b/server/inih/cpp/INIReader.cpp old mode 100755 new mode 100644 diff --git a/server/inih/cpp/INIReader.h b/server/inih/cpp/INIReader.h old mode 100755 new mode 100644 diff --git a/server/inih/cpp/INIReaderTest.cpp b/server/inih/cpp/INIReaderTest.cpp old mode 100755 new mode 100644 diff --git a/server/inih/examples/config.def b/server/inih/examples/config.def old mode 100755 new mode 100644 diff --git a/server/inih/examples/ini_dump.c b/server/inih/examples/ini_dump.c old mode 100755 new mode 100644 diff --git a/server/inih/examples/ini_example.c b/server/inih/examples/ini_example.c old mode 100755 new mode 100644 diff --git a/server/inih/examples/ini_xmacros.c b/server/inih/examples/ini_xmacros.c old mode 100755 new mode 100644 diff --git a/server/inih/examples/test.ini b/server/inih/examples/test.ini old mode 100755 new mode 100644 diff --git a/server/inih/extra/Makefile.static b/server/inih/extra/Makefile.static deleted file mode 100755 index 0d6519e38..000000000 --- a/server/inih/extra/Makefile.static +++ /dev/null @@ -1,19 +0,0 @@ -# Simple makefile to build inih as a static library using g++ - -SRC = ../ini.c -OBJ = $(SRC:.c=.o) -OUT = libinih.a -INCLUDES = -I.. -CCFLAGS = -g -O2 -CC = g++ - -default: $(OUT) - -.c.o: - $(CC) $(INCLUDES) $(CCFLAGS) $(EXTRACCFLAGS) -c $< -o $@ - -$(OUT): $(OBJ) - ar rcs $(OUT) $(OBJ) $(EXTRAARFLAGS) - -clean: - rm -f $(OBJ) $(OUT) diff --git a/server/inih/ini.c b/server/inih/ini.c old mode 100755 new mode 100644 diff --git a/server/inih/ini.h b/server/inih/ini.h old mode 100755 new mode 100644 diff --git a/server/inih/tests/bad_comment.ini b/server/inih/tests/bad_comment.ini old mode 100755 new mode 100644 diff --git a/server/inih/tests/bad_multi.ini b/server/inih/tests/bad_multi.ini old mode 100755 new mode 100644 diff --git a/server/inih/tests/bad_section.ini b/server/inih/tests/bad_section.ini old mode 100755 new mode 100644 diff --git a/server/inih/tests/baseline_multi.txt b/server/inih/tests/baseline_multi.txt old mode 100755 new mode 100644 diff --git a/server/inih/tests/baseline_single.txt b/server/inih/tests/baseline_single.txt old mode 100755 new mode 100644 diff --git a/server/inih/tests/bom.ini b/server/inih/tests/bom.ini old mode 100755 new mode 100644 diff --git a/server/inih/tests/multi_line.ini b/server/inih/tests/multi_line.ini old mode 100755 new mode 100644 diff --git a/server/inih/tests/normal.ini b/server/inih/tests/normal.ini old mode 100755 new mode 100644 diff --git a/server/inih/tests/unittest.bat b/server/inih/tests/unittest.bat old mode 100755 new mode 100644 diff --git a/server/inih/tests/unittest.c b/server/inih/tests/unittest.c old mode 100755 new mode 100644 diff --git a/server/inih/tests/user_error.ini b/server/inih/tests/user_error.ini old mode 100755 new mode 100644 diff --git a/server/modules/filter/Makefile b/server/modules/filter/Makefile deleted file mode 100644 index 284c7b2dc..000000000 --- a/server/modules/filter/Makefile +++ /dev/null @@ -1,117 +0,0 @@ -# This file is distributed as part of MaxScale form MariaDB Corporation. It is free -# software: you can redistribute it and/or modify it under the terms of the -# GNU General Public License as published by the Free Software Foundation, -# version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright MariaDB Corporation Ab 2014 -# -# Revision History -# Date Who Description -# 29/05/14 Mark Riddoch Initial module development - -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$(QCLASSPATH) \ - -I$(UTILSPATH) -I$(MYSQL_ROOT) -Wall -g - -include ../../../makefile.inc - -LDFLAGS=-shared -L$(LOGPATH) -L$(EMBEDDED_LIB) -L$(QCLASSPATH) -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) - -TESTSRCS=testfilter.c -TESTOBJ=$(TESTSRCS:.c=.o) -QLASRCS=qlafilter.c -QLAOBJ=$(QLASRCS:.c=.o) -REGEXSRCS=regexfilter.c -REGEXOBJ=$(REGEXSRCS:.c=.o) -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 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 $@ - -libregexfilter.so: $(REGEXOBJ) - $(CC) $(LDFLAGS) $(REGEXOBJ) $(LIBS) -o $@ - -libtopfilter.so: $(TOPNOBJ) - $(CC) $(LDFLAGS) $(TOPNOBJ) $(LIBS) -o $@ - -libtee.so: $(TEEOBJ) - $(CC) $(LDFLAGS) $(TEEOBJ) $(LIBS) -o $@ - -libhintfilter.so: - (cd hint; touch depend.mk ; make; cp $@ ..) - -.c.o: - $(CC) $(CFLAGS) $< -o $@ - -clean: - rm -f $(OBJ) $(MODULES) - (cd hint; touch depend.mk; make clean) - -tags: - ctags $(SRCS) $(HDRS) - (cd hint; touch depend.mk; make tags) - -depend: - @rm -f depend.mk - cc -M $(CFLAGS) $(SRCS) > depend.mk - (cd hint; touch depend.mk; make depend) - -install: $(MODULES) - install -D $(MODULES) $(DEST)/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 diff --git a/server/modules/filter/hint/Makefile b/server/modules/filter/hint/Makefile deleted file mode 100644 index 202034b9c..000000000 --- a/server/modules/filter/hint/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -# This file is distributed as part of MaxScale form MariaDB Corporation. It is free -# software: you can redistribute it and/or modify it under the terms of the -# GNU General Public License as published by the Free Software Foundation, -# version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright MariaDB Corporation Ab 2014 -# -# Revision History -# Date Who Description -# 21/07/14 Mark Riddoch Initial module development - -include ../../../../build_gateway.inc - -LOGPATH := $(ROOT_PATH)/log_manager -UTILSPATH := $(ROOT_PATH)/utils - -CC=cc -CFLAGS=-c -fPIC -I/usr/include -I../../include -I../../../include -I$(LOGPATH) \ - -I$(UTILSPATH) -Wall -g - -include ../../../../makefile.inc - -LDFLAGS=-shared -L$(LOGPATH) -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) - -SRCS= hintfilter.c hintparser.c -OBJ=$(SRCS:.c=.o) -LIBS=$(UTILSPATH)/skygw_utils.o -lssl -llog_manager - -libhintfilter.so: $(OBJ) - $(CC) $(LDFLAGS) $(OBJ) $(LIBS) -o $@ - -.c.o: - $(CC) $(CFLAGS) $< -o $@ - -clean: - rm -f $(OBJ) libhintfilter.so - -tags: - ctags $(SRCS) $(HDRS) - -depend: - @rm -f depend.mk - cc -M $(CFLAGS) $(SRCS) > depend.mk - -install: $(MODULES) - install -D $(MODULES) $(DEST)/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 diff --git a/server/modules/filter/test/Makefile b/server/modules/filter/test/Makefile deleted file mode 100644 index 12546291d..000000000 --- a/server/modules/filter/test/Makefile +++ /dev/null @@ -1,80 +0,0 @@ -# This file is distributed as part of MaxScale form MariaDB Corporation. It is free -# software: you can redistribute it and/or modify it under the terms of the -# GNU General Public License as published by the Free Software Foundation, -# version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright MariaDB Corporation Ab 2014 - -include ../../../../build_gateway.inc - -LOGPATH := $(ROOT_PATH)/log_manager -UTILSPATH := $(ROOT_PATH)/utils -QCLASSPATH := $(ROOT_PATH)/query_classifier -COREPATH := $(ROOT_PATH)/server/core - -CC=cc -CFLAGS=-c -fPIC -I/usr/include -I../../include -I../../../include \ - -I$(LOGPATH) -I$(UTILSPATH) -I./ -I$(ROOT_PATH)/server/inih -I$(QCLASSPATH) \ - $(MYSQL_HEADERS) -Wall -g - -include ../../../../makefile.inc - -LDFLAGS=-rdynamic -L$(LOGPATH) -L$(UTILSPATH) -L$(EMBEDDED_LIB) \ - -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) \ - -Wl,-rpath,$(EMBEDDED_LIB) - -SRCS=harness_util.c harness_common.c -OBJ=$(SRCS:.c=.o) -COREOBJ=$(COREPATH)/load_utils.o $(COREPATH)/dcb.o $(COREPATH)/utils.o \ - $(COREPATH)/gw_utils.o $(COREPATH)/buffer.o $(COREPATH)/poll.o \ - $(COREPATH)/spinlock.o $(COREPATH)/gwbitmask.o $(COREPATH)/session.o \ - $(COREPATH)/atomic.o $(COREPATH)/hashtable.o $(COREPATH)/filter.o $(COREPATH)/modutil.o $(ROOT_PATH)/server/inih/ini.o \ - $(COREPATH)/hint.o $(COREPATH)/config.o $(COREPATH)/service.o $(COREPATH)/server.o $(COREPATH)/monitor.o $(COREPATH)/housekeeper.o $(COREPATH)/adminusers.o $(COREPATH)/dbusers.o $(COREPATH)/thread.o $(COREPATH)/users.o $(COREPATH)/secrets.o -LIBS= $(UTILSPATH)/skygw_utils.o -lssl -pthread -llog_manager -lmysqld -ldl -lcrypto -lcrypt -lm -MODULES := $(wildcard ../*.so) - -all: build - -build:$(OBJ) - $(CC) $(OBJ) $(COREOBJ) $(LDFLAGS) $(LIBS) -o harness - $(MAKE) -C ../ - cp ../*.so ./ - -%.o: %.c - $(CC) $(CFLAGS) $< -o $@ - -clean: - rm -f *.o - rm -f *.so - rm -f harness -cleantests:clean - rm *.output -buildtests:build - -testall: - $(MAKE) cleantests - $(MAKE) buildtests - $(MAKE) runtests - -runtests: - @echo "" - @echo "-------------------------------" - @echo "$(shell date)" - @echo "Test Filter harness" - @echo "-------------------------------" - @echo "Testing hints... " - @./hint_tests.sh - @echo "" - -documentation: - doxygen doxygen.conf diff --git a/server/modules/filter/test/fwfilter/fwtest.cnf.in b/server/modules/filter/test/fwfilter/fwtest.cnf.in old mode 100755 new mode 100644 diff --git a/server/modules/filter/test/fwfilter/fwtest.expected b/server/modules/filter/test/fwfilter/fwtest.expected old mode 100755 new mode 100644 diff --git a/server/modules/filter/test/fwfilter/fwtest.input b/server/modules/filter/test/fwfilter/fwtest.input old mode 100755 new mode 100644 diff --git a/server/modules/filter/test/fwfilter/fwtest.output b/server/modules/filter/test/fwfilter/fwtest.output old mode 100755 new mode 100644 diff --git a/server/modules/filter/test/fwfilter/fwtest2.expected b/server/modules/filter/test/fwfilter/fwtest2.expected old mode 100755 new mode 100644 diff --git a/server/modules/filter/test/fwfilter/fwtest2.input b/server/modules/filter/test/fwfilter/fwtest2.input old mode 100755 new mode 100644 diff --git a/server/modules/filter/test/harness_ui.c b/server/modules/filter/test/harness_ui.c old mode 100755 new mode 100644 diff --git a/server/modules/filter/test/hintfilter/hint_testing.cnf b/server/modules/filter/test/hintfilter/hint_testing.cnf old mode 100755 new mode 100644 diff --git a/server/modules/filter/test/hintfilter/hint_testing.expected b/server/modules/filter/test/hintfilter/hint_testing.expected old mode 100755 new mode 100644 diff --git a/server/modules/filter/test/regexfilter/regextest.expected b/server/modules/filter/test/regexfilter/regextest.expected old mode 100755 new mode 100644 diff --git a/server/modules/monitor/Makefile b/server/modules/monitor/Makefile deleted file mode 100644 index f178536d8..000000000 --- a/server/modules/monitor/Makefile +++ /dev/null @@ -1,78 +0,0 @@ -# This file is distributed as part of the MariaDB Corporation MaxScale. It is free -# software: you can redistribute it and/or modify it under the terms of the -# GNU General Public License as published by the Free Software Foundation, -# version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright MariaDB Corporation Ab 2013 -# -# Revision History -# Date Who Description -# 08/07/13 Mark Riddoch Initial implementation -# 28/07/14 Massimiliano Pinto new monitor ndbcluster added - -include ../../../build_gateway.inc -include ../../../makefile.inc - -LOGPATH := $(ROOT_PATH)/log_manager -UTILSPATH := $(ROOT_PATH)/utils - -CC=cc -CFLAGS=-c -fPIC -I. -I/usr/include -I../include -I../../include -I$(LOGPATH) \ - -I$(UTILSPATH) $(MYSQL_HEADERS) -Wall -g - -LDFLAGS=-shared -L$(LOGPATH) -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) \ - -Wl,-rpath,$(EMBEDDED_LIB) - - - -MYSQLSRCS=mysql_mon.c -MYSQLOBJ=$(MYSQLSRCS:.c=.o) -GALERASRCS=galera_mon.c -GALERAOBJ=$(GALERASRCS:.c=.o) -NDBCLUSTERSRCS=ndbcluster_mon.c -NDBCLUSTEROBJ=$(NDBCLUSTERSRCS:.c=.o) -SRCS=$(MYSQLSRCS) $(GALERASRCS) $(NDBCLUSTERSRCS) -OBJ=$(SRCS:.c=.o) -LIBS=$(UTILSPATH)/skygw_utils.o -llog_manager \ - -L$(EMBEDDED_LIB) -lmysqld -MODULES=libmysqlmon.so libgaleramon.so libndbclustermon.so - - -all: $(MODULES) - -libmysqlmon.so: $(MYSQLOBJ) - $(CC) $(LDFLAGS) $(MYSQLOBJ) $(LIBS) -o $@ - -libgaleramon.so: $(GALERAOBJ) - $(CC) $(LDFLAGS) $(GALERAOBJ) $(LIBS) -o $@ - -libndbclustermon.so: $(NDBCLUSTEROBJ) - $(CC) $(LDFLAGS) $(NDBCLUSTEROBJ) $(LIBS) -o $@ - -.c.o: - $(CC) $(CFLAGS) $< -o $@ - -clean: - $(DEL) $(OBJ) $(MODULES) - -tags: - ctags $(SRCS) $(HDRS) - -depend: - @$(DEL) depend.mk - cc -M $(CFLAGS) $(SRCS) > depend.mk - -install: $(MODULES) - install -D $(MODULES) $(DEST)/modules - -include depend.mk diff --git a/server/modules/protocol/Makefile b/server/modules/protocol/Makefile deleted file mode 100644 index 8f6201e3e..000000000 --- a/server/modules/protocol/Makefile +++ /dev/null @@ -1,91 +0,0 @@ -# This file is distributed as part of the MariaDB Corporation MaxScale. It is free -# software: you can redistribute it and/or modify it under the terms of the -# GNU General Public License as published by the Free Software Foundation, -# version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright MariaDB Corporation Ab 2013 -# -# Revision History -# Date Who Description -# 13/06/2013 Mark Riddoch Initial protocol module development -# 17/06/2013 Massimiliano Pinto Added mysql_common top both libraries -# 27/06/2013 Vilho Raatikka Added logmanager-related libs and -# headers so that liblog_manager.so can -# be linked in. -# 09/07/2013 Massimiliano Pinto Added the HTTPD protocol module -# 13/06/2014 Mark Riddoch Added thr MaxScale protocol module -# -include ../../../build_gateway.inc - -LOGPATH := $(ROOT_PATH)/log_manager -UTILSPATH := $(ROOT_PATH)/utils - -CC=cc -CFLAGS=-c -fPIC -I/usr/include -I../include -I../../include -I$(LOGPATH) \ - -I$(UTILSPATH) -Wall -g - -include ../../../makefile.inc - -LDFLAGS=-shared -L$(LOGPATH) -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) - -MYSQLCLIENTSRCS=mysql_client.c mysql_common.c -MYSQLCLIENTOBJ=$(MYSQLCLIENTSRCS:.c=.o) -MYSQLBACKENDSRCS=mysql_backend.c mysql_common.c -MYSQLBACKENDOBJ=$(MYSQLBACKENDSRCS:.c=.o) -TELNETDSRCS=telnetd.c -TELNETDOBJ=$(TELNETDSRCS:.c=.o) -HTTPDSRCS=httpd.c -HTTPDOBJ=$(HTTPDSRCS:.c=.o) -MAXSCALEDSRCS=maxscaled.c -MAXSCALEDOBJ=$(MAXSCALEDSRCS:.c=.o) -SRCS=$(MYSQLCLIENTSRCS) $(MYSQLBACKENDSRCS) $(TELNETDSRCS) $(HTTPDSRCS) \ - $(MAXSCALEDSRCS) -OBJ=$(SRCS:.c=.o) -LIBS=$(UTILSPATH)/skygw_utils.o -MODULES=libMySQLClient.so libMySQLBackend.so libtelnetd.so libHTTPD.so \ - libmaxscaled.so - -all: $(MODULES) - -libMySQLClient.so: $(MYSQLCLIENTOBJ) - $(CC) $(LDFLAGS) $(MYSQLCLIENTOBJ) $(LIBS) -o $@ - -libMySQLBackend.so: $(MYSQLBACKENDOBJ) - $(CC) $(LDFLAGS) $(MYSQLBACKENDOBJ) $(LIBS) -o $@ - -libtelnetd.so: $(TELNETDOBJ) - $(CC) $(LDFLAGS) $(TELNETDOBJ) $(LIBS) -lcrypt -o $@ - -libHTTPD.so: $(HTTPDOBJ) - $(CC) $(LDFLAGS) $(HTTPDOBJ) $(LIBS) -o $@ - -libmaxscaled.so: $(MAXSCALEDOBJ) - $(CC) $(LDFLAGS) $(MAXSCALEDOBJ) $(LIBS) -lcrypt -o $@ - -.c.o: - $(CC) $(CFLAGS) $< -o $@ - -clean: - $(DEL) $(OBJ) $(MODULES) - -tags: - ctags $(SRCS) $(HDRS) - -install: $(MODULES) - install -D $(MODULES) $(DEST)/modules - -depend: - @$(DEL) depend.mk - cc -M $(CFLAGS) $(SRCS) > depend.mk - -include depend.mk diff --git a/server/modules/routing/Makefile b/server/modules/routing/Makefile deleted file mode 100644 index 1383c3322..000000000 --- a/server/modules/routing/Makefile +++ /dev/null @@ -1,109 +0,0 @@ -# This file is distributed as part of the MariaDB Corporation MaxScale. It is free -# software: you can redistribute it and/or modify it under the terms of the -# GNU General Public License as published by the Free Software Foundation, -# version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright MariaDB Corporation Ab 2013 -# -# Revision History -# Date Who Description -# 13/06/13 Mark Riddoch Initial routing module development -# 27/06/13 Vilho Raatikka Added logmanager-related libs and -# headers so that liblog_manager.so can -# be linked in. -# 27/06/13 Mark Riddoch Addition of read write splitter - -include ../../../build_gateway.inc - -LOGPATH := $(ROOT_PATH)/log_manager -UTILSPATH := $(ROOT_PATH)/utils - -CC=cc -CFLAGS=-c -fPIC -I/usr/include -I../include -I../../include -I$(LOGPATH) \ - -I$(UTILSPATH) -I$(MYSQL_HEADERS) -Wall -g - -include ../../../makefile.inc - -LDFLAGS=-shared -L$(LOGPATH) -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) - -TESTSRCS=testroute.c -TESTOBJ=$(TESTSRCS:.c=.o) -READCONSRCS=readconnroute.c -READCONOBJ=$(READCONSRCS:.c=.o) -DEBUGCLISRCS=debugcli.c debugcmd.c -DEBUGCLIOBJ=$(DEBUGCLISRCS:.c=.o) -CLISRCS=cli.c debugcmd.c -CLIOBJ=$(CLISRCS:.c=.o) -SRCS=$(TESTSRCS) $(READCONSRCS) $(DEBUGCLISRCS) cli.c -OBJ=$(SRCS:.c=.o) -LIBS=$(UTILSPATH)/skygw_utils.o -lssl -llog_manager -MODULES= libdebugcli.so libreadconnroute.so libtestroute.so libcli.so libbinlogrouter.so - - -all: $(MODULES) - (cd readwritesplit; make) - -libtestroute.so: $(TESTOBJ) - $(CC) $(LDFLAGS) $(TESTOBJ) $(LIBS) -o $@ - -libreadconnroute.so: $(READCONOBJ) - $(CC) $(LDFLAGS) $(READCONOBJ) $(LIBS) -o $@ - -libdebugcli.so: $(DEBUGCLIOBJ) - $(CC) $(LDFLAGS) $(DEBUGCLIOBJ) $(LIBS) -o $@ - -libcli.so: $(CLIOBJ) - $(CC) $(LDFLAGS) $(CLIOBJ) $(LIBS) -o $@ - -libreadwritesplit.so: - (cd readwritesplit; touch depend.mk ; make; cp $@ ..) - -libbinlogrouter.so: - (cd binlog; touch depend.mk ; make; cp $@ ..) - -.c.o: - $(CC) $(CFLAGS) $< -o $@ - -clean: - $(DEL) $(OBJ) $(MODULES) - (cd readwritesplit; touch depend.mk; make clean) - (cd binlog; touch depend.mk; make clean) - -tags: - ctags $(SRCS) $(HDRS) - (cd readwritesplit; make tags) - -depend: - @$(DEL) depend.mk - cc -M $(CFLAGS) $(SRCS) > depend.mk - (cd readwritesplit; touch depend.mk ; make depend) - (cd binlog; touch depend.mk ; make depend) - -install: $(MODULES) - install -D $(MODULES) $(DEST)/modules - (cd readwritesplit; make DEST=$(DEST) install) - (cd binlog; make DEST=$(DEST) install) - -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 diff --git a/server/modules/routing/binlog/Makefile b/server/modules/routing/binlog/Makefile deleted file mode 100644 index 0e7c0a778..000000000 --- a/server/modules/routing/binlog/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# This file is distributed as part of the MariaDB Corporation MaxScale. It is free -# software: you can redistribute it and/or modify it under the terms of the -# GNU General Public License as published by the Free Software Foundation, -# version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright MariaDB Corporation Ab 2013 -# -# Revision History -# Date Who Description -# 2/04/14 Mark Riddoch Initial framework put in place - -include ../../../../build_gateway.inc - -LOGPATH := $(ROOT_PATH)/log_manager -UTILSPATH := $(ROOT_PATH)/utils -QCLASSPATH := $(ROOT_PATH)/query_classifier - -CC=cc -CFLAGS=-c -fPIC -I/usr/include -I../../include -I../../../include \ - -I$(LOGPATH) -I$(UTILSPATH) -I$(QCLASSPATH) \ - $(MYSQL_HEADERS) -Wall -g - -include ../../../../makefile.inc - -#LDFLAGS=-shared -L$(LOGPATH) -L$(QCLASSPATH) -L$(EMBEDDED_LIB) \ -# -Wl,-rpath,$(DEST)/lib \ -# -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) -Wl,-rpath,$(QCLASSPATH) \ -# -Wl,-rpath,$(EMBEDDED_LIB) -LDFLAGS=-shared -L$(LOGPATH) -L$(QCLASSPATH) -L$(EMBEDDED_LIB) \ - -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) - - -SRCS=blr.c blr_master.c blr_cache.c blr_slave.c blr_file.c -OBJ=$(SRCS:.c=.o) -LIBS=-lssl -pthread -llog_manager -lmysqld -MODULES=libbinlogrouter.so - -all: $(MODULES) - -$(MODULES): $(OBJ) - $(CC) $(LDFLAGS) $(OBJ) $(UTILSPATH)/skygw_utils.o $(LIBS) -o $@ - -.c.o: - $(CC) $(CFLAGS) $< -o $@ - -clean: - rm -f $(OBJ) $(MODULES) - -tags: - ctags $(SRCS) $(HDRS) - -depend: - @rm -f depend.mk - cc -M $(CFLAGS) $(SRCS) > depend.mk - -install: $(MODULES) - install -D $(MODULES) $(DEST)/MaxScale/modules - -include depend.mk diff --git a/server/modules/routing/readwritesplit/Makefile b/server/modules/routing/readwritesplit/Makefile deleted file mode 100644 index 134a7271c..000000000 --- a/server/modules/routing/readwritesplit/Makefile +++ /dev/null @@ -1,78 +0,0 @@ -# This file is distributed as part of the MariaDB Corporation MaxScale. It is free -# software: you can redistribute it and/or modify it under the terms of the -# GNU General Public License as published by the Free Software Foundation, -# version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright MariaDB Corporation Ab 2013 -# -# Revision History -# Date Who Description -# 27/06/13 Mark Riddoch Initial framework put in place - -include ../../../../build_gateway.inc - -LOGPATH := $(ROOT_PATH)/log_manager -UTILSPATH := $(ROOT_PATH)/utils -QCLASSPATH := $(ROOT_PATH)/query_classifier - -CC=cc -CFLAGS=-c -fPIC -I/usr/include -I../../include -I../../../include \ - -I$(LOGPATH) -I$(UTILSPATH) -I$(QCLASSPATH) \ - $(MYSQL_HEADERS) -Wall -g - -include ../../../../makefile.inc - -LDFLAGS=-shared -L$(LOGPATH) -L$(QCLASSPATH) -L$(EMBEDDED_LIB) \ - -Wl,-rpath,$(DEST)/lib \ - -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) -Wl,-rpath,$(QCLASSPATH) \ - -Wl,-rpath,$(EMBEDDED_LIB) - -SRCS=readwritesplit.c -OBJ=$(SRCS:.c=.o) -LIBS=-lssl -pthread -llog_manager -lquery_classifier -lmysqld -MODULES=libreadwritesplit.so - -all: $(MODULES) - -libreadwritesplit.so: $(OBJ) - $(CC) $(LDFLAGS) $(OBJ) $(UTILSPATH)/skygw_utils.o $(LIBS) -o $@ - -.c.o: - $(CC) $(CFLAGS) $< -o $@ - -clean: - $(DEL) $(OBJ) $(MODULES) - -tags: - ctags $(SRCS) $(HDRS) - -depend: - @$(DEL) depend.mk - cc -M $(CFLAGS) $(SRCS) > depend.mk - -install: $(MODULES) - install -D $(MODULES) $(DEST)/modules - -cleantests: - $(MAKE) -C test cleantest - -testall: - $(MAKE) -C test testall - -buildtests: - $(MAKE) -C test buildtests - -runtests: - $(MAKE) -C runtests - - -include depend.mk diff --git a/server/modules/routing/readwritesplit/test/makefile b/server/modules/routing/readwritesplit/test/makefile deleted file mode 100644 index b63030608..000000000 --- a/server/modules/routing/readwritesplit/test/makefile +++ /dev/null @@ -1,36 +0,0 @@ -# cleantests - clean local and subdirectories' tests -# buildtests - build all local and subdirectories' tests -# runtests - run all local tests -# testall - clean, build and run local and subdirectories' tests - -include ../../../../../build_gateway.inc -include $(ROOT_PATH)/makefile.inc -include $(ROOT_PATH)/test.inc - -CC=cc -TESTLOG := $(shell pwd)/testrwsplit.log -RET := -1 - -cleantests: - - $(DEL) *.o - - $(DEL) *~ - - -testall: - -$(MAKE) cleantests - -$(MAKE) DEBUG=Y buildtests - -$(MAKE) runtests - -$(MAKE) -C test_hints testall - -buildtests: - - -runtests: - @echo "" > $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test Read/Write split router" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - ./rwsplit.sh $(TESTLOG) $(THOST) $(TPORT_RW) $(TMASTER_ID) $(TUSER) $(TPWD) - @echo "" >> $(TESTLOG) - @cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG) diff --git a/server/modules/routing/readwritesplit/test/test_hints/Makefile b/server/modules/routing/readwritesplit/test/test_hints/Makefile deleted file mode 100644 index f4b2d209d..000000000 --- a/server/modules/routing/readwritesplit/test/test_hints/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# cleantests - clean local and subdirectories' tests -# buildtests - build all local and subdirectories' tests -# runtests - run all local tests -# testall - clean, build and run local and subdirectories' tests - -include ../../../../../../build_gateway.inc -include $(ROOT_PATH)/makefile.inc -include $(ROOT_PATH)/test.inc - -ARGS=6 - -CC=cc -TESTLOG := $(shell pwd)/testrwsplit_hints.log -RET := -1 - -cleantests: - - $(DEL) *.o - - $(DEL) *~ - - $(DEL) *.sql - - $(DEL) *.output - - $(DEL) *.log - -testall: - -$(MAKE) cleantests - -$(MAKE) DEBUG=Y buildtests - -$(MAKE) runtests - -buildtests: - - -runtests: - @echo "" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test Read/Write split router - hint routing" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo "Running simple tests" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - ./rwsplit_hints.sh $(TESTLOG) $(THOST) $(TPORT_RW_HINT) $(TMASTER_ID) $(TUSER) $(TPWD) simple_tests - @echo "" >> $(TESTLOG) - @echo "Running syntax error tests" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - ./syntax_check.sh $(TESTLOG) $(THOST) $(TPORT_RW_HINT) $(TMASTER_ID) $(TUSER) $(TPWD) error_tests - @echo "" >> $(TESTLOG) - @echo "Running complex tests" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - ./rwsplit_hints.sh $(TESTLOG) $(THOST) $(TPORT_RW_HINT) $(TMASTER_ID) $(TUSER) $(TPWD) complex_tests - @echo "" >> $(TESTLOG) - @echo "Running stack tests" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - ./rwsplit_hints.sh $(TESTLOG) $(THOST) $(TPORT_RW_HINT) $(TMASTER_ID) $(TUSER) $(TPWD) stack_tests - @echo "" >> $(TESTLOG) - @cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG) diff --git a/server/modules/routing/test/makefile b/server/modules/routing/test/makefile deleted file mode 100644 index 039f2910e..000000000 --- a/server/modules/routing/test/makefile +++ /dev/null @@ -1,41 +0,0 @@ -# cleantests - clean local and subdirectories' tests -# buildtests - build all local and subdirectories' tests -# runtests - run all local tests -# testall - clean, build and run local and subdirectories' tests - -include ../../../../build_gateway.inc -include $(ROOT_PATH)/makefile.inc -include $(ROOT_PATH)/test.inc - -CC=cc -TESTLOG := $(shell pwd)/testrouting.log -RET := -1 - -cleantests: - - $(DEL) *.o - - $(DEL) *~ - - -testall: - -$(MAKE) cleantests - -$(MAKE) DEBUG=Y buildtests - -$(MAKE) runtests - @echo "" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test Read/Write Split Router" >> $(TESTLOG) - $(MAKE) -C $(ROOT_PATH)/server/modules/routing/readwritesplit testall - - -buildtests: - $(MAKE) -C $(ROOT_PATH)/server/modules/routing/readwritesplit buildtests - - -runtests: - @echo "" > $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test routing" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo "Nothing to run here so far" >> $(TESTLOG) - @cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG) diff --git a/server/test/makefile b/server/test/makefile deleted file mode 100644 index 7f9c36b84..000000000 --- a/server/test/makefile +++ /dev/null @@ -1,74 +0,0 @@ -# cleantests - clean local and subdirectories' tests -# buildtests - build all local and subdirectories' tests -# runtests - run all local tests -# testall - clean, build and run local and subdirectories' tests - -include ../../build_gateway.inc -include ../../makefile.inc -include ../../test.inc - -TEST_ROOT := $(ROOT_PATH)/test -PARENT_DIR := $(ROOT_PATH)/server -CUR_DIR := $(PARENT_DIR)/test -export MAXSCALE_HOME=$(CUR_DIR) - -CC=cc -TESTLOG := $(CUR_DIR)/testserver.log - -ifndef $(HAVE_SRV) -HAVE_SRV := N -endif - -cleantests: - - $(DEL) *.o - - $(DEL) *~ -ifeq ($(HAVE_SRV), N) - - $(DEL) Documentation - - $(DEL) bin - - $(DEL) lib - - $(DEL) MaxScale/etc - - $(DEL) MaxScale/modules - - $(DEL) MaxScale/mysql -endif - $(MAKE) -C $(PARENT_DIR)/core cleantests - -testall: - $(MAKE) HAVE_SRV=$(HAVE_SRV) cleantests - $(MAKE) HAVE_SRV=$(HAVE_SRV) buildtests - $(MAKE) runtests - @echo "" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test Server Core" >> $(TESTLOG) - $(MAKE) -C $(ROOT_PATH)/server/core testall - @echo "Core PASSED" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test Modules" >> $(TESTLOG) - $(MAKE) -C $(ROOT_PATH)/server/modules/routing testall - @killall maxscale - @echo "Routing modules PASSED" >> $(TESTLOG) - - -buildtests: -ifeq ($(HAVE_SRV), Y) - @echo "Test server already built" -else - $(MAKE) -C $(ROOT_PATH) buildtestserver -endif - -runtests: - @echo "" > $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test MaxScale server" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo "MAXSCALE_HOME="$(MAXSCALE_HOME) >> $(TESTLOG) - cp $(CUR_DIR)/MaxScale_test.cnf $(MAXSCALE_HOME)/etc/MaxScale.cnf - bin/maxscale 2>> $(TESTLOG) - @echo "Put your tests here" - @sleep 5 - @echo "MaxScale server PASSED" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - @cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG) diff --git a/test.inc b/test.inc deleted file mode 100644 index c68176a74..000000000 --- a/test.inc +++ /dev/null @@ -1,47 +0,0 @@ -# -# This file includes parameters needed for running tests and may be included -# in makefiles in test directories if seen useful. -# -# hostname or IP address of MaxScale's host, for example: -# -# THOST := 127.0.0.1 -# -THOST := - -# -# port of read connection router module, for example: -# TPORT_RCONN := 4008 -# -TPORT_RCONN := -# -# port of read/write split router module, for example: -# TPORT_RW := 4006 -# -TPORT_RW := -# -# port of read/write split router module with hints, for example: -# TPORT_RW_HINT := 4009 -# -TPORT_RW_HINT := -# -# username of MaxScale user, for example: -# TUSER := maxuser -# -TUSER := -# -# password of MaxScale user, for example: -# TPWD := maxpwd -# -TPWD := -# -# master's server_id, for example: -# TMASTER_ID := 2 -# -TMASTER_ID := - -# -# Global test log where all log is gathered -# TEST_MAXSCALE_LOG := $(ROOT_PATH)/test/test_maxscale.log -# -TEST_MAXSCALE_LOG := - diff --git a/test/README b/test/README deleted file mode 100644 index c13504058..000000000 --- a/test/README +++ /dev/null @@ -1,66 +0,0 @@ -Source tree structure and test targets for make. In a given source directory, -MAXSCALE_HOME/server, for example, there is a test directory which includes -tests for that directory ('local tests') and targets for every subdirectory -of MAXSCALE_HOME/server. - -In the outline below, target, such as 'cleantest' includes instructions for -executing tests or make command pointing to subdirectories. If target is -followed by colon and a list of directory names ('cleantest:log_manager, -query_classifier'), the target is executed locally and in the listed -directories. - -Note : add new tests for any component as close to the actual implementation -as possible. For example, DCB tests in MAXSCALE_HOME/server/core/test instead -of MAXSCALE_HOME/server/test etc. - -MAXSCALE_HOME -| -|- log_manager cleantests, buildtests, runtests, testall -| | -| |- test cleantests, buildtests, runtests, testall -| -|- query_classifier cleantests, buildtests, runtests, testall -| | -| |- test cleantests, buildtests, runtests, testall -| -|- server cleantests, buildtests, testall -| | -| |- core cleantests, buildtests, runtests, testall -| | | -| | |- test cleantests, buildtests, runtests, testall -| | -| |- inih -| | | -| | |- test -| | -| |- modules -| | | -| | |- monitor -| | | -| | |- protocol -| | | -| | |- routing -| | | | -| | | |- readwritesplit -| | -| |- test cleantests:server/core, -| | buildtests, -| | runtests, -| | testall:server/core -| -|- test cleantests:log_manager, query_classifier, server, utils - buildtests:buildtestserver, log_manager, query_classifier, server, utils - runtests: - testall:cleantests, - buildtests, - runtests, - log_manager, - query_classifier, - server, - utils, - modules -| -|- utils cleantests, buildtests, runtests, testall -| | -| |- test cleantests, buildtests, runtests, testall -| \ No newline at end of file diff --git a/test/makefile b/test/makefile deleted file mode 100644 index 15e57f8bf..000000000 --- a/test/makefile +++ /dev/null @@ -1,65 +0,0 @@ -# cleantests - clean local and subdirectories' tests -# buildtests - build all local and subdirectories' tests -# runtests - run all local tests -# testall - clean, build and run local and subdirectories' tests - -include ../build_gateway.inc -include ../makefile.inc -include ../test.inc - -export MAXSCALE_HOME=$(shell pwd)/MaxScale - -CC=cc -TESTLOG := $(TEST_MAXSCALE_LOG) - -testall: - $(MAKE) cleantests - $(MAKE) buildtests - $(MAKE) runtests - @echo "" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test Log Manager" >> $(TESTLOG) - $(MAKE) -C $(ROOT_PATH)/log_manager testall - @echo "Log Manager PASSED" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test Query Classifier" >> $(TESTLOG) - $(MAKE) -C $(ROOT_PATH)/query_classifier testall - @echo "Query Classifier PASSED" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test MaxScale server" >> $(TESTLOG) - $(MAKE) -C $(ROOT_PATH)/server HAVE_SRV=$(HAVE_SRV) testall - @echo "MaxScale server PASSED" >> $(TESTLOG) - @echo "" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test utils" >> $(TESTLOG) - $(MAKE) -C $(ROOT_PATH)/utils testall - @echo "Utils PASSED" >> $(TESTLOG) - -cleantests: - $(DEL) *~ - $(MAKE) -C $(ROOT_PATH)/log_manager cleantests - $(MAKE) -C $(ROOT_PATH)/query_classifier cleantests - $(MAKE) -C $(ROOT_PATH)/server cleantests - $(MAKE) -C $(ROOT_PATH)/utils cleantests - -buildtests: - $(MAKE) -C $(ROOT_PATH) buildtestserver - $(MAKE) -C $(ROOT_PATH)/log_manager buildtests - $(MAKE) -C $(ROOT_PATH)/query_classifier buildtests - $(MAKE) -C $(ROOT_PATH)/server HAVE_SRV=$(HAVE_SRV) buildtests - $(MAKE) -C $(ROOT_PATH)/utils buildtests - -runtests: - @echo "" > $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test MaxScale root" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo "Nothing to run here so far" >> $(TESTLOG) - \ No newline at end of file diff --git a/utils/makefile b/utils/makefile deleted file mode 100644 index 0faa27144..000000000 --- a/utils/makefile +++ /dev/null @@ -1,30 +0,0 @@ -include ../build_gateway.inc -include ../makefile.inc - -CC = gcc -CPP = g++ -UTILS_PATH := $(ROOT_PATH)/utils - -makeall: clean all - -clean: - - $(DEL) *.o - - $(DEL) *.so - - $(DEL) *.a - - $(DEL) *~ - -all: - $(CPP) -c $(CFLAGS) -I$(UTILS_PATH) \ - -fPIC skygw_utils.cc -o skygw_utils.o - -cleantests: - $(MAKE) -C test cleantests - -buildtests: - $(MAKE) -C test DEBUG=Y buildtests - -runtests: - $(MAKE) -C test runtests - -testall: - $(MAKE) -C test testall diff --git a/utils/test/makefile b/utils/test/makefile deleted file mode 100644 index 969fb7b35..000000000 --- a/utils/test/makefile +++ /dev/null @@ -1,30 +0,0 @@ -# cleantests - clean local and subdirectories' tests -# buildtests - build all local and subdirectories' tests -# runtests - run all local tests -# testall - clean, build and run local and subdirectories' tests - -include ../../build_gateway.inc -include ../../makefile.inc - -CC=cc -TESTLOG := $(shell pwd)/testutils.log - -testall: - $(MAKE) cleantests - $(MAKE) buildtests - $(MAKE) runtests - @echo "No subdirectories to test" >> $(TESTLOG) - -cleantests: - $(DEL) *~ - -buildtests: - @echo "Nothing to build here so far" >> $(TESTLOG) - -runtests: - @echo "" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo $(shell date) >> $(TESTLOG) - @echo "Test Utils" >> $(TESTLOG) - @echo "-------------------------------" >> $(TESTLOG) - @echo "Nothing to run here so far" >> $(TESTLOG) From 533042b61ad0e09f8d0855e252ce3c221f1e9d00 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Thu, 15 Jan 2015 14:06:41 +0200 Subject: [PATCH 02/20] Fixes to coverity defects from 85514 up to 85529. --- query_classifier/query_classifier.cc | 4 +- server/modules/filter/fwfilter.c | 83 ++++++++++++++++----- server/modules/filter/test/harness_common.c | 2 +- 3 files changed, 70 insertions(+), 19 deletions(-) diff --git a/query_classifier/query_classifier.cc b/query_classifier/query_classifier.cc index 9eb33ab82..f98a08d9b 100644 --- a/query_classifier/query_classifier.cc +++ b/query_classifier/query_classifier.cc @@ -1118,7 +1118,8 @@ char** skygw_get_table_names(GWBUF* querybuf, int* tblsize, bool fullnames) lex->current_select = lex->current_select->next_select_in_list(); } /*< while(lex->current_select) */ retblock: - *tblsize = i; + if(tblsize) + *tblsize = i; return tables; } @@ -1229,6 +1230,7 @@ inline void add_str(char** buf, int* buflen, int* bufsize, char* str) } if(*buflen > 0){ + if(*buf) strcat(*buf," "); } strcat(*buf,str); diff --git a/server/modules/filter/fwfilter.c b/server/modules/filter/fwfilter.c index 2a15d126f..2e2c5bd44 100644 --- a/server/modules/filter/fwfilter.c +++ b/server/modules/filter/fwfilter.c @@ -686,11 +686,13 @@ void link_rules(char* rule, FW_INSTANCE* instance) user = (USER*)calloc(1,sizeof(USER)); if(user == NULL){ + free(rulelist); return; } if((user->lock = (SPINLOCK*)malloc(sizeof(SPINLOCK))) == NULL){ free(user); + free(rulelist); return; } @@ -750,7 +752,21 @@ void parse_rule(char* rule, FW_INSTANCE* instance) RULELIST* rlist = NULL; ruledef = (RULE*)calloc(1,sizeof(RULE)); + + if(ruledef == NULL) + { + skygw_log_write(LOGFILE_ERROR,"Error : Memory allocation failed."); + goto retblock; + } + rlist = (RULELIST*)calloc(1,sizeof(RULELIST)); + + if(rlist == NULL) + { + free(ruledef); + skygw_log_write(LOGFILE_ERROR,"Error : Memory allocation failed."); + goto retblock; + } ruledef->name = strdup(tok); ruledef->type = RT_UNDEFINED; ruledef->on_queries = QUERY_OP_UNDEFINED; @@ -843,12 +859,17 @@ void parse_rule(char* rule, FW_INSTANCE* instance) } str = calloc(((tok - start) + 1),sizeof(char)); + if(str == NULL) + { + skygw_log_write_flush(LOGFILE_ERROR, "Fatal Error: malloc returned NULL."); + goto retblock; + } re = (regex_t*)malloc(sizeof(regex_t)); - if(re == NULL || str == NULL){ + if(re == NULL){ skygw_log_write_flush(LOGFILE_ERROR, "Fatal Error: malloc returned NULL."); - - return; + free(str); + goto retblock; } memcpy(str, start, (tok-start)); @@ -857,9 +878,11 @@ void parse_rule(char* rule, FW_INSTANCE* instance) skygw_log_write(LOGFILE_ERROR, "fwfilter: Invalid regular expression '%s'.", str); free(re); } - - ruledef->type = RT_REGEX; - ruledef->data = (void*) re; + else + { + ruledef->type = RT_REGEX; + ruledef->data = (void*) re; + } free(str); } @@ -929,6 +952,7 @@ createInstance(char **options, FILTER_PARAMETER **params) if ((my_instance = calloc(1, sizeof(FW_INSTANCE))) == NULL || (my_instance->lock = (SPINLOCK*)malloc(sizeof(SPINLOCK))) == NULL){ + skygw_log_write(LOGFILE_ERROR, "Memory allocation for firewall filter failed."); return NULL; } @@ -947,11 +971,23 @@ createInstance(char **options, FILTER_PARAMETER **params) for(i = 0;params[i];i++){ if(strcmp(params[i]->name, "rules") == 0){ + + if(filename) + free(filename); + filename = strdup(params[i]->value); } } - + + if(filename == NULL) + { + skygw_log_write(LOGFILE_ERROR, "Unable to find rule file for firewall filter."); + free(my_instance); + return NULL; + } + if((file = fopen(filename,"rb")) == NULL ){ + skygw_log_write(LOGFILE_ERROR, "Error while opening rule file for firewall filter."); free(my_instance); free(filename); return NULL; @@ -964,6 +1000,8 @@ createInstance(char **options, FILTER_PARAMETER **params) if(fgets(buffer,2048,file) == NULL){ if(ferror(file)){ + skygw_log_write(LOGFILE_ERROR, "Error while reading rule file for firewall filter."); + fclose(file); free(my_instance); return NULL; } @@ -971,13 +1009,13 @@ createInstance(char **options, FILTER_PARAMETER **params) if(feof(file)){ break; } - } - + } + if((nl = strchr(buffer,'\n')) != NULL && ((char*)nl - (char*)buffer) < 2048){ *nl = '\0'; } + parse_rule(buffer,my_instance); - } fclose(file); @@ -1074,16 +1112,26 @@ setDownstream(FILTER *instance, void *session, DOWNSTREAM *downstream) GWBUF* gen_dummy_error(FW_SESSION* session, char* msg) { GWBUF* buf; - char* errmsg; - DCB* dcb = session->session->client; - MYSQL_session* mysql_session = (MYSQL_session*)session->session->data; + char* errmsg; + DCB* dcb; + MYSQL_session* mysql_session; unsigned int errlen; + + if(session == NULL || session->session == NULL || + session->session->data == NULL || + session->session->client == NULL) + { + skygw_log_write_flush(LOGFILE_ERROR, "Error : Firewall filter session missing data."); + return NULL; + } + dcb = session->session->client; + mysql_session = (MYSQL_session*)session->session->data; errlen = msg != NULL ? strlen(msg) : 0; errmsg = (char*)malloc((512 + errlen)*sizeof(char)); if(errmsg == NULL){ - skygw_log_write_flush(LOGFILE_ERROR, "Fatal Error: malloc returned NULL."); + skygw_log_write_flush(LOGFILE_ERROR, "Fatal Error: Memory allocation failed."); return NULL; } @@ -1110,7 +1158,8 @@ GWBUF* gen_dummy_error(FW_SESSION* session, char* msg) } buf = modutil_create_mysql_err_msg(1,0,1141,"HY000", (const char*)errmsg); - + free(errmsg); + return buf; } @@ -1192,7 +1241,7 @@ bool rule_matches(FW_INSTANCE* my_instance, FW_SESSION* my_session, GWBUF *queue char emsg[512]; int qlen; bool is_sql, is_real, matches; - skygw_query_op_t optype; + skygw_query_op_t optype = QUERY_OP_UNDEFINED; STRLINK* strln = NULL; QUERYSPEED* queryspeed = NULL; QUERYSPEED* rule_qs = NULL; @@ -1469,7 +1518,7 @@ bool check_match_any(FW_INSTANCE* my_instance, FW_SESSION* my_session, GWBUF *qu */ bool check_match_all(FW_INSTANCE* my_instance, FW_SESSION* my_session, GWBUF *queue, USER* user) { - bool is_sql, rval; + bool is_sql, rval = 0; int qlen; char *fullquery = NULL,*ptr; diff --git a/server/modules/filter/test/harness_common.c b/server/modules/filter/test/harness_common.c index 026f46234..254add4b1 100644 --- a/server/modules/filter/test/harness_common.c +++ b/server/modules/filter/test/harness_common.c @@ -995,7 +995,7 @@ GWBUF* gen_packet(PACKET pkt) int process_opts(int argc, char** argv) { int fd, buffsize = 1024; - int rd,rdsz, rval = 0,error; + int rd,rdsz, rval = 0, error = 0; size_t fsize; char *buff = calloc(buffsize,sizeof(char)), *tok = NULL; From 39e4253c81077facf53730962c2a08451f27d0e8 Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Thu, 15 Jan 2015 15:16:22 +0200 Subject: [PATCH 03/20] Fix to bug #694, http://bugs.mariadb.com/show_bug.cgi?id=694 query_classifier.cc: set_query_type lost previous query type if the new was more restrictive. Problem was that if query is both READ and SESSION_WRITE and configuration parameter use_sql_variables_in=all was set, routing target became ambiguous. Replaced call to set_query_type with simply adding new type to type (=bit field) and checking unsupported combinations in readwritesplit.c:get_route_target. If such a case is met, a detailed error is written to error log in readwritesplit.c. mysql_client.c sees the error code and sends an error to client. Then mysql_client.c calls router's handleError which ensures that there are enough backend servers so that the session can continue. --- query_classifier/query_classifier.cc | 25 +-------- server/modules/protocol/mysql_client.c | 56 +++++++++++++++---- .../routing/readwritesplit/readwritesplit.c | 51 ++++++++++++++++- 3 files changed, 95 insertions(+), 37 deletions(-) diff --git a/query_classifier/query_classifier.cc b/query_classifier/query_classifier.cc index 9eb33ab82..52cb11881 100644 --- a/query_classifier/query_classifier.cc +++ b/query_classifier/query_classifier.cc @@ -391,29 +391,6 @@ return_here: return failp; } -/** - * Set new query type if new is more restrictive than old. - * - * Parameters: - * @param qtype Existing type - * - * @param new_type New query type - * - * @return Query type as an unsigned int value which must be casted to qtype. - * - * - * @details The implementation relies on that enumerated values correspond - * to the restrictiviness of the value. That is, smaller value means less - * restrictive, for example, QUERY_TYPE_READ is smaller than QUERY_TYPE_WRITE. - * - */ -static u_int32_t set_query_type( - u_int32_t* qtype, - u_int32_t new_type) -{ - *qtype = MAX(*qtype, new_type); - return *qtype; -} /** * Detect query type by examining parsed representation of it. @@ -817,7 +794,7 @@ static skygw_query_type_t resolve_query_type( break; } /**< switch */ /**< Set new query type */ - type |= set_query_type(&type, func_qtype); + type |= func_qtype; } #if defined(UPDATE_VAR_SUPPORT) /** diff --git a/server/modules/protocol/mysql_client.c b/server/modules/protocol/mysql_client.c index e5f96f088..2649ca776 100644 --- a/server/modules/protocol/mysql_client.c +++ b/server/modules/protocol/mysql_client.c @@ -870,18 +870,52 @@ int gw_read_client_event( } else { - modutil_send_mysql_err_packet(dcb, - 1, - 0, - 2003, - "HY000", - "Write to backend failed. Session closed."); - LOGIF(LE, (skygw_log_write_flush( - LOGFILE_ERROR, - "Error : Routing the query failed. " - "Session will be closed."))); + bool succp; + GWBUF* errbuf; - dcb_close(dcb); + /** + * Send error message indicating that routing + * failed + */ + mysql_send_custom_error( + dcb, + 1, + 0, + "Routing query to backend failed. See " + "the error log for further details."); + /** + * Create error to be sent to client if session + * can't be continued. + */ + errbuf = mysql_create_custom_error( + 1, + 0, + "Routing failed. Session is closed."); + /** + * Ensure that there are enough backends + * available. + */ + router->handleError( + router_instance, + session->router_session, + errbuf, + dcb, + ERRACT_NEW_CONNECTION, + &succp); + free(errbuf); + /** + * If there are not enough backends close + * session + */ + if (!succp) + { + LOGIF(LE, (skygw_log_write_flush( + LOGFILE_ERROR, + "Error : Routing the query failed. " + "Session will be closed."))); + + dcb_close(dcb); + } } } goto return_rc; diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index 663543a7b..055406853 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -1368,8 +1368,27 @@ static route_target_t get_route_target ( QUERY_IS_TYPE(qtype, QUERY_TYPE_ENABLE_AUTOCOMMIT) || QUERY_IS_TYPE(qtype, QUERY_TYPE_DISABLE_AUTOCOMMIT)) { - /** hints don't affect on routing */ - target = TARGET_ALL; + /** + * This is problematic query because it would be routed to all + * backends but since this is SELECT that is not possible: + * 1. response set is not handled correctly in clientReply and + * 2. multiple results can degrade performance. + */ + if (QUERY_IS_TYPE(qtype, QUERY_TYPE_READ)) + { + LOGIF(LE, (skygw_log_write_flush( + LOGFILE_ERROR, + "Warning : The query can't be routed to all " + "backend servers because it includes SELECT and " + "SQL variable modifications which is not supported. " + "Set use_sql_variables_in=master or split the " + "query to two, where SQL variable modifications " + "are done in the first and the SELECT in the " + "second one."))); + + target = TARGET_MASTER; + } + target |= TARGET_ALL; } /** * Hints may affect on routing of the following queries @@ -2139,6 +2158,34 @@ static bool route_single_stmt( if (TARGET_IS_ALL(route_target)) { + /** Multiple, conflicting routing target. Return error */ + if (TARGET_IS_MASTER(route_target) || + TARGET_IS_SLAVE(route_target)) + { + char* query_str = modutil_get_query(querybuf); + char* qtype_str = skygw_get_qtype_str(qtype); + + LOGIF(LE, (skygw_log_write_flush( + LOGFILE_ERROR, + "Error: Can't route %s:%s:\"%s\". SELECT with " + "session data modification is not supported " + "if configuration parameter " + "use_sql_variables_in=all .", + STRPACKETTYPE(packet_type), + qtype_str, + (query_str == NULL ? "(empty)" : query_str)))); + + LOGIF(LT, (skygw_log_write(LOGFILE_TRACE, + "Unable to route the query " + "without losing session data " + "modification from other " + "servers. <"))); + + if (query_str) free (query_str); + if (qtype_str) free(qtype_str); + succp = false; + goto retblock; + } /** * It is not sure if the session command in question requires * response. Statement is examined in route_session_write. From da77da803ba48b080bab61174de19dbb4827685a Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Fri, 16 Jan 2015 11:13:42 +0200 Subject: [PATCH 04/20] Complementory fix to bug #694, http://bugs.mariadb.com/show_bug.cgi?id=694 Added new error action to router.h, added functionality to reset error flag from DCB in handleError. Error is reset before every new routing call. --- server/include/router.h | 3 +- server/modules/protocol/mysql_client.c | 42 ++++++++++++------- .../routing/readwritesplit/readwritesplit.c | 7 ++++ 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/server/include/router.h b/server/include/router.h index c3401c43a..5c2ec5913 100644 --- a/server/include/router.h +++ b/server/include/router.h @@ -68,7 +68,8 @@ typedef void *ROUTER; */ typedef enum error_action { ERRACT_NEW_CONNECTION = 0x001, - ERRACT_REPLY_CLIENT = 0x002 + ERRACT_REPLY_CLIENT = 0x002, + ERRACT_RESET = 0x004 } error_action_t; diff --git a/server/modules/protocol/mysql_client.c b/server/modules/protocol/mysql_client.c index 2649ca776..e21936aba 100644 --- a/server/modules/protocol/mysql_client.c +++ b/server/modules/protocol/mysql_client.c @@ -759,7 +759,7 @@ int gw_read_client_event( * else : write custom error to client dcb. */ if(rsession == NULL) - { + { /** COM_QUIT */ if (MYSQL_IS_COM_QUIT(payload)) { @@ -776,7 +776,7 @@ int gw_read_client_event( */ dcb_close(dcb); } - else + else { #if defined(SS_DEBUG) LOGIF(LE, (skygw_log_write_flush( @@ -843,6 +843,8 @@ int gw_read_client_event( } else { + router->handleError(NULL, NULL, NULL, dcb, ERRACT_RESET, NULL); + if (stmt_input) { /** @@ -872,17 +874,25 @@ int gw_read_client_event( { bool succp; GWBUF* errbuf; - + /** - * Send error message indicating that routing - * failed + * Create error to be sent to client if session + * can't be continued. */ - mysql_send_custom_error( - dcb, + errbuf = mysql_create_custom_error( 1, 0, - "Routing query to backend failed. See " - "the error log for further details."); + "Routing query to backend failed. See " + "the error log for further details."); + + router->handleError( + router_instance, + session->router_session, + errbuf, + dcb, + ERRACT_REPLY_CLIENT, + &succp); + free(errbuf); /** * Create error to be sent to client if session * can't be continued. @@ -896,12 +906,12 @@ int gw_read_client_event( * available. */ router->handleError( - router_instance, - session->router_session, - errbuf, - dcb, - ERRACT_NEW_CONNECTION, - &succp); + router_instance, + session->router_session, + errbuf, + dcb, + ERRACT_NEW_CONNECTION, + &succp); free(errbuf); /** * If there are not enough backends close @@ -1587,7 +1597,7 @@ static int route_by_statement( goto return_rc; } } - while (*p_readbuf != NULL); + while (rc == 1 && *p_readbuf != NULL); return_rc: return rc; diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index 055406853..7832c0b46 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -4407,6 +4407,13 @@ static void handleError ( CHK_DCB(backend_dcb); + /** Reset error handle flag from a given DCB */ + if (action == ERRACT_RESET) + { + backend_dcb->dcb_errhandle_called = false; + return; + } + /** Don't handle same error twice on same DCB */ if (backend_dcb->dcb_errhandle_called) { From 113ea8381b5330c4076ff5fef4f3586159700a62 Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Fri, 16 Jan 2015 11:56:20 +0200 Subject: [PATCH 05/20] Complamentary fix to #694, added error flag reset to readconnrouter as well. --- server/modules/routing/readconnroute.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/modules/routing/readconnroute.c b/server/modules/routing/readconnroute.c index 6fb2a0098..6d772b30d 100644 --- a/server/modules/routing/readconnroute.c +++ b/server/modules/routing/readconnroute.c @@ -838,6 +838,13 @@ static void handleError( DCB *client_dcb; SESSION *session = backend_dcb->session; session_state_t sesstate; + + /** Reset error handle flag from a given DCB */ + if (action == ERRACT_RESET) + { + backend_dcb->dcb_errhandle_called = false; + return; + } /** Don't handle same error twice on same DCB */ if (backend_dcb->dcb_errhandle_called) From ba84370b367d2020d0ca770d91864554cbbf735a Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Fri, 16 Jan 2015 18:12:08 +0200 Subject: [PATCH 06/20] fix type in macros.cmake --- macros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros.cmake b/macros.cmake index ade5e02be..b272fa02c 100644 --- a/macros.cmake +++ b/macros.cmake @@ -142,7 +142,7 @@ debugmsg("Search returned: ${MYSQL_DIR_LOC}") if (DEFINED EMBEDDED_LIB) if( NOT (IS_DIRECTORY ${EMBEDDED_LIB}) ) debugmsg("EMBEDDED_LIB is not a directory: ${EMBEDDED_LIB}") - if(${CMAKE_VERSION} VERSION_LESS 2.12 ) + if(${CMAKE_VERSION} VERSION_LESS 2.8.12 ) set(COMP_VAR PATH) else() set(COMP_VAR DIRECTORY) From 1a76d2d06f8ca43bf69d35b35e8d31a20cd0e73e Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Sat, 17 Jan 2015 01:24:56 +0200 Subject: [PATCH 07/20] Fix to bug #698, http://bugs.mariadb.com/show_bug.cgi?id=698 debugcmd.c:convert_arg returned zero if argument is invalid. That zero was cast to pointer. Using it caused NULL-pointer references. Changed the return value indicating about error to 0x1 which is then handled properly. --- server/modules/routing/debugcmd.c | 34 ++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/server/modules/routing/debugcmd.c b/server/modules/routing/debugcmd.c index 545aff554..1b2da40c1 100644 --- a/server/modules/routing/debugcmd.c +++ b/server/modules/routing/debugcmd.c @@ -571,7 +571,7 @@ flushlog(DCB *pdcb, char *logname) else { dcb_printf(pdcb, "Unexpected logfile name, expected " - "error, message, trace oe debug.\n"); + "error, message, trace or debug.\n"); } } @@ -666,11 +666,19 @@ SERVICE *service; case ARG_TYPE_SERVICE: if (mode == CLIM_USER || (rval = (unsigned long)strtol(arg, NULL, 0)) == 0) rval = (unsigned long)service_find(arg); - return rval; + + if (rval) + return rval; + else + return 0x1; /*< invalid argument */ case ARG_TYPE_SERVER: if (mode == CLIM_USER || (rval = (unsigned long)strtol(arg, NULL, 0)) == 0) rval = (unsigned long)server_find_by_unique_name(arg); - return rval; + + if (rval) + return rval; + else + return 0x1; /*< invalid argument */ case ARG_TYPE_DBUSERS: if (mode == CLIM_USER || (rval = (unsigned long)strtol(arg, NULL, 0)) == 0) { @@ -684,21 +692,33 @@ SERVICE *service; case ARG_TYPE_DCB: rval = (unsigned long)strtol(arg, NULL, 0); if (mode == CLIM_USER && dcb_isvalid((DCB *)rval) == 0) - rval = 0; + rval = 0x1; /*< invalid argument */ return rval; case ARG_TYPE_SESSION: rval = (unsigned long)strtol(arg, NULL, 0); if (mode == CLIM_USER && session_isvalid((SESSION *)rval) == 0) rval = 0; - return rval; + + if (rval) + return rval; + else + return 0x1; /*< invalid argument */ case ARG_TYPE_MONITOR: if (mode == CLIM_USER || (rval = (unsigned long)strtol(arg, NULL, 0)) == 0) rval = (unsigned long)monitor_find(arg); - return rval; + + if (rval) + return rval; + else + return 0x1; /*< invalid argument */ case ARG_TYPE_FILTER: if (mode == CLIM_USER || (rval = (unsigned long)strtol(arg, NULL, 0)) == 0) rval = (unsigned long)filter_find(arg); - return rval; + + if (rval) + return rval; + else + return 0x1; /*< invalid argument */ case ARG_TYPE_NUMERIC: { int i; From 8877d00695585b0db10a8c4d8856a0b07365a996 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Sat, 17 Jan 2015 18:10:23 +0200 Subject: [PATCH 08/20] Updated README --- README | 295 +++++++++++++-------------------- macros.cmake | 2 +- server/test/MaxScale_test.cnf | 1 + server/test/startmaxscale.sh | 5 - unpack_rmp.sh => unpack_rpm.sh | 2 +- 5 files changed, 118 insertions(+), 187 deletions(-) delete mode 100755 server/test/startmaxscale.sh rename unpack_rmp.sh => unpack_rpm.sh (87%) diff --git a/README b/README index 023c89ce7..047a3c11b 100644 --- a/README +++ b/README @@ -31,144 +31,70 @@ issues and communicate with the MaxScale community. Bugs can be reported in the MariaDB Corporation bugs database [bug.mariadb.com](http://bugs.mariadb.com) +\section Dependency List + +Before building MaxScale from source, make sure you have installed all the dependencies for your system. +The full list of dependencies for the most common distros: + +All RHEL, CentOS and Fedora versions: + + gcc gcc-c++ ncurses-devel bison glibc-devel cmake libgcc perl make libtool + openssl-devel libaio libaio-devel librabbitmq-devel + +RHEL 6, 7, CentOS 6, 7, Fedora: + + libedit-devel + +RHEL 7, CentOS 7: + + mariadb-devel mariadb-embedded-devel + +RHEL 5, 7, CentOS 5, 6, Fedora 19, 20 + + MariaDB-devel MariaDB-server + +Fedora 19, 20 + + systemtap-sdt-devel + +to build RPM package: + + rpm-build + +Ubuntu 14.04, Debian 'jessie' + + cmake + gcc g++ ncurses-dev bison build-essential libssl-dev libaio-dev + perl make libtool librabbitmq-dev libmariadbclient-dev + libmariadbd-dev mariadb-server + +To build DEB package: + dpkg-dev + +OpenSUSE (mariadb-devel package, build fails): + gcc gcc-c++ ncurses-devel bison glibc-devel cmake libgcc_s1 perl + make libtool libopenssl-devel libaio libaio-devel + mariadb libedit-devel librabbitmq-devel + + +If you do not wish to install the MariaDB packages you can use the bundled RPM unpacking script: + + ./unpack_rpm.sh + +This looks for MariaDB RPMs and unpacks them into the destination directory. This location +can then be passed to CMake to specify the location of the headers, libraries and other required files. + \section Building Building MaxScale -Edit the file build_gateway.inc in your MaxScale directory and set -the ROOT_PATH to the directory in which you have installed the -MaxScale source code. Set the INC_PATH/MYSQL_ROOT/MYSQL_HEADERS variables -to the location in which you have installed the developer package -for MariaDB or checked out the source code of MariaDB and the -location of your MariaDB include files. - -The include files, static embedded library and other files may come -from the RPMs packages: - -MariaDB-5.5.34-centos6-x86_64-common.rpm -MariaDB-5.5.34-centos6-x86_64-compat.rpm -MariaDB-5.5.34-centos6-x86_64-devel.rpm - -Please backup any existing my.cnf file before installing the RPMs - -Install the RPM files using: - - rpm -i MariaDB-5.5.34-centos6-x86_64-common.rpm MariaDB-5.5.34-centos6-x86_64-compat.rpm MariaDB-5.5.34-centos6-x86_64-devel.rpm - -Note, if you wish to relocate the package to avoid an existing MariaDB -or MySQL installation you will need to use the --force option in addition -to the --relocate option. - - rpm -i --force --relocate=/usr/=$PREFIX/usr/ MariaDB-5.5.34-centos6-x86_64-common.rpm MariaDB-5.5.34-centos6-x86_64-compat.rpm MariaDB-5.5.34-centos6-x86_64-devel.rpm - -You can also use the included 'unpack_rpm.sh' script to unpack the RPMs without installing them. - - ./unpack_rpm - -This README assumes $PREFIX = $HOME. - -MaxScale may be built with the embedded MariaDB library either linked -dynamically or statically. - -To build with the embedded libmysqld linked dynamically from an -existing MariaDB source setup - -set DYNLIB := Y -copy the libmysqld.so in $(HOME)/usr/lib64/dynlib - -To build with the embedded libmysqld linked statically - -If DYNLIB is not set MaxScale will be built using the static library -found in $(HOME)/usr/lib64 - -This libmysqld.a comes from the RPM or it is copied from an existing -MariaDB setup. The file embedded_priv.h is not available in the RPM -packages, please get it from an existing MariaDB setup and copy it -to one of the path in MYSQL_HEADERS - - -The ERRMSG variable points to the errmsg.sys file that is required -by the embedded library. - -Example: - - ERRMSG := $(HOME)/usr/share/mysql - - -Please note the errmsg.sys file is NOT included in the RPMs at the -current time, it must be taken from an existing MariaDB setup. The -version of the errmsg.sys file must match the version of the developer -package you are using. A version mismatch will cause the library to fail -to initialise. - -You may get the one in the 'english' folder: - -Example /usr/local/mariadb/share/english/errmsg.sys - - -Go to the MaxScale directory and do: - - make depend - -to update all the dependency files and then do: - - make - - make install - -You may set the DEST variable for the target install location, example: - - make DEST=/some/path - - make DEST=/some/path install - - -If DEST is not set the default install location is: - - DEST=$(HOME)/usr/local/skysql - -This should get you all the things built that you need. - -Other make targets are available - -clean - Removes compiled code and shared objects -install - Installs the binary and the modules in the location defined by the -make variable DEST - -ctags - Build tags files for the vi editor - -documentation - Build the doxygen documentation - -depend - Update the dependencies used by the makefiles - -Two files are required for the libmysqld library that is used within MaxScale, -errmsg,sys and a my.cnf file with the following: - -External libraries/packages required: - -openssl and openssl-devel -libaio - -Note: on CentOS 6 do: - -ln -s /lib64/libaio.so.1 /lib64/libaio.so - -[mysqld] -max_connections=4096 - -Please check errmsg.sys is found in the MaxScale install_dir DEST/MaxScale/mysql - -\section Building Building MaxScale with CMake - -You can also build MaxScale with CMake which makes the build process a bit more simple. - -All the same dependencies are required as with the normal MaxScale build with the addition of CMake -version 2.6 for regular builds and 2.8.12 or newer if you wish to generate packages. +Once you have installed all of MaxScale's dependencies you are ready to build MaxScale using CMake. CMake tries to find all the required directories and files on its own but if it can't find them or you wish to explicitly state the locations you can pass additional options to CMake by using the -D flag. To confirm the variable values, you can run CMake in interactive mode by using the -i flag or use a CMake GUI (for example, ccmake for command line). -It is highly recommended to make a separate build directory to build into. This keeps the source and build trees clean and -makes it easy to get rid of everything you built by simply deleting the build directory. +It is highly recommended to make a separate build directory to build into. +This keeps the source and build trees clean and makes it easy to get rid +of everything you built by simply deleting the build directory. To build MaxScale using CMake: @@ -184,30 +110,61 @@ To build MaxScale using CMake: make install -This generates the required makefiles in the current directory, compiles and links all the programs and installs +This generates the required makefiles in the current directory, compiles +and links all the programs and installs all the required files in their right places. -If you have your headers and libraries in non-standard locations, you can define those locations at configuration time as such: +If you have your headers and libraries in non-standard locations, you can +define those locations at configuration time as such: cmake -D= -By default, MaxScale installs to '/usr/local/skysql/maxscale' and places init.d scripts and ldconfig files into their folders. Change the INSTALL_DIR -variable to your desired installation directory and set INSTALL_SYSTEM_FILES=N to prevent the init.d script and ldconfig file installation. -If you run into any trouble while configuring CMake, you can always remove the 'CMakeCache.txt' file to clear CMake's -internal cache. This resets all values to their defaults and can be used to fix a 'stuck' configuration of CMake. This -is also a good reason why you should always build into a separate directory, because you can safely wipe the build directory clean without the -danger of deleting important files when something goes wrong. +This libmysqld.a comes from the RPM or it is copied from an existing +MariaDB setup. The file embedded_priv.h is not available in the RPM +packages, please get it from an existing MariaDB setup and copy it +to one of the path in MYSQL_HEADERS -The default values that CMake uses can be found in the 'macros.cmake' file. If you wish to change these, edit the 'macros.cmake' file -or define the variables manually at configuration time. +The ERRMSG variable points to the errmsg.sys file that is required +by the embedded library. If you unpacked the RPMs using the script +you need to provide the location of the errmsg.sys file when you +are configuring the build system. + +Example: + + cmake -DERRMSG=/home/user/share/english/errmsg.sys .. + + +Please note the errmsg.sys file is NOT included in the RPMs at the +current time, it must be taken from an existing MariaDB setup. The +version of the errmsg.sys file must match the version of the developer +package you are using. A version mismatch will cause the library to fail +to initialise. + +By default, MaxScale installs to '/usr/local/skysql/maxscale' and places init.d scripts +and ldconfig files into their folders. Change the INSTALL_DIR variable to your desired +installation directory and set INSTALL_SYSTEM_FILES=N to prevent the init.d script and +ldconfig file installation. + +If you run into any trouble while configuring CMake, you can always remove the +'CMakeCache.txt' file to clear CMake's internal cache. This resets all values to their +defaults and can be used to fix a 'stuck' configuration of CMake. This is also a good +reason why you should always build into a separate directory, because you can safely +wipe the build directory clean without the danger of deleting important files when +something goes wrong. Building 'out-of-source' also allows you to have multiple +configurations of MaxScale at the same time. + +The default values that CMake uses can be found in the 'macros.cmake' file. +If you wish to change these, edit the 'macros.cmake' file or define the +variables manually at configuration time. All the variables that control the CMake build process: INSTALL_DIR= Installation directory BUILD_TYPE= Type of the build. One of None, Debug, DebugSymbols, Optimized. (default None) - DebugSymbols enables debugging symbols, Debug enables debugging symbols and code, Optimized builds an optimized version. + DebugSymbols enables debugging symbols, Debug enables debugging symbols and code, + Optimized builds an optimized version. INSTALL_SYSTEM_FILES=[Y|N] Install startup scripts and ld configuration files EMBEDDED_LIB= Path to the embedded library location (libmysqld.a for static and libmysqld.so for dynamic) @@ -217,7 +174,6 @@ STATIC_EMBEDDED=[Y|N] Whether to link the static or the dynamic verson of the GCOV=[Y|N] Generate gcov output OLEVEL=<0-3> Level of optimization BUILD_TESTS=[Y|N] Build tests -DEPS_OK=[Y|N] Check dependencies, use N when you want to force a recheck of values DEBUG_OUTPUT=[Y|N] Produce debugging output when configuring CMake RABBITMQ_LIBRARIES= Path to RabbitMQ-C libraries RABBITMQ_HEADERS= Path to RabbitMQ-C headers @@ -235,58 +191,37 @@ modules it will search using a predescribed search path. The rules are: 2. Look in $MAXSCALE_HOME/modules -3. Look in /usr/local/skysql/MaxScale/modules +3. Look in /usr/local/skysql/maxscale/modules Configuration is read by default from the file $MAXSCALE_HOME/etc/MaxScale.cnf, /etc/MaxScale.cnf, an example file -is included in the root of the source tree. The default value of -MAXSCALE_HOME can be overriden by use of the -c flag on the command -line. This should be immediately followed by the path to the MaxScale -home directory. +is included in in the installation and can be found in the etc/ folder. +The default value of MAXSCALE_HOME can be overriden by using the -c flag +on the command line. This should be immediately followed by the path to +the MaxScale home directory. The -f flag can be used to set the name and the location of the configuration file. Without path expression the file is read from $MAXSCALE_HOME/etc directory. \section Testing Running MaxScale testsuite -To run "make testall" you need to have three mysqld servers running -on localhost: +To run "make testall" you need to have four mysqld servers running +on localhost. It assumes a master-slave replication setup with one slave and +three slaves. -* a master on port 3000, with server_id=2 -* a slave on port 3001, server_id doesn't matter -* a slave on port 3002, server_id doesn't matter +The ports to which these servers are listening and the credentials to use for testing + can be specified in the 'macros.cmake' file. On the master full privileges on the databases "test" and "FOO" are needed, on the saves SELECT permissions on test.* should be sufficient. -You can use different port numbers but you'll have to change -the server settings at the end of server/test/MaxScale_test.cnf then. - -You also always need to edit the top level test.inc file, -this file contains appropriate default values for the -test setup as described above, these are only given as -comments though ... - -You can then run the full testsuite using - - make testall - -in the top level directory. After testing has finished you -can find a full testlog in test/test_maxscale.log - -You may also find additional information in the following -component specific logs: - - utils/test/testutils.log - query_classifier/test/testqclass.log - server/test/MaxScale/log/skygw_msg1.log - server/test/MaxScale/log/skygw_err1.log - server/test/MaxScale/log/skygw_trace1.log - server/test/MaxScale/log/skygw_debug1.log - server/test/testserver.log - server/core/test/testhash.log - test/test_maxscale.log +When you run the 'make testall' target after configuring the build with CMake +a local version of MaxScale is installed into the build folder. After this a MaxScale +instance is started and the test set is executed. +After testing has finished you can find a full testlog +generated by CTest in Testing/Temporary/ directory and MaxScale's +log files in the log/ directory of the build root. */ diff --git a/macros.cmake b/macros.cmake index b272fa02c..8e3142d15 100644 --- a/macros.cmake +++ b/macros.cmake @@ -126,7 +126,7 @@ debugmsg("Search returned: ${MYSQL_DIR_LOC}") message(STATUS "Using custom errmsg.sys found at: ${ERRMSG_FILE}") endif() else() - find_file(ERRMSG_FILE errmsg.sys PATHS /usr/share/mysql /usr/local/share/mysql PATH_SUFFIXES english) + find_file(ERRMSG_FILE errmsg.sys PATHS /usr/share /usr/share/mysql /usr/local/share/mysql PATH_SUFFIXES english mysql/english) if(${ERRMSG_FILE} MATCHES "NOTFOUND") set(DEPS_OK FALSE CACHE BOOL "If all the dependencies were found.") message(FATAL_ERROR "Fatal Error: The errmsg.sys file was not found, please define the path to it by using -DERRMSG=") diff --git a/server/test/MaxScale_test.cnf b/server/test/MaxScale_test.cnf index ff6a09f24..a9bd3def7 100644 --- a/server/test/MaxScale_test.cnf +++ b/server/test/MaxScale_test.cnf @@ -92,6 +92,7 @@ type=listener service=CLI protocol=maxscaled port=6603 + [server1] type=server address=127.0.0.1 diff --git a/server/test/startmaxscale.sh b/server/test/startmaxscale.sh deleted file mode 100755 index 979034476..000000000 --- a/server/test/startmaxscale.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -killall -KILL maxscale -sleep 1 -setsid $1/maxscale $2 -exit 0 diff --git a/unpack_rmp.sh b/unpack_rpm.sh similarity index 87% rename from unpack_rmp.sh rename to unpack_rpm.sh index 4158c6a84..b25680b28 100755 --- a/unpack_rmp.sh +++ b/unpack_rpm.sh @@ -15,7 +15,7 @@ fi SOURCE=$1 DEST=$2 -FILES=$(ls $SOURCE |grep -i mariadb.*`uname -m`.*.rpm) +FILES=$(ls $SOURCE |grep -i .*mariadb.*`uname -m`.*.rpm) if [[ ! -d $DEST ]] then From 3eb686223edd17339200305dd3b438e3fd37733c Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Sat, 17 Jan 2015 18:44:49 +0200 Subject: [PATCH 09/20] Add OpenSUSE comments and link to MariaDB repository configuration instruction to README --- README | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README b/README index 047a3c11b..e29914819 100644 --- a/README +++ b/README @@ -34,6 +34,8 @@ Bugs can be reported in the MariaDB Corporation bugs database \section Dependency List Before building MaxScale from source, make sure you have installed all the dependencies for your system. +To install MariaDB packages configure MariaDB repositories for your system: + see instruction [here](https://downloads.mariadb.org/mariadb/repositories/) The full list of dependencies for the most common distros: All RHEL, CentOS and Fedora versions: @@ -68,13 +70,22 @@ Ubuntu 14.04, Debian 'jessie' perl make libtool librabbitmq-dev libmariadbclient-dev libmariadbd-dev mariadb-server +Other Ubuntu and Debian + + MariaDB embedded library have to be manually extracted from tarball: + https://downloads.mariadb.org/interstitial/mariadb-5.5.41/bintar-linux-glibc_214-x86_64/mariadb-5.5.41-linux-glibc_214-x86_64.tar.gz + for old systems with glibc < 2.14: + https://downloads.mariadb.org/interstitial/mariadb-5.5.41/bintar-linux-x86_64/mariadb-5.5.41-linux-x86_64.tar.gz + To build DEB package: dpkg-dev OpenSUSE (mariadb-devel package, build fails): gcc gcc-c++ ncurses-devel bison glibc-devel cmake libgcc_s1 perl make libtool libopenssl-devel libaio libaio-devel - mariadb libedit-devel librabbitmq-devel + libedit-devel librabbitmq-devel + MariaDB-devel MariaDB-client MariaDB-server (if zypper ask which MariaDB client should be installed 'MariaDB-client' or 'mariadb-client' + please select 'MariaDB-client') If you do not wish to install the MariaDB packages you can use the bundled RPM unpacking script: From 6d2b38d4b655ebfda61350d6ec0e58b62ea948e3 Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Sat, 17 Jan 2015 22:40:52 +0200 Subject: [PATCH 10/20] Complementary fix to #694,http://bugs.mariadb.com/show_bug.cgi?id=694 RWSplit router handles query processing errors that happened in router by sending parse error reply to client. routeQuery fails only when backend has failed. --- server/core/modutil.c | 71 ++++++++++++++++++- server/include/modutil.h | 1 + server/include/router.h | 12 ++-- server/modules/protocol/mysql_backend.c | 5 +- server/modules/protocol/mysql_client.c | 25 +------ .../routing/readwritesplit/readwritesplit.c | 28 +++++++- 6 files changed, 106 insertions(+), 36 deletions(-) diff --git a/server/core/modutil.c b/server/core/modutil.c index 33c302e7f..a622f8a64 100644 --- a/server/core/modutil.c +++ b/server/core/modutil.c @@ -32,6 +32,19 @@ #include #include #include + +/** Defined in log_manager.cc */ +extern int lm_enabled_logfiles_bitmask; +extern size_t log_ses_count[]; +extern __thread log_info_t tls_log_info; + +static void modutil_reply_routing_error( + DCB* backend_dcb, + int error, + char* state, + char* errstr); + + /** * Check if a GWBUF structure is a MySQL COM_QUERY packet * @@ -327,7 +340,7 @@ GWBUF *modutil_create_mysql_err_msg( const char *msg) { uint8_t *outbuf = NULL; - uint32_t mysql_payload_size = 0; + uint32_t mysql_payload_size = 0; uint8_t mysql_packet_header[4]; uint8_t *mysql_payload = NULL; uint8_t field_count = 0; @@ -528,7 +541,7 @@ modutil_count_signal_packets(GWBUF *reply, int use_ok, int n_found) unsigned char* ptr = (unsigned char*) reply->start; unsigned char* end = (unsigned char*) reply->end; unsigned char* prev = ptr; - int pktlen, eof = 0, err = 0, found = n_found; + int pktlen, eof = 0, err = 0; int errlen = 0, eoflen = 0; int iserr = 0, iseof = 0; while(ptr < end) @@ -583,3 +596,57 @@ modutil_count_signal_packets(GWBUF *reply, int use_ok, int n_found) return(eof + err); } + +/** + * Create parse error and EPOLLIN event to event queue of the backend DCB. + * When event is notified the error message is processed as error reply and routed + * upstream to client. + * + * @param backend_dcb DCB where event is added + * @param errstr Plain-text string error + */ +void modutil_reply_parse_error( + DCB* backend_dcb, + char* errstr) +{ + CHK_DCB(backend_dcb); + modutil_reply_routing_error(backend_dcb, 1064, "42000", errstr); +} + +/** + * Create error message and EPOLLIN event to event queue of the backend DCB. + * When event is notified the message is processed as error reply and routed + * upstream to client. + * + * @param backend_dcb DCB where event is added + * @param error SQL error number + * @param state SQL state + * @param errstr Plain-text string error + */ +static void modutil_reply_routing_error( + DCB* backend_dcb, + int error, + char* state, + char* errstr) +{ + GWBUF* buf; + CHK_DCB(backend_dcb); + + buf = modutil_create_mysql_err_msg(1, 0, error, state, errstr); + free(errstr); + + if (buf == NULL) + { + LOGIF(LE, (skygw_log_write_flush( + LOGFILE_ERROR, + "Error : Creating buffer for error message failed."))); + return; + } + /** Set flags that help router to identify session commands reply */ + gwbuf_set_type(buf, GWBUF_TYPE_MYSQL); + gwbuf_set_type(buf, GWBUF_TYPE_SESCMD_RESPONSE); + gwbuf_set_type(buf, GWBUF_TYPE_RESPONSE_END); + /** Create an incoming event for backend DCB */ + poll_add_epollin_event_to_dcb(backend_dcb, buf); + return; +} \ No newline at end of file diff --git a/server/include/modutil.h b/server/include/modutil.h index e287b080e..2ae346621 100644 --- a/server/include/modutil.h +++ b/server/include/modutil.h @@ -50,6 +50,7 @@ extern int modutil_send_mysql_err_packet(DCB *, int, int, int, const char *, con GWBUF* modutil_get_next_MySQL_packet(GWBUF** p_readbuf); GWBUF* modutil_get_complete_packets(GWBUF** p_readbuf); int modutil_MySQL_query_len(GWBUF* buf, int* nbytes_missing); +void modutil_reply_parse_error(DCB* backend_dcb, char* errstr); GWBUF *modutil_create_mysql_err_msg( int packet_number, diff --git a/server/include/router.h b/server/include/router.h index 5c2ec5913..3815253bf 100644 --- a/server/include/router.h +++ b/server/include/router.h @@ -43,6 +43,11 @@ */ typedef void *ROUTER; +typedef enum error_action { + ERRACT_NEW_CONNECTION = 0x001, + ERRACT_REPLY_CLIENT = 0x002, + ERRACT_RESET = 0x004 +} error_action_t; /** * @verbatim @@ -66,13 +71,6 @@ typedef void *ROUTER; * * @see load_module */ -typedef enum error_action { - ERRACT_NEW_CONNECTION = 0x001, - ERRACT_REPLY_CLIENT = 0x002, - ERRACT_RESET = 0x004 -} error_action_t; - - typedef struct router_object { ROUTER *(*createInstance)(SERVICE *service, char **options); void *(*newSession)(ROUTER *instance, SESSION *session); diff --git a/server/modules/protocol/mysql_backend.c b/server/modules/protocol/mysql_backend.c index c52802306..5d3939868 100644 --- a/server/modules/protocol/mysql_backend.c +++ b/server/modules/protocol/mysql_backend.c @@ -357,8 +357,7 @@ static int gw_read_backend_event(DCB *dcb) { dcb->delayq, GWBUF_LENGTH(dcb->delayq))) != NULL); } - spinlock_release(&dcb->delayqlock); - + spinlock_release(&dcb->delayqlock); { GWBUF* errbuf; bool succp; @@ -1464,7 +1463,7 @@ static int gw_change_user( rv = 0; goto retblock; } - /** Set flags that help router to identify session commans reply */ + /** Set flags that help router to identify session commands reply */ gwbuf_set_type(buf, GWBUF_TYPE_MYSQL); gwbuf_set_type(buf, GWBUF_TYPE_SESCMD_RESPONSE); gwbuf_set_type(buf, GWBUF_TYPE_RESPONSE_END); diff --git a/server/modules/protocol/mysql_client.c b/server/modules/protocol/mysql_client.c index e21936aba..b5dbb565b 100644 --- a/server/modules/protocol/mysql_client.c +++ b/server/modules/protocol/mysql_client.c @@ -865,7 +865,7 @@ int gw_read_client_event( rc = SESSION_ROUTE_QUERY(session, read_buffer); } - /** succeed */ + /** Routing succeed */ if (rc) { rc = 0; /**< here '0' means success */ @@ -874,25 +874,6 @@ int gw_read_client_event( { bool succp; GWBUF* errbuf; - - /** - * Create error to be sent to client if session - * can't be continued. - */ - errbuf = mysql_create_custom_error( - 1, - 0, - "Routing query to backend failed. See " - "the error log for further details."); - - router->handleError( - router_instance, - session->router_session, - errbuf, - dcb, - ERRACT_REPLY_CLIENT, - &succp); - free(errbuf); /** * Create error to be sent to client if session * can't be continued. @@ -903,10 +884,10 @@ int gw_read_client_event( "Routing failed. Session is closed."); /** * Ensure that there are enough backends - * available. + * available. */ router->handleError( - router_instance, + router_instance, session->router_session, errbuf, dcb, diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index 7832c0b46..4098990ec 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -1972,7 +1972,16 @@ retblock: } - +/** + * Routing function. Find out query type, backend type, and target DCB(s). + * Then route query to found target(s). + * @param inst router instance + * @param rses router session + * @param querybuf GWBUF including the query + * + * @return true if routing succeed or if it failed due to unsupported query. + * false if backend failure was encountered. + */ static bool route_single_stmt( ROUTER_INSTANCE* inst, ROUTER_CLIENT_SES* rses, @@ -2162,6 +2171,8 @@ static bool route_single_stmt( if (TARGET_IS_MASTER(route_target) || TARGET_IS_SLAVE(route_target)) { + backend_ref_t* bref = rses->rses_backend_ref; + char* query_str = modutil_get_query(querybuf); char* qtype_str = skygw_get_qtype_str(qtype); @@ -2181,9 +2192,22 @@ static bool route_single_stmt( "modification from other " "servers. <"))); + while (bref != NULL && !BREF_IS_IN_USE(bref)) + { + bref++; + } + + if (bref != NULL && BREF_IS_IN_USE(bref)) + { + modutil_reply_parse_error( + bref->bref_dcb, + strdup("Routing query to backend failed. " + "See the error log for further " + "details.")); + } if (query_str) free (query_str); if (qtype_str) free(qtype_str); - succp = false; + succp = true; goto retblock; } /** From f5d8e2366ad6daf7be14587473f762851fd348dd Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Sat, 17 Jan 2015 23:07:06 +0200 Subject: [PATCH 11/20] modutil.c:modutil_reply_routing_error: Removed GWBUF type flag setting and added flags argument to function prototype so that the caller can set necessary flags and they are then copied to GWBUF which is first created in modutil_reply_rounting_error. --- server/core/modutil.c | 33 ++++++++++--------- server/include/modutil.h | 2 +- .../routing/readwritesplit/readwritesplit.c | 7 ++-- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/server/core/modutil.c b/server/core/modutil.c index a622f8a64..bcfbb0940 100644 --- a/server/core/modutil.c +++ b/server/core/modutil.c @@ -39,10 +39,11 @@ extern size_t log_ses_count[]; extern __thread log_info_t tls_log_info; static void modutil_reply_routing_error( - DCB* backend_dcb, - int error, - char* state, - char* errstr); + DCB* backend_dcb, + int error, + char* state, + char* errstr, + uint32_t flags); /** @@ -604,13 +605,15 @@ modutil_count_signal_packets(GWBUF *reply, int use_ok, int n_found) * * @param backend_dcb DCB where event is added * @param errstr Plain-text string error + * @param flags GWBUF type flags */ void modutil_reply_parse_error( - DCB* backend_dcb, - char* errstr) + DCB* backend_dcb, + char* errstr, + uint32_t flags) { CHK_DCB(backend_dcb); - modutil_reply_routing_error(backend_dcb, 1064, "42000", errstr); + modutil_reply_routing_error(backend_dcb, 1064, "42000", errstr, flags); } /** @@ -622,12 +625,14 @@ void modutil_reply_parse_error( * @param error SQL error number * @param state SQL state * @param errstr Plain-text string error + * @param flags GWBUF type flags */ static void modutil_reply_routing_error( - DCB* backend_dcb, - int error, - char* state, - char* errstr) + DCB* backend_dcb, + int error, + char* state, + char* errstr, + uint32_t flags) { GWBUF* buf; CHK_DCB(backend_dcb); @@ -642,10 +647,8 @@ static void modutil_reply_routing_error( "Error : Creating buffer for error message failed."))); return; } - /** Set flags that help router to identify session commands reply */ - gwbuf_set_type(buf, GWBUF_TYPE_MYSQL); - gwbuf_set_type(buf, GWBUF_TYPE_SESCMD_RESPONSE); - gwbuf_set_type(buf, GWBUF_TYPE_RESPONSE_END); + /** Set flags that help router to process reply correctly */ + gwbuf_set_type(buf, flags); /** Create an incoming event for backend DCB */ poll_add_epollin_event_to_dcb(backend_dcb, buf); return; diff --git a/server/include/modutil.h b/server/include/modutil.h index 2ae346621..28abc1686 100644 --- a/server/include/modutil.h +++ b/server/include/modutil.h @@ -50,7 +50,7 @@ extern int modutil_send_mysql_err_packet(DCB *, int, int, int, const char *, con GWBUF* modutil_get_next_MySQL_packet(GWBUF** p_readbuf); GWBUF* modutil_get_complete_packets(GWBUF** p_readbuf); int modutil_MySQL_query_len(GWBUF* buf, int* nbytes_missing); -void modutil_reply_parse_error(DCB* backend_dcb, char* errstr); +void modutil_reply_parse_error(DCB* backend_dcb, char* errstr, uint32_t flags); GWBUF *modutil_create_mysql_err_msg( int packet_number, diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index 4098990ec..9cd1b67d3 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -2178,7 +2178,7 @@ static bool route_single_stmt( LOGIF(LE, (skygw_log_write_flush( LOGFILE_ERROR, - "Error: Can't route %s:%s:\"%s\". SELECT with " + "Error : Can't route %s:%s:\"%s\". SELECT with " "session data modification is not supported " "if configuration parameter " "use_sql_variables_in=all .", @@ -2198,12 +2198,13 @@ static bool route_single_stmt( } if (bref != NULL && BREF_IS_IN_USE(bref)) - { + { modutil_reply_parse_error( bref->bref_dcb, strdup("Routing query to backend failed. " "See the error log for further " - "details.")); + "details."), + 0); } if (query_str) free (query_str); if (qtype_str) free(qtype_str); From 3af1e895c7a8d0367c9ffda790f2ee3ce32bdbcf Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Sun, 18 Jan 2015 05:20:05 +0200 Subject: [PATCH 12/20] Updated SETUP contents, fixed CMAKE_INSTALL_PREFIX not affecting the install destination and added a WITHOUT_MAXADMIN flag. --- CMakeLists.txt | 11 +++++++++-- SETUP | 19 ++++++++----------- macros.cmake | 3 --- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0156fc6ed..63ea87811 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,12 @@ enable_testing() set_variables() set_maxscale_version() -set(CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "Prefix prepended to install directories." FORCE) +set(CMAKE_INSTALL_PREFIX "/usr/local/skysql/maxscale" CACHE PATH "Prefix prepended to install directories.") + +#for backwards compability with previous build, to be deprecated +if(INSTALL_DIR) + set(CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "Prefix prepended to install directories." FORCE) +endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/") @@ -100,7 +105,9 @@ add_subdirectory(utils) add_subdirectory(log_manager) add_subdirectory(query_classifier) add_subdirectory(server) -add_subdirectory(client) +if(NOT WITHOUT_MAXADMIN) + add_subdirectory(client) +endif() if(BUILD_RABBITMQ) find_package(RabbitMQ) add_subdirectory(rabbitmq_consumer) diff --git a/SETUP b/SETUP index c27c9a77c..4e51bef5d 100644 --- a/SETUP +++ b/SETUP @@ -8,29 +8,26 @@ in the README file and execute make install. Simply set the environment variable MAXSCALE_HOME to point to the MaxScale directory, found inside the path into which the files have been copied, -e.g. MAXSCALE_HOME=/usr/local/skysql/maxscale/MaxScale +e.g. MAXSCALE_HOME=/usr/local/skysql/maxscale Also you will need to optionaly set LD_LIBRARY_PATH to include the 'lib' folder, found inside the path into which the files have been copied, e.g. LD_LIBRARY_PATH=/usr/local/skysql/maxscale/lib -Because we need the libmysqld library for parsing we must create a -valid my.cnf file to enable the library to be used. Copy the my.cnf -to $MAXSCALE_HOME/mysql/my.cnf. - To start MaxScale execute the command 'maxscale' from the bin folder, -e.g. /usr/local/skysql/maxscale/bin/maxscale +e.g. /usr/local/skysql/maxscale/bin/maxscale or by using the +installed init.d script. Configuration -You need to edit the file MaxScale.cnf in $MAXSCALE_HOME/etc, you should -define the set of server definitions you require, with the addresses +You need to create and edit the file MaxScale.cnf in $MAXSCALE_HOME/etc. +You should define the set of server definitions you require, with the addresses and ports of those servers. Also define the listening ports for your various services. -In order to view the internal activity of the gateway you can telnet to +In order to view the internal activity of MaxScale you can telnet to the port defined for the telnet listener. Initially you may login with the user name of "admin" and the password "skysql". Once connected type help for an overview of the commands and help for the more -detailed help on commands. Use the add user command to add a new user, -this will also remove the admin/skysql user. +detailed help on commands. Use the 'add user' command to add a new user +which will also remove the admin/skysql user. diff --git a/macros.cmake b/macros.cmake index 8e3142d15..e3df7e2c5 100644 --- a/macros.cmake +++ b/macros.cmake @@ -17,9 +17,6 @@ endmacro() macro(set_variables) - # Installation directory - set(INSTALL_DIR "/usr/local/skysql/maxscale/" CACHE PATH "MaxScale installation directory.") - # Build type set(BUILD_TYPE "None" CACHE STRING "Build type, possible values are:None, Debug, DebugSymbols, Optimized.") From e79ea8bc3ebd92085395e69abc0c72a8923f5085 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Sun, 18 Jan 2015 05:29:37 +0200 Subject: [PATCH 13/20] Removed INSTALL_DIR due to bug 689 being fixed and updated README to use 'cmake -LH' instead of listing the variables. --- CMakeLists.txt | 6 ------ README | 22 ++-------------------- macros.cmake | 44 -------------------------------------------- 3 files changed, 2 insertions(+), 70 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63ea87811..c1160bae0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,12 +9,6 @@ set_maxscale_version() set(CMAKE_INSTALL_PREFIX "/usr/local/skysql/maxscale" CACHE PATH "Prefix prepended to install directories.") -#for backwards compability with previous build, to be deprecated -if(INSTALL_DIR) - set(CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "Prefix prepended to install directories." FORCE) -endif() - - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/") project(MaxScale) diff --git a/README b/README index e29914819..d894bf1ec 100644 --- a/README +++ b/README @@ -169,27 +169,9 @@ The default values that CMake uses can be found in the 'macros.cmake' file. If you wish to change these, edit the 'macros.cmake' file or define the variables manually at configuration time. -All the variables that control the CMake build process: +To display all CMake variables with their descriptions: -INSTALL_DIR= Installation directory - -BUILD_TYPE= Type of the build. One of None, Debug, DebugSymbols, Optimized. (default None) - DebugSymbols enables debugging symbols, Debug enables debugging symbols and code, - Optimized builds an optimized version. - -INSTALL_SYSTEM_FILES=[Y|N] Install startup scripts and ld configuration files -EMBEDDED_LIB= Path to the embedded library location (libmysqld.a for static and libmysqld.so for dynamic) -MYSQL_DIR= Path to MySQL headers -ERRMSG= Path to errmsg.sys file -STATIC_EMBEDDED=[Y|N] Whether to link the static or the dynamic verson of the library -GCOV=[Y|N] Generate gcov output -OLEVEL=<0-3> Level of optimization -BUILD_TESTS=[Y|N] Build tests -DEBUG_OUTPUT=[Y|N] Produce debugging output when configuring CMake -RABBITMQ_LIBRARIES= Path to RabbitMQ-C libraries -RABBITMQ_HEADERS= Path to RabbitMQ-C headers -MYSQLCLIENT_LIBRARIES= Path to MySQL client libraries -MYSQLCLIENT_HEADERS= Path to MySQL client headers + cmake -LH \section Running Running MaxScale diff --git a/macros.cmake b/macros.cmake index e3df7e2c5..c1cc18c7d 100644 --- a/macros.cmake +++ b/macros.cmake @@ -212,53 +212,9 @@ debugmsg("Search returned: ${MYSQL_DIR_LOC}") unset(DEB_FNC) unset(RPM_FNC) - #Find the MySQL client library -# find_library(MYSQLCLIENT_LIBRARIES NAMES mysqlclient PATH_SUFFIXES mysql mariadb) -# if(${MYSQLCLIENT_LIBRARIES} MATCHES "NOTFOUND") -# set(MYSQLCLIENT_FOUND FALSE CACHE INTERNAL "") -# message(STATUS "Cannot find MySQL client library: Login tests disabled.") -# else() -# set(MYSQLCLIENT_FOUND TRUE CACHE INTERNAL "") -# message(STATUS "Found MySQL client library: ${MYSQLCLIENT_LIBRARIES}") -# endif() - #Check RabbitMQ headers and libraries if(BUILD_RABBITMQ) find_package(RabbitMQ) -# include(CheckCSourceCompiles) -# -# if(DEFINED RABBITMQ_LIB) -# find_library(RMQ_LIB rabbitmq PATHS ${RABBITMQ_LIB} NO_DEFAULT_PATH) -# else() -# find_library(RMQ_LIB rabbitmq) -# endif() -# if(RMQ_LIB MATCHES "NOTFOUND") -# set(DEPS_OK FALSE CACHE BOOL "If all the dependencies were found.") -# message(FATAL_ERROR "Cannot find RabbitMQ libraries, please define the path to the libraries with -DRABBITMQ_LIB=") -# else() -# set(RABBITMQ_LIB ${RMQ_LIB} CACHE PATH "Path to RabbitMQ libraries" FORCE) -# message(STATUS "Using RabbitMQ libraries found at: ${RABBITMQ_LIB}") -# endif() -# -# if(DEFINED RABBITMQ_HEADERS) -# find_file(RMQ_HEADERS amqp.h PATHS ${RABBITMQ_HEADERS} NO_DEFAULT_PATH) -# else() -# find_file(RMQ_HEADERS amqp.h) -# endif() -# if(RMQ_HEADERS MATCHES "NOTFOUND") -# set(DEPS_OK FALSE CACHE BOOL "If all the dependencies were found.") -# message(FATAL_ERROR "Cannot find RabbitMQ headers, please define the path to the headers with -DRABBITMQ_HEADERS=") -# else() -# set(RABBITMQ_HEADERS ${RMQ_HEADERS} CACHE PATH "Path to RabbitMQ headers" FORCE) -# message(STATUS "Using RabbitMQ headers found at: ${RABBITMQ_HEADERS}") -# endif() -# -# set(CMAKE_REQUIRED_INCLUDES ${RABBITMQ_HEADERS}) -# check_c_source_compiles("#include \n int main(){if(AMQP_DELIVERY_PERSISTENT){return 0;}return 1;}" HAVE_RMQ50) -# if(NOT HAVE_RMQ50) -# message(FATAL_ERROR "Old version of RabbitMQ-C library found. Version 0.5 or newer is required.") -# endif() -# endif() endmacro() From 66db37341d1a6eb57c401a054821187d5c693a06 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Sun, 18 Jan 2015 05:55:29 +0200 Subject: [PATCH 14/20] Updates all references to INSTALL_DIR with CMAKE_INSTALL_PREFIX. --- CMakeLists.txt | 6 +++--- README | 2 +- etc/init.d/maxscale.in | 2 +- etc/ubuntu/init.d/maxscale.in | 2 +- maxscale.conf.in | 4 ++-- server/core/gateway.c | 2 +- server/test/MaxScale_test.cnf | 2 -- 7 files changed, 9 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1160bae0..743c52736 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,13 +176,13 @@ endif() add_custom_target(buildtests - COMMAND ${CMAKE_COMMAND} -DDEPS_OK=Y -DBUILD_TESTS=Y -DBUILD_TYPE=Debug -DINSTALL_DIR=${CMAKE_BINARY_DIR} -DINSTALL_SYSTEM_FILES=N ${CMAKE_SOURCE_DIR} + COMMAND ${CMAKE_COMMAND} -DDEPS_OK=Y -DBUILD_TESTS=Y -DBUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} -DINSTALL_SYSTEM_FILES=N ${CMAKE_SOURCE_DIR} COMMAND make COMMENT "Building test suite..." VERBATIM ) add_custom_target(testall - COMMAND ${CMAKE_COMMAND} -DDEPS_OK=Y -DBUILD_TESTS=Y -DBUILD_TYPE=Debug -DINSTALL_DIR=${CMAKE_BINARY_DIR} -DINSTALL_SYSTEM_FILES=N ${CMAKE_SOURCE_DIR} + COMMAND ${CMAKE_COMMAND} -DDEPS_OK=Y -DBUILD_TESTS=Y -DBUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} -DINSTALL_SYSTEM_FILES=N ${CMAKE_SOURCE_DIR} COMMAND make install COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/server/test/MaxScale_test.cnf ${CMAKE_BINARY_DIR}/etc/MaxScale.cnf COMMAND /bin/sh -c "${CMAKE_BINARY_DIR}/bin/maxscale -c ${CMAKE_BINARY_DIR} &>/dev/null" @@ -216,7 +216,7 @@ endif() # Testall target with Valgrind if(VALGRIND_FOUND) add_custom_target(testall-valgrind - COMMAND ${CMAKE_COMMAND} -DDEPS_OK=Y -DBUILD_TESTS=Y -DBUILD_TYPE=Debug -DINSTALL_DIR=${CMAKE_BINARY_DIR} -DINSTALL_SYSTEM_FILES=N ${CMAKE_SOURCE_DIR} + COMMAND ${CMAKE_COMMAND} -DDEPS_OK=Y -DBUILD_TESTS=Y -DBUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} -DINSTALL_SYSTEM_FILES=N ${CMAKE_SOURCE_DIR} COMMAND make install COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/server/test/MaxScale_test.cnf ${CMAKE_BINARY_DIR}/etc/MaxScale.cnf COMMAND /bin/sh -c "valgrind --track-fds=yes --leak-check=full --show-leak-kinds=all --log-file=${CMAKE_BINARY_DIR}/valgrind.log ${CMAKE_BINARY_DIR}/bin/maxscale -c ${CMAKE_BINARY_DIR} &>/dev/null" diff --git a/README b/README index d894bf1ec..583f9d26a 100644 --- a/README +++ b/README @@ -153,7 +153,7 @@ package you are using. A version mismatch will cause the library to fail to initialise. By default, MaxScale installs to '/usr/local/skysql/maxscale' and places init.d scripts -and ldconfig files into their folders. Change the INSTALL_DIR variable to your desired +and ldconfig files into their folders. Change the CMAKE_INSTALL_PREFIX variable to your desired installation directory and set INSTALL_SYSTEM_FILES=N to prevent the init.d script and ldconfig file installation. diff --git a/etc/init.d/maxscale.in b/etc/init.d/maxscale.in index 00c9777aa..88f026e18 100755 --- a/etc/init.d/maxscale.in +++ b/etc/init.d/maxscale.in @@ -21,7 +21,7 @@ # MaxScale HOME, PIDFILE, LIB ############################################# -export MAXSCALE_HOME=@INSTALL_DIR@ +export MAXSCALE_HOME=@CMAKE_INSTALL_PREFIX@ export MAXSCALE_PIDFILE=$MAXSCALE_HOME/log/maxscale.pid export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MAXSCALE_HOME/lib diff --git a/etc/ubuntu/init.d/maxscale.in b/etc/ubuntu/init.d/maxscale.in index 3610b8fd9..269f88638 100755 --- a/etc/ubuntu/init.d/maxscale.in +++ b/etc/ubuntu/init.d/maxscale.in @@ -21,7 +21,7 @@ # MaxScale HOME, PIDFILE, LIB ############################################# -export MAXSCALE_HOME=@INSTALL_DIR@ +export MAXSCALE_HOME=@CMAKE_INSTALL_PREFIX@ export MAXSCALE_PIDFILE=$MAXSCALE_HOME/log/maxscale.pid export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MAXSCALE_HOME/lib diff --git a/maxscale.conf.in b/maxscale.conf.in index 0283479f1..d369e24ee 100644 --- a/maxscale.conf.in +++ b/maxscale.conf.in @@ -1,2 +1,2 @@ -@INSTALL_DIR@/modules -@INSTALL_DIR@/lib +@CMAKE_INSTALL_PREFIX@/modules +@CMAKE_INSTALL_PREFIX@/lib diff --git a/server/core/gateway.c b/server/core/gateway.c index a32c83a9a..2508ef78b 100644 --- a/server/core/gateway.c +++ b/server/core/gateway.c @@ -1096,7 +1096,7 @@ int main(int argc, char **argv) long_options, &option_index)) != -1) { bool succp = true; - + struct option* optr = long_options; switch (opt) { case 'd': /*< Debug mode, maxscale runs in this same process */ diff --git a/server/test/MaxScale_test.cnf b/server/test/MaxScale_test.cnf index a9bd3def7..aeaea2d69 100644 --- a/server/test/MaxScale_test.cnf +++ b/server/test/MaxScale_test.cnf @@ -26,7 +26,6 @@ passwd=maxpwd max_slave_connections=100% filters=Hint - [Read Connection Router] type=service router=readconnroute @@ -54,7 +53,6 @@ type=filter module=tee service=RW Split Hint Router - [Debug Interface] type=service router=debugcli From d4d9304dab8b37b06afd23c186667e6590a52467 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Sun, 18 Jan 2015 06:08:38 +0200 Subject: [PATCH 15/20] Removed unused values. --- server/core/gateway.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/core/gateway.c b/server/core/gateway.c index 2508ef78b..e882d6412 100644 --- a/server/core/gateway.c +++ b/server/core/gateway.c @@ -1096,7 +1096,7 @@ int main(int argc, char **argv) long_options, &option_index)) != -1) { bool succp = true; - struct option* optr = long_options; + switch (opt) { case 'd': /*< Debug mode, maxscale runs in this same process */ From b2505fd660fb019b6e4de6c99c309a4c825432ff Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Sun, 18 Jan 2015 06:24:51 +0200 Subject: [PATCH 16/20] Fix to bug 683: http://bugs.mariadb.com/show_bug.cgi?id=683 Added a check for MySQL version and a warning for the user about versions older than 5.5.40. --- FindMySQLConfig.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/FindMySQLConfig.cmake b/FindMySQLConfig.cmake index a20e6dc47..377ea2912 100644 --- a/FindMySQLConfig.cmake +++ b/FindMySQLConfig.cmake @@ -2,12 +2,19 @@ # The following variables are set: # MYSQLCONFIG_FOUND - System has MySQL and the tool was found # MYSQLCONFIG_EXECUTABLE - The MySQL configuration tool executable +# MYSQL_VERSION - The MySQL version number find_program(MYSQLCONFIG_EXECUTABLE mysql_config) if(MYSQLCONFIG_EXECUTABLE MATCHES "MYSQLCONFIG_EXECUTABLE-NOTFOUND") message(FATAL_ERROR "Cannot find mysql_config.") set(MYSQLCONFIG_FOUND FALSE CACHE INTERNAL "") unset(MYSQLCONFIG_EXECUTABLE) else() + execute_process(COMMAND ${MYSQLCONFIG_EXECUTABLE} --version OUTPUT_VARIABLE MYSQL_VERSION) + string(REPLACE "\n" "" MYSQL_VERSION ${MYSQL_VERSION}) message(STATUS "mysql_config found: ${MYSQLCONFIG_EXECUTABLE}") + message(STATUS "MySQL version: ${MYSQL_VERSION}") + if(MYSQL_VERSION VERSION_LESS 5.5.40) + message(WARNING "Required MySQL version is 5.5.40 or greater.") + endif() set(MYSQLCONFIG_FOUND TRUE CACHE INTERNAL "") endif() From d45cae2ee71f7ccde655a86b826fea998c9e1887 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Sun, 18 Jan 2015 12:34:32 +0200 Subject: [PATCH 17/20] Seaprated the RabbitMQ consumer from MaxScale's build system. --- rabbitmq_consumer/CMakeLists.txt | 70 +++++-- rabbitmq_consumer/COPYRIGHT | 20 ++ rabbitmq_consumer/LICENSE | 340 +++++++++++++++++++++++++++++++ rabbitmq_consumer/SETUP | 12 ++ rabbitmq_consumer/consumer.c | 18 +- 5 files changed, 438 insertions(+), 22 deletions(-) create mode 100644 rabbitmq_consumer/COPYRIGHT create mode 100644 rabbitmq_consumer/LICENSE create mode 100644 rabbitmq_consumer/SETUP diff --git a/rabbitmq_consumer/CMakeLists.txt b/rabbitmq_consumer/CMakeLists.txt index 20ab2a46e..170c19e01 100644 --- a/rabbitmq_consumer/CMakeLists.txt +++ b/rabbitmq_consumer/CMakeLists.txt @@ -1,19 +1,63 @@ -if(RABBITMQ_FOUND AND MYSQLCLIENT_FOUND) +cmake_minimum_required(VERSION 2.6) +include(../macros.cmake) +enable_testing() +set_variables() +set(CMAKE_INSTALL_PREFIX "/usr/local/skysql/rabbitmq-consumer" CACHE PATH "Prefix prepended to install directories.") +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../") - include_directories(${MYSQLCLIENT_HEADERS}) - add_executable (consumer consumer.c) +project("RabbitMQ Consumer") - if(MYSQLCLIENT_FOUND) - target_link_libraries(consumer ${MYSQLCLIENT_LIBRARIES} rabbitmq inih) - elseif(MYSQLCLIENT_STATIC_FOUND) - target_link_libraries(consumer ${MYSQLCLIENT_STATIC_LIBRARIES} rabbitmq inih) + +find_package(RabbitMQ) +find_package(MySQLClient) + +set(CMAKE_C_FLAGS "-Wall -fPIC") +set(CMAKE_CXX_FLAGS "-Wall -fPIC") +include_directories(${MYSQLCLIENT_HEADERS}) +include_directories(inih) +add_subdirectory(inih) +add_executable (consumer consumer.c) + +if(MYSQLCLIENT_FOUND) + target_link_libraries(consumer ${MYSQLCLIENT_LIBRARIES} rabbitmq inih ssl crypt crypto dl z m pthread) +elseif(MYSQLCLIENT_STATIC_FOUND) + target_link_libraries(consumer ${MYSQLCLIENT_STATIC_LIBRARIES} rabbitmq inih ssl crypt crypto dl z m pthread) +endif() + +install(TARGETS consumer DESTINATION bin) +install(FILES consumer.cnf DESTINATION etc) + +if(${CMAKE_VERSION} VERSION_LESS 2.8.12) + message(WARNING "CMake version is ${CMAKE_VERSION}. Building of packages requires version 2.8.12 or greater.") +else() + # See if we are on a RPM-capable or DEB-capable system + find_program(RPMBUILD rpmbuild) + find_program(DEBBUILD dpkg-buildpackage) + set(CPACK_GENERATOR "TGZ") + if(NOT ( ${RPMBUILD} STREQUAL "RPMBUILD-NOTFOUND" ) ) + message(STATUS "Generating RPM packages") + set(CPACK_GENERATOR "${CPACK_GENERATOR};RPM") endif() - install(TARGETS consumer DESTINATION bin) - install(FILES consumer.cnf DESTINATION etc) - -else() - - message(FATAL_ERROR "Error: Can not find requred libraries and headers: librabbitmq libmysqlclient") + if(NOT ( ${DEBBUILD} STREQUAL "DEBBUILD-NOTFOUND" ) ) + set(CPACK_GENERATOR "${CPACK_GENERATOR};DEB") + execute_process(COMMAND dpgk --print-architecture OUTPUT_VARIABLE DEB_ARCHITECTURE) + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${DEB_ARCHITECTURE}) + set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) + message(STATUS "Generating DEB packages for ${DEB_ARCHITECTURE}") + endif() + set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "RabbitMQ Consumer") + set(CPACK_PACKAGE_VERSION_MAJOR "1") + set(CPACK_PACKAGE_VERSION_MINOR "0") + set(CPACK_PACKAGE_VERSION_PATCH "0") + set(CPACK_PACKAGE_CONTACT "MariaDB Corporation Ab") + set(CPACK_PACKAGE_FILE_NAME "rabbitmq-consumer-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") + set(CPACK_PACKAGE_NAME "rabbitmq-consumer") + set(CPACK_PACKAGE_VENDOR "MariaDB Corporation Ab") + set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + set(CPACK_RPM_PACKAGE_NAME "rabbitmq-consumer") + set(CPACK_RPM_PACKAGE_VENDOR "MariaDB Corporation Ab") + set(CPACK_RPM_PACKAGE_LICENSE "GPLv2") + include(CPack) endif() diff --git a/rabbitmq_consumer/COPYRIGHT b/rabbitmq_consumer/COPYRIGHT new file mode 100644 index 000000000..83c3e4f14 --- /dev/null +++ b/rabbitmq_consumer/COPYRIGHT @@ -0,0 +1,20 @@ +This source code is distributed as part of MariaDB Corporation MaxScale. It is free +software: you can redistribute it and/or modify it under the terms of the +GNU General Public License as published by the Free Software Foundation, +version 2. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 51 +Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Copyright MariaDB Corporation Ab 2013 + +MariaDB Corporation Corporation Ab +Tekniikantie 12 +02150 Espoo +Finland diff --git a/rabbitmq_consumer/LICENSE b/rabbitmq_consumer/LICENSE new file mode 100644 index 000000000..3912109b5 --- /dev/null +++ b/rabbitmq_consumer/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/rabbitmq_consumer/SETUP b/rabbitmq_consumer/SETUP new file mode 100644 index 000000000..df2b55381 --- /dev/null +++ b/rabbitmq_consumer/SETUP @@ -0,0 +1,12 @@ +This is a fast guide to setting up the RabbitMQ Consumer. + +Configure CMake: + + cmake . + +Install: + + make install + +After installation configure the 'consumer.cnf' file. Refer to README for details +about the required values. diff --git a/rabbitmq_consumer/consumer.c b/rabbitmq_consumer/consumer.c index 75fedc786..7e9ba5ea3 100644 --- a/rabbitmq_consumer/consumer.c +++ b/rabbitmq_consumer/consumer.c @@ -115,7 +115,7 @@ int connectToServer(MYSQL* server) if(result==NULL){ - fprintf(out_fd,"Error: Could not connect to MySQL server: %s\n",mysql_error(server)); + fprintf(out_fd,"\33[31;1mError\33[0m: Could not connect to MySQL server: %s\n",mysql_error(server)); return 0; } @@ -134,18 +134,18 @@ int connectToServer(MYSQL* server) memset(qstr,0,bsz); sprintf(qstr,DB_DATABASE,c_inst->dbname); if(mysql_query(server,qstr)){ - fprintf(stderr,"Error: Could not send query MySQL server: %s\n",mysql_error(server)); + fprintf(stderr,"\33[31;1mError\33[0m: Could not send query MySQL server: %s\n",mysql_error(server)); } memset(qstr,0,bsz); sprintf(qstr,"USE %s;",c_inst->dbname); if(mysql_query(server,qstr)){ - fprintf(stderr,"Error: Could not send query MySQL server: %s\n",mysql_error(server)); + fprintf(stderr,"\33[31;1mError\33[0m: Could not send query MySQL server: %s\n",mysql_error(server)); } memset(qstr,0,bsz); sprintf(qstr,"%s",DB_TABLE); if(mysql_query(server,qstr)){ - fprintf(stderr,"Error: Could not send query MySQL server: %s\n",mysql_error(server)); + fprintf(stderr,"\33[31;1mError\33[0m: Could not send query MySQL server: %s\n",mysql_error(server)); } free(qstr); @@ -414,14 +414,14 @@ int main(int argc, char** argv) } if(amqp_socket_open(socket, c_inst->hostname, c_inst->port)){ - fprintf(stderr, "RabbitMQ Error: Cannot open socket.\n"); + fprintf(stderr, "\33[31;1mRabbitMQ Error\33[0m: Cannot open socket.\n"); goto error; } ret = amqp_login(conn, c_inst->vhost, 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, c_inst->user, c_inst->passwd); if(ret.reply_type != AMQP_RESPONSE_NORMAL){ - fprintf(stderr, "RabbitMQ Error: Cannot login to server.\n"); + fprintf(stderr, "\33[31;1mRabbitMQ Error\33[0m: Cannot login to server.\n"); goto error; } @@ -429,7 +429,7 @@ int main(int argc, char** argv) ret = amqp_get_rpc_reply(conn); if(ret.reply_type != AMQP_RESPONSE_NORMAL){ - fprintf(stderr, "RabbitMQ Error: Cannot open channel.\n"); + fprintf(stderr, "\33[31;1mRabbitMQ Error\33[0m: Cannot open channel.\n"); goto error; } @@ -458,7 +458,7 @@ int main(int argc, char** argv) if(sendMessage(&db_inst,reply)){ - fprintf(stderr,"RabbitMQ Error: Received malformed message.\n"); + fprintf(stderr,"\33[31;1mRabbitMQ Error\33[0m: Received malformed message.\n"); amqp_basic_reject(conn,channel,decoded->delivery_tag,0); amqp_destroy_message(reply); @@ -470,7 +470,7 @@ int main(int argc, char** argv) } }else{ - fprintf(stderr,"RabbitMQ Error: Received method from server: %s\n",amqp_method_name(frame.payload.method.id)); + fprintf(stderr,"\33[31;1mRabbitMQ Error\33[0m: Received method from server: %s\n",amqp_method_name(frame.payload.method.id)); all_ok = 0; goto error; } From fca674b16a5395caf455c3a249608f31a5590bc3 Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Mon, 19 Jan 2015 00:01:08 +0200 Subject: [PATCH 18/20] modutil.c: added modutil_reply_auth_error mysql_backend.c:gw_change_user: instead of setting flags directly to replybuffer, set server command to backend's protocol object and reply the message directly to backend where flags are set and it is replied back to client. --- server/core/modutil.c | 21 +++++++++++++++++++- server/include/modutil.h | 1 + server/modules/protocol/mysql_backend.c | 26 +++++++------------------ 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/server/core/modutil.c b/server/core/modutil.c index bcfbb0940..07ef9af85 100644 --- a/server/core/modutil.c +++ b/server/core/modutil.c @@ -616,6 +616,25 @@ void modutil_reply_parse_error( modutil_reply_routing_error(backend_dcb, 1064, "42000", errstr, flags); } +/** + * Create authentication error and EPOLLIN event to event queue of the backend DCB. + * When event is notified the error message is processed as error reply and routed + * upstream to client. + * + * @param backend_dcb DCB where event is added + * @param errstr Plain-text string error + * @param flags GWBUF type flags + */ +void modutil_reply_auth_error( + DCB* backend_dcb, + char* errstr, + uint32_t flags) +{ + CHK_DCB(backend_dcb); + modutil_reply_routing_error(backend_dcb, 1045, "28000", errstr, flags); +} + + /** * Create error message and EPOLLIN event to event queue of the backend DCB. * When event is notified the message is processed as error reply and routed @@ -644,7 +663,7 @@ static void modutil_reply_routing_error( { LOGIF(LE, (skygw_log_write_flush( LOGFILE_ERROR, - "Error : Creating buffer for error message failed."))); + "Error : Creating routing error message failed."))); return; } /** Set flags that help router to process reply correctly */ diff --git a/server/include/modutil.h b/server/include/modutil.h index 28abc1686..d40779c4c 100644 --- a/server/include/modutil.h +++ b/server/include/modutil.h @@ -51,6 +51,7 @@ GWBUF* modutil_get_next_MySQL_packet(GWBUF** p_readbuf); GWBUF* modutil_get_complete_packets(GWBUF** p_readbuf); int modutil_MySQL_query_len(GWBUF* buf, int* nbytes_missing); void modutil_reply_parse_error(DCB* backend_dcb, char* errstr, uint32_t flags); +void modutil_reply_auth_error(DCB* backend_dcb, char* errstr, uint32_t flags); GWBUF *modutil_create_mysql_err_msg( int packet_number, diff --git a/server/modules/protocol/mysql_backend.c b/server/modules/protocol/mysql_backend.c index 5d3939868..f7491e418 100644 --- a/server/modules/protocol/mysql_backend.c +++ b/server/modules/protocol/mysql_backend.c @@ -1451,25 +1451,13 @@ static int gw_change_user( rv = 0; goto retblock; } - /** TODO: Add custom message indicating that retry would probably help */ - buf = modutil_create_mysql_err_msg(1, 0, 1045, "28000", message); - free(message); - - if (buf == NULL) - { - LOGIF(LE, (skygw_log_write_flush( - LOGFILE_ERROR, - "Error : Creating buffer for error message failed."))); - rv = 0; - goto retblock; - } - /** Set flags that help router to identify session commands reply */ - gwbuf_set_type(buf, GWBUF_TYPE_MYSQL); - gwbuf_set_type(buf, GWBUF_TYPE_SESCMD_RESPONSE); - gwbuf_set_type(buf, GWBUF_TYPE_RESPONSE_END); - /** Create an incoming event for backend DCB */ - poll_add_epollin_event_to_dcb(backend, gwbuf_clone(buf)); - gwbuf_free(buf); + /** + * Add command to backend's protocol, create artificial reply + * packet and add it to client's read buffer. + */ + protocol_add_srv_command((MySQLProtocol*)backend->protocol, + MYSQL_COM_CHANGE_USER); + modutil_reply_auth_error(backend, message, 0); rv = 1; } else { rv = gw_send_change_user_to_backend(database, username, client_sha1, backend_protocol); From 5d1f02926010cf66621144f180b25462e5328bc4 Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Mon, 19 Jan 2015 17:55:02 +0200 Subject: [PATCH 19/20] New fix candidate to bug #698, http://bugs.mariadb.com/show_bug.cgi?id=698 client/test/maxadmin_test.sh: added new cases for testing maxadmin service.c:dListListeners:fixed NULL-pointer reference debugcli.h: replaced magic number 80 with constant integer. cli.c:execute:fixed command buffer overflow debugcmd.c:convert_arg:restored return value to 0 in case of error --- client/test/maxadmin_test.sh | 199 +++++++++++++++++++++++++++++- server/core/service.c | 5 +- server/modules/include/debugcli.h | 10 +- server/modules/routing/cli.c | 2 +- server/modules/routing/debugcmd.c | 44 ++----- 5 files changed, 217 insertions(+), 43 deletions(-) mode change 100644 => 100755 client/test/maxadmin_test.sh diff --git a/client/test/maxadmin_test.sh b/client/test/maxadmin_test.sh old mode 100644 new mode 100755 index 5540fc380..dd3acaaa9 --- a/client/test/maxadmin_test.sh +++ b/client/test/maxadmin_test.sh @@ -26,6 +26,76 @@ else echo "Auth test (long option): Passed" fi +# +# Test enable|disable heartbeat|root without, with invalid and with long invalid argument +# +for op in enable disable +do +for cmd in heartbeat root +do + maxadmin -pskysql $op $cmd >& /dev/null + if [ $? -eq "1" ]; then + echo "$op $cmd (missing arg): Failed" + failure=`expr $failure + 1` + else + passed=`expr $passed + 1` + echo "$op $cmd (missing arg): Passed" + fi + + maxadmin -pskysql $op $cmd qwerty >& /dev/null + if [ $? -eq "1" ]; then + echo "$op $cmd (invalid arg): Failed" + failure=`expr $failure + 1` + else + passed=`expr $passed + 1` + echo "$op $cmd (invalied arg): Passed" + fi + + maxadmin -pskysql $op $cmd xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >& /dev/null + if [ $? -eq "1" ]; then + echo "$op $cmd (long invalid arg): Failed" + failure=`expr $failure + 1` + else + passed=`expr $passed + 1` + echo "$op $cmd (long invalid arg): Passed" + fi +done +done + +# +# Test reload dbusers with short, and long garbage and without argument +# +maxadmin -pskysql reload dbusers qwerty >& /dev/null +if [ $? -eq "1" ]; then + echo "Reload dbusers (invalid arg): Failed" + failure=`expr $failure + 1` +else + passed=`expr $passed + 1` + echo "Reload dbusers (invalid arg): Passed" +fi + +maxadmin -pskysql reload dbusers xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >& /dev/null +if [ $? -eq "1" ]; then + echo "Reload dbusers (long invalid arg): Failed" + failure=`expr $failure + 1` +else + passed=`expr $passed + 1` + echo "Reload dbusers (long invalid arg): Passed" +fi + + +maxadmin -pskysql reload dbusers >& /dev/null +if [ $? -eq "1" ]; then + echo "Reload dbusers (missing arg): Failed" + failure=`expr $failure + 1` +else + passed=`expr $passed + 1` + echo "Reload dbusers (missing arg): Passed" +fi + +# +# Test enable|disable log debug|trace|message|error +# maxadmin -pskysql enable log debug >& /dev/null if [ $? -eq "1" ]; then echo "Enable debug log: Failed" @@ -44,6 +114,26 @@ else echo "Enable trace log: Passed" fi +maxadmin -pskysql enable log message >& /dev/null +if [ $? -eq "1" ]; then + echo "Enable message log: Failed" + failure=`expr $failure + 1` +else + passed=`expr $passed + 1` + echo "Enable message log: Passed" +fi + +maxadmin -pskysql enable log error >& /dev/null +if [ $? -eq "1" ]; then + echo "Enable error log: Failed" + failure=`expr $failure + 1` +else + passed=`expr $passed + 1` + echo "Enable error log: Passed" +fi + + + maxadmin -pskysql disable log debug >& /dev/null if [ $? -eq "1" ]; then echo "Disable debug log: Failed" @@ -62,6 +152,70 @@ else echo "Disable trace log: Passed" fi +# +# Test restart monitor|service without, with invalid and with long invalid argument +# +for cmd in monitor service +do + maxadmin -pskysql restart $cmd >& /dev/null + if [ $? -eq "1" ]; then + echo "Restart $cmd (missing arg): Failed" + failure=`expr $failure + 1` + else + passed=`expr $passed + 1` + echo "Restart $cmd (missing arg): Passed" + fi + + maxadmin -pskysql restart $cmd xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >& /dev/null + if [ $? -eq "1" ]; then + echo "Restart $cmd (long invalid arg): Failed" + failure=`expr $failure + 1` + else + passed=`expr $passed + 1` + echo "Restart $cmd (long invalid arg): Passed" + fi + + maxadmin -pskysql restart $cmd qwerty >& /dev/null + if [ $? -eq "1" ]; then + echo "Restart $cmd (invalid arg): Failed" + failure=`expr $failure + 1` + else + passed=`expr $passed + 1` + echo "Restart $cmd (invalid arg): Passed" + fi +done + +# +# Test set server qwerty master withaout, with invalid and with long invalid arg +# +maxadmin -pskysql set server qwerty >& /dev/null +if [ $? -eq "1" ]; then + echo "Set server qwerty (missing arg): Failed" + failure=`expr $failure + 1` +else + passed=`expr $passed + 1` + echo "Set server (missing arg): Passed" +fi + +maxadmin -pskysql set server qwerty mamaster >& /dev/null +if [ $? -eq "1" ]; then + echo "Set server qwerty (invalid arg): Failed" + failure=`expr $failure + 1` +else + passed=`expr $passed + 1` + echo "Set server qwerty (invalid arg): Passed" +fi + +maxadmin -pskysql set server qwerty xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >& /dev/null +if [ $? -eq "1" ]; then + echo "Set server qwerty (long invalid arg): Failed" + failure=`expr $failure + 1` +else + passed=`expr $passed + 1` + echo "Set server qwerty (long invalid arg): Passed" +fi + + for cmd in clients dcbs filters listeners modules monitors services servers sessions threads do maxadmin -pskysql list $cmd | grep -s '-' >& /dev/null @@ -112,13 +266,14 @@ fi maxadmin -pskysql set server $master maint >& /dev/null if [ $? -eq "1" ]; then - echo "set server: Failed" + echo "set server $master maint: Failed" failure=`expr $failure + 1` else passed=`expr $passed + 1` - echo "set server: Passed" + echo "set server $master maint: Passed" fi -maxadmin -pskysql list servers | grep $master | grep -s Maint >& /dev/null + +maxadmin -pskysql list servers | grep $master | grep -s 'Maint' >& /dev/null if [ $? -eq "1" ]; then echo "set maintenance mode: Failed" failure=`expr $failure + 1` @@ -126,6 +281,7 @@ else passed=`expr $passed + 1` echo "set maintenance mode: Passed" fi + maxadmin -pskysql clear server $master maint >& /dev/null if [ $? -eq "1" ]; then echo "clear server: Failed" @@ -134,7 +290,7 @@ else passed=`expr $passed + 1` echo "clear server: Passed" fi -maxadmin -pskysql list servers | grep $master | grep -s Maint >& /dev/null +maxadmin -pskysql list servers | grep $master | grep -s 'Maint' >& /dev/null if [ $? -eq "0" ]; then echo "clear maintenance mode: Failed" failure=`expr $failure + 1` @@ -156,14 +312,45 @@ for i in $dcbs do maxadmin -pskysql show dcb $i | grep -s 'listening' >& /dev/null if [ $? -eq "1" ]; then - echo "show dcb listeners: Failed" + echo "show dcb listeners: Failed" failure=`expr $failure + 1` else passed=`expr $passed + 1` - echo "show dcb listeners: Passed" + echo "show dcb listeners: Passed" fi done +# +# Test show dcb|eventq|eventstats|filter|monitor|server|service|session with invalid arg +# +for cmd in dcb eventq filter monitor server service sessions +do + maxadmin -pskysql show $cmd qwerty | grep -s '-' >& /dev/null + if [ $? -eq "0" ]; then + echo "show $cmd (invalid arg): Failed" + failure=`expr $failure + 1` + else + passed=`expr $passed + 1` + echo "show $cmd (invalid arg): Passed" + fi +done + +# +# Test shutdown monitor|service with invalid extra argument +# +for cmd in monitor service +do + maxadmin -pskysql shutdown $cmd qwerty | grep -s '-' >& /dev/null + if [ $? -eq "0" ]; then + echo "Shutdown $cmd (invalid extra arg):Failed" + failure=`expr $failure + 1` + else + passed=`expr $passed + 1` + echo "Shutdown $cmd (invalid extra arg):Passed" + fi +done + + sessions=`maxadmin -pskysql list sessions | awk -F\| '/Listener/ { if ( NF > 1 ) print $1 }'` if [ $? -eq "1" ]; then echo "Get listener sessions: Failed" diff --git a/server/core/service.c b/server/core/service.c index e0a378647..1bfa80177 100644 --- a/server/core/service.c +++ b/server/core/service.c @@ -1020,7 +1020,10 @@ SERV_PROTOCOL *lptr; ptr->name, lptr->protocol, (lptr && lptr->address) ? lptr->address : "*", lptr->port, - (lptr->listener->session->state == SESSION_STATE_LISTENER_STOPPED) ? "Stopped" : "Running" + (!lptr->listener || + !lptr->listener->session || + lptr->listener->session->state == SESSION_STATE_LISTENER_STOPPED) ? + "Stopped" : "Running" ); lptr = lptr->next; diff --git a/server/modules/include/debugcli.h b/server/modules/include/debugcli.h index 0f01da519..ed650e135 100644 --- a/server/modules/include/debugcli.h +++ b/server/modules/include/debugcli.h @@ -52,12 +52,14 @@ typedef struct cli_instance { * The CLI_SESSION structure. As CLI_SESSION is created for each user that logs into * the DEBUG CLI. */ +enum { cmdbuflen=80 }; + typedef struct cli_session { - char cmdbuf[80]; /*< The command buffer used to build up user commands */ - int mode; /*< The CLI Mode for this session */ - SESSION *session; /*< The gateway session */ + char cmdbuf[cmdbuflen]; /*< The command buffer used to build up user commands */ + int mode; /*< The CLI Mode for this session */ + SESSION *session; /*< The gateway session */ struct cli_session - *next; /*< The next pointer for the list of sessions */ + *next; /*< The next pointer for the list of sessions */ } CLI_SESSION; /* Command line interface modes */ diff --git a/server/modules/routing/cli.c b/server/modules/routing/cli.c index bd054f5a3..5f927cd3c 100644 --- a/server/modules/routing/cli.c +++ b/server/modules/routing/cli.c @@ -272,7 +272,7 @@ CLI_SESSION *session = (CLI_SESSION *)router_session; /* Extract the characters */ while (queue) { - strncat(session->cmdbuf, GWBUF_DATA(queue), GWBUF_LENGTH(queue)); + strncat(session->cmdbuf, GWBUF_DATA(queue), MIN(GWBUF_LENGTH(queue),cmdbuflen-1)); queue = gwbuf_consume(queue, GWBUF_LENGTH(queue)); } diff --git a/server/modules/routing/debugcmd.c b/server/modules/routing/debugcmd.c index 1b2da40c1..409d627dd 100644 --- a/server/modules/routing/debugcmd.c +++ b/server/modules/routing/debugcmd.c @@ -666,19 +666,13 @@ SERVICE *service; case ARG_TYPE_SERVICE: if (mode == CLIM_USER || (rval = (unsigned long)strtol(arg, NULL, 0)) == 0) rval = (unsigned long)service_find(arg); - - if (rval) - return rval; - else - return 0x1; /*< invalid argument */ + + return rval; case ARG_TYPE_SERVER: if (mode == CLIM_USER || (rval = (unsigned long)strtol(arg, NULL, 0)) == 0) rval = (unsigned long)server_find_by_unique_name(arg); - if (rval) - return rval; - else - return 0x1; /*< invalid argument */ + return rval; case ARG_TYPE_DBUSERS: if (mode == CLIM_USER || (rval = (unsigned long)strtol(arg, NULL, 0)) == 0) { @@ -686,39 +680,30 @@ SERVICE *service; if (service) return (unsigned long)(service->users); else - return 1; /*< invalid argument */ + return 0; } return rval; case ARG_TYPE_DCB: rval = (unsigned long)strtol(arg, NULL, 0); if (mode == CLIM_USER && dcb_isvalid((DCB *)rval) == 0) - rval = 0x1; /*< invalid argument */ + rval = 0; return rval; case ARG_TYPE_SESSION: rval = (unsigned long)strtol(arg, NULL, 0); if (mode == CLIM_USER && session_isvalid((SESSION *)rval) == 0) rval = 0; - if (rval) - return rval; - else - return 0x1; /*< invalid argument */ + return rval; case ARG_TYPE_MONITOR: if (mode == CLIM_USER || (rval = (unsigned long)strtol(arg, NULL, 0)) == 0) rval = (unsigned long)monitor_find(arg); - if (rval) - return rval; - else - return 0x1; /*< invalid argument */ + return rval; case ARG_TYPE_FILTER: if (mode == CLIM_USER || (rval = (unsigned long)strtol(arg, NULL, 0)) == 0) rval = (unsigned long)filter_find(arg); - if (rval) - return rval; - else - return 0x1; /*< invalid argument */ + return rval; case ARG_TYPE_NUMERIC: { int i; @@ -906,15 +891,12 @@ bool in_space = false; break; case 1: arg1 = convert_arg(cli->mode, args[2],cmds[i].options[j].arg_types[0]); - if (arg1 == 0x1) - { + + if (arg1) + cmds[i].options[j].fn(dcb, arg1); + else dcb_printf(dcb, "Invalid argument: %s\n", args[2]); - } - else - { - cmds[i].options[j].fn(dcb, arg1); - } break; case 2: arg1 = convert_arg(cli->mode, args[2],cmds[i].options[j].arg_types[0]); @@ -971,7 +953,7 @@ bool in_space = false; if (!found) dcb_printf(dcb, "Command '%s' not known, type help for a list of available commands\n", args[0]); - memset(cli->cmdbuf, 0, 80); + memset(cli->cmdbuf, 0, cmdbuflen); return 1; } From 272cd73cad88668bbed85e443f7205ff0752bd1f Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Mon, 19 Jan 2015 18:38:46 +0200 Subject: [PATCH 20/20] Fix to bug #701, http://bugs.mariadb.com/show_bug.cgi?id=701 debugcmd.c:execute_cmd:added skip counter which adjusts the starting position of next argument correctly thus avoiding cropping the latter quoted argument. --- server/modules/routing/debugcmd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/modules/routing/debugcmd.c b/server/modules/routing/debugcmd.c index 409d627dd..cf2232816 100644 --- a/server/modules/routing/debugcmd.c +++ b/server/modules/routing/debugcmd.c @@ -742,6 +742,7 @@ unsigned long arg1, arg2, arg3; int in_quotes = 0, escape_next = 0; char *ptr, *lptr; bool in_space = false; +int nskip = 0; args[0] = cli->cmdbuf; ptr = args[0]; @@ -770,6 +771,8 @@ bool in_space = false; { *lptr = 0; + lptr += nskip; + nskip = 0; if(!in_space){ break; @@ -791,11 +794,13 @@ bool in_space = false; { in_quotes = 1; ptr++; + nskip++; } else if (*ptr == '\"' && in_quotes == 1) { in_quotes = 0; ptr++; + nskip++; } else {