122 Commits

Author SHA1 Message Date
Johan Wikman
7e36e1cbb1 Link against Connector-C.
Now, qc_mysqlembedded is linked against MySQL's embedded library,
and MaxScale itself against Connector-C.

So, in order to build MaxScale, Connector-C must be installed.
This has been tested with Connector-C 2.2.1.

The build variable MYSQLCLIENT_LIBRARIES is no longer used.
2016-01-29 16:50:31 +02:00
Johan Wikman
1f241a5ed1 Rearrange libraries and build files.
This is the first change in an attempt to arrange the linking so that
more errors are detected at link-time.

- All files in server/core but for gateway.c are linked to one shared
  library called maxscale-common.
- The files log_manager/log_manager.cc and utils/skygw_utils.cc are
  built into maxscale-common as well.
- MaxScale itself consists now only of gateway.c and is linked with
  maxscale-common.
- All plugins link with maxscale-common.
- All executables link in addition with {EMBEDDED_LIB}.

After this change, the change (MXS-517) where query_classifier is the
only component that uses ${EMBEDDED_LIB} and the rest mysqlclient can
be made much cleaner.

After a few additional steps, all shared libraries can be linked with
the linker flags "-Wl,-z,defs", which directs the linker to resolve
all symbols. That will require that all shared libraries list all the
libraries they need, but will at the same time ensure that any
missing symbols are detected at link-time and not at run-time.
2016-01-22 23:26:17 +02:00
Markus Makela
54ca1ab2de Canonicalized queries remove non-executable comments
The comments which do not alter the functionality of a query are now removed
from canonicalized queries.

Also fixed missing semicolon in the comment removal regex and added tests
for comment removal.
2016-01-11 17:14:57 +02:00
Markus Makela
8ee110efa8 Fixed canonicalization and added more tests
Fixed mistakes in the canonicalization regular expressions and altered the
functions to use a source and destination buffers. This reduces the amount
of memory allocations that take place.

Added more canonical query tests to the internal test suite.
2016-01-11 17:14:44 +02:00
Markus Makela
c067bbe34a Formatted the canonical query test.
The file is now formatted according to the style guide.
2016-01-11 17:13:01 +02:00
Markus Makela
9c9e30fa08 Fixed value replacement and added more tests for canonicalization of queries
The value replacement was not taking session or system variables into notice.
2016-01-11 17:09:40 +02:00
Markus Makela
995ed8c9d2 Improved query canonicalization
The query does not need to be parsed for it to be canonicalized and the parsing
uses the PCRE2 library. The regular expressions were changed so that only one
call to the function which replaces literal unquoted values is made.
2016-01-11 17:08:03 +02:00
Johan Wikman
4d155f70b0 Remove call to parse_query.
Not needed anymore.
2016-01-11 15:14:27 +02:00
Johan Wikman
20bc6a4ab7 Reindent canonizer.c
- Untabify
- Remove trailing whitespace.
- Allman braces.
2016-01-11 15:08:27 +02:00
Johan Wikman
23a7562d3a Replace skygw_ type prefix with qc_.
- skygw_query_type_t renamed to qc_query_type_t.
- skygw_query_op_t renamed to qc_query_op_t.
2016-01-11 12:06:21 +02:00
Johan Wikman
2f42246880 Rename query classifier functions consistently.
All public query classifier functions now have the prefix qc_.
2016-01-11 12:04:52 +02:00
Markus Makela
080a9ebc9d PCRE2 is now statically linked
Since the PCRE2 library was always going to be a part of MaxScale, there was
no real reason to have it as a shared library apart from smaller binaries.
2015-12-29 10:09:38 +02:00
Markus Makela
c1194a5ee8 Fixed test build failures. 2015-09-10 18:07:24 +03:00
Johan Wikman
160bbb70ee MXS-251: strerror
Replaces all calls to strerror with calls to strerror_r. The former
is non-thread safe while the latter is.
2015-09-05 15:52:13 +03:00
Markus Makela
15262f3fbf Added new Make target for testing MaxScale's core parts.
This target doesn't need a running MaxScale and only executes core, log_manager and query_classifier unit tests.
2015-03-19 11:56:40 +02:00
Markus Makela
a9a9a6eae5 Small fixes to log_manager and query_classifier tests. 2015-01-30 08:26:10 +02:00
Timofey Turenko
06c2d201e0 remove makefiles and other garbage 2015-01-14 19:08:24 +02:00
Markus Makela
fb9d792859 Fix to Coverity defect 76134 2014-11-13 09:02:56 +02:00
Markus Makela
9cb2be9605 Fixes to Coverity erros 75748 and 76132. 2014-11-11 13:42:12 +02:00
Markus Makela
a4caac55c8 Fixes to Coverity errors:
72662
72702
72724
73397
73410
73414
73422
75424
75748
75789
75938
75939

Also includes a fix to a bug caused by a previous Coverity error change in canonizer.c
2014-11-07 11:52:40 +02:00
Markus Makela
474f018cee Fixes to minor Coverity errors:
75424
73422
72724
72702
72662
2014-11-07 11:12:26 +02:00
Markus Makela
c4d51f54cd Fixes to Coverity bugs:
72743
73407
73408
73409
73415
73419
2014-11-06 15:40:11 +02:00
Markus Makela
17f87e29af Fixes to some Coverity issues. 2014-11-05 11:57:42 +02:00
Markus Makela
e7feba6964 Fixed canonical query tests 2014-11-03 13:00:46 +02:00
VilhoRaatikka
ca816743e8 Returned #include <my_config.h> and updated server name. 2014-11-03 11:33:41 +02:00
VilhoRaatikka
b15ac9c019 Revert to 54d389e329a860add1f609508c676761521a8ad0 due to erroneous fix. 2014-11-03 08:57:02 +02:00
VilhoRaatikka
fb02e44e7e Fix to #605, http://bugs.mariadb.com/show_bug.cgi?id=605
Main assumed multi-byte characters in memory allocation but not outside of it so I removed that code and made it consistently assume single-byte characters.
Terminating character was added always to the last byte of string buffer regardless of the length of the string. Removed it and replaced malloc with calloc.
Moved variable introductions from the middle of the function to the beginning of it.
2014-11-02 22:33:12 +02:00
VilhoRaatikka
aaa727bcc2 Fix to bug #605, http://bugs.mariadb.com/show_bug.cgi?id=605
String buffer allocation didn't allocate space for terminating char. It also assumed that character size may vary but the rest of the code didn't support multi-byte characters so I changed it consistently assume single-byte characters.
2014-11-02 22:11:28 +02:00
Markus Makela
be08f22ae1 Changed old references to SkySQL to MariaDB Corporation and Gateway to MaxScale. 2014-10-10 16:38:54 +03:00
Markus Makela
ebb3b52fdb Included the my_config.h header before any system headers if mysql headers were used. 2014-10-10 12:30:21 +03:00
Markus Makela
9a6b884ff9 Merge branch 'query_classifier_test' into develop 2014-10-09 15:36:40 +03:00
Markus Makela
4bea21f464 Merge branch 'develop' into query_classifier_test 2014-10-09 15:34:10 +03:00
Markus Makela
3cd8e29c4c Changed the way some CMake functions are used to support older versions of CMake. 2014-10-07 14:09:22 +03:00
Markus Makela
3d7c23cf0b added more test cases 2014-10-06 14:03:13 +03:00
Markus Makela
b22ab90d66 Changed the way query classifier test is run.
Now the test is a single executable, which should make it easier to use with CMake.
2014-10-04 10:19:00 +03:00
Markus Makela
3b0e3d04dc Merge branch 'develop' into query_classifier_test
Conflicts:
	README
	macros.cmake
2014-10-03 11:38:47 +03:00
Markus Makela
f4e591e382 Changed 'SkySQL Gateway' to 'MariaDB Corporation MaxScale' 2014-09-30 13:15:03 +03:00
Markus Makela
25850c056f Added tests to cmake 2014-09-25 10:14:42 +03:00
Markus Makela
1cf3fa367c test executable now works 2014-09-24 12:25:53 +03:00
Markus Makela
b0514e9d9f Merge branch 'cmake_build' into query_classifier_test 2014-09-22 14:42:12 +03:00
Markus Makela
07d1265acf test implementation 2014-09-22 14:38:55 +03:00
Markus Makela
fc848665e5 Added variables for RabbitMQ headers and libraries, added more error checks.
modified:   CMakeLists.txt
	modified:   README
	modified:   macros.cmake
	modified:   query_classifier/test/canonical_tests/CMakeLists.txt
	modified:   rabbitmq_consumer/CMakeLists.txt
	modified:   server/modules/filter/CMakeLists.txt
2014-09-22 13:14:53 +03:00
Markus Makela
8b1afbfe26 fixed tests not working with the normal 'make testall' 2014-09-16 20:02:28 +03:00
Markus Makela
0f5cfdbd1a Added dependency checks, Debian packaging and fixes to various parts of the CMake build files. 2014-09-16 15:02:43 +03:00
Markus Makela
41226692ac Merge branch 'release-1.0beta-refresh' into cmake_build 2014-09-16 12:11:17 +03:00
Mark Riddoch
c8fc5b712b Merge branch 'hholzgra-hartmut-gitignore' into release-1.0beta-refresh 2014-09-15 13:22:46 +01:00
Markus Makela
0f07c9f08c Added hint tests
Fixed readwritesplit tests looking for test input in the wrong directory
Updated the canonical query test expected output
2014-09-15 09:27:47 +03:00
Markus Makela
32b72ce474 more configuration options, README update and tests 2014-09-12 16:48:21 +03:00
Markus Makela
d8c34aabad added log manager and query classifier tests 2014-09-12 06:06:11 +03:00
Markus Makela
aafc891c9a Fixed canonical query test and mqfilter.c bugs 2014-09-05 10:58:54 +03:00