Commit Graph

1158 Commits

Author SHA1 Message Date
c0c9a9858d MXS-2197 Rename maxscale/log.h to maxscale/log.hh
In files either include maxscale/log.hh or remove include entirelly
as maxscale/ccdefs.hh includes it.
2018-12-10 12:58:17 +02:00
1b5b789342 MXS-2208 Move trim-functions from maxscale to maxbase
log.h now includes string.hh, which is conceptually wrong, but
log.h will shortly disappear and be superceded by log.hh.
2018-12-10 12:50:07 +02:00
d44cf7b20e MXS-2208 Allow dbfw parser to be compiled as C
maxsbase/log.h will turn into C++, but the flex and bison
generated files are by default C.
2018-12-10 12:50:07 +02:00
77477d9648 MXS-2196: Rename dcb_role_t to DCB::Role 2018-12-05 15:30:44 +02:00
9f721f725e MXS-2205 Convert maxscale/protocol/mysql.h to .hh 2018-12-05 11:12:20 +02:00
d96a7dedc5 MXS-2205 Convert maxscale/poll.h to .hh 2018-12-04 14:51:02 +02:00
ceb6094623 MXS-2196: Fix filter unit tests
Fixed the use of DCBs and sessions in the mock testing framework and
adapted them to the changes done to the objects in question. Extended the
testing utility functions to allow preloading modules as well as making it
possible to only partially initialize the query classifier.
2018-12-04 11:50:43 +02:00
43c33e9f4a MXS-2196: Allocate a session before allocating DCBs
Allocating the session before a DCB guarantees that at no point will a DCB
have a null session. This further clarifies the concept of the session and
also allows the listener reference to be moved there.

Ideally, the session itself would allocate and assign the client DCB but
since the Listener is the only one who does it, it's acceptable for now.
2018-12-04 11:50:43 +02:00
692127a2cb MXS-2196: Remove the dummy session
As each connection now immediately gets a session the dummy session is no
longer required. The next step would be to combine parts of the session
and the client DCB into one entity. This would prevent the possibility of
a client DCB with no associated session. Backend DCBs are different as
they can move from one session to another when the persistent connection
pool is in use.
2018-12-04 11:50:43 +02:00
694d4a4003 MXS-2196: Make DCB a C++ struct
Allocating DCB with new allows the use of C++ objects in the DCB
struct. Also the explicit poll field can be replaced by inheriting from
MXB_POLL_DATA.
2018-12-04 11:50:43 +02:00
ad12ff6d06 MXS-2196: Rename dcb.h to dcb.hh 2018-12-04 11:50:43 +02:00
3b5e45ceee MXS-2196: Combine session.h and session.hh
Combined the public session headers into one.
2018-12-04 11:43:38 +02:00
bb295b5cbe MXS-2196: Remove listeners from services
All access to the listeners of a service are done via the listener
functions.
2018-12-04 11:39:51 +02:00
d9ae298102 MXS-2205 Combine maxscale/server.h with maxscale/server.hh
The server-struct is still used in several .h-files.
2018-12-03 16:47:27 +02:00
5f7211aac5 MXS-2205 Combine maxscale/filter.h with maxscale/filter.hh 2018-12-03 15:28:06 +02:00
97bb7e7e1a MXS-2205 Combine maxscale/modutil.h with maxscale/modutil.hh 2018-12-03 15:28:06 +02:00
35cdbc7220 MXS-2205 Convert modulecmd.h to .hh 2018-12-03 14:06:02 +02:00
3e5818fcb6 MXS-2205 Convert mysql_utils.h to .hh 2018-12-03 14:05:21 +02:00
36792607d8 MXS-2205 Combine internal/modules.h with internal/modules.hh 2018-12-03 13:36:25 +02:00
77585bdb8c MXS-2197: Make config.h and service.h C++ headers
This is the first step into converting the other headers into C++.
2018-11-30 12:15:57 +02:00
fb533df22e MXS-2197: Compile all cache parts as C++
This is required if all headers are converted into C++ as it includes
MaxScale headers.
2018-11-30 12:15:57 +02:00
3cb3676f3e Clean up CCRFilter
Rearranges code, renames fields, uses string instead of const char etc.
2018-11-30 12:12:21 +02:00
7d4f0483a9 Use filter template in CCRFilter
Minimal changes for now, cleanup in next commit.
2018-11-30 12:12:21 +02:00
32f2e769f4 MXS-1780 Make retain_last_statements service specific 2018-11-08 12:08:42 +02:00
4daffb5e2f MXS-2147: Fix luafilter includes
The filter now correctly includes C headers.
2018-11-06 21:35:53 +02:00
11a756a028 Detect undefined references at link time
Instruct the linker to make sure all symbols are resolved at link time.
2018-11-06 21:34:28 +02:00
c10f56bea1 Fix binlogfilter build failure
The macros weren't apparently included so swapped them to explicit format
strings.
2018-10-05 11:00:08 +03:00
75ea1b6ea1 Fix formatting of new(std::nothrow)
The code previously formatted everything as `new( std::nothrow)`.
2018-10-04 21:50:44 +03:00
dbbadf1f53 Merge branch '2.2' into develop 2018-10-01 13:10:41 +03:00
c65edd1298 Enhance StopWatch
Clean up, comments and enhancements. StopWatch lap() didn't mean lap-time, but elapsed time. Changed meaning to lap-time and added split() for split-time.
2018-10-01 09:30:24 +03:00
ceb763c9be Fix buffer size in cache rules
If a database, table and a column was defined, the null terminating
character would be written past the end of the buffer.
2018-09-30 22:35:13 +03:00
77b53b0889 MXS-2067: Fix build failures
The luafilter didn't include the <mutex> header and mqfilter used the
wrong lock type.
2018-09-30 19:37:12 +03:00
9278da1f54 MXS-2067: Remove spinlock.h
Removed the spinlock.h header and replaced with plain pthread types and
functions.
2018-09-28 12:18:24 +03:00
ab4f870927 MXS-2067: Replace most SPINLOCKs
Replaced SPINLOCK with std::mutex where possible, leaving out the more
complex cases. The big offenders remaining are the binlogrouter and the
gateway.cc OpenSSL locks.
2018-09-28 12:18:23 +03:00
50451166bb MXS-2067: Remove spinlock.hh
Replaced the C++ versions with standard library mutexes.
2018-09-28 12:18:23 +03:00
a9155e9f0e MXS-701: Use the default database with query events
If a query event uses an implicit database, the filtering is now correctly
done also for those tables.
2018-09-26 09:43:24 +03:00
82b3ffdf60 MXS-701: Clean up binlogfilter
Removed unused code, ordered function definitions that declarations aren't
needed, changed functions to pass pointers to the event body instead of
the start of the protocol packet.
2018-09-26 09:43:24 +03:00
d7fab9e43a MXS-701: Make info messages more useful
The messages now tell whether an event was skipped.
2018-09-26 09:43:23 +03:00
047242a721 MXS-701: Improve binlogfilter
Added `match` and `exclude` functionality. This allows versatile filtering
without a large investment of development time by leveraging the benefits
of PCRE2 regular expressions.

Also cleaned up the filter and removed the single table matching and
active parameter that were obsoleted by the regular expression parameters.
2018-09-26 09:43:01 +03:00
71ffef5708 Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f
Add back leading operator enforcement.
2018-09-20 15:57:30 +03:00
7ec2f77708 Merge branch '2.2' into develop 2018-09-12 23:18:08 +03:00
9c08d78304 Add missing error messages
If tee filter creation fails, it would not log an error message.
2018-09-12 08:44:31 +03:00
108638b0cf Format with Uncrustify 0.67 2018-09-10 13:31:39 +03:00
d11c78ad80 Format all sources with Uncrustify
Formatted all sources and manually tuned some files to make the code look
neater.
2018-09-10 13:22:49 +03:00
03017c6aad Fix develop build failures
The macro in testrules.cc needed to be chagned to use string literals to
work correctly with uncrustify. Also change <cmath> to <math.h> in C
headers.
2018-09-10 11:34:09 +03:00
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
bb93bcdbfe Add support for ipv6 in NamedServerFilter
NamedServerFilter now uses struct sockaddr_in6 to store the source
parameter. If ipv4 addresses are used they are mapped to ipv6 struct,
this allows the usage of both ipv4 and ipv6.

This commit also includes some small refactoring and removing some code
that was not needed anymore.
2018-09-03 19:31:48 +03:00
a29851a42c MXS-2026 Use qc_init(...)/qc_end()
Use qc_init(...)/qc_end() for initializing QC in test-programs.
2018-08-29 09:47:13 +03:00
5c1a1c2700 MXS-2026 Separate QC process and thread initialization
qc_thread_init() must now explicitly be called in every thread
and not just in other threads but the one where qc_process_init()
is called.

This change was caused by QC_INIT_SELF initialization actually
being performed in query_classifier.cc. Before this change, there
actually was a leak in the routing worker running in the main
thread, the query classification cache was created twice.
2018-08-29 09:47:13 +03:00
742ebd0437 Shorten cache tests
Reducint the time the load testing runs for seems to reduce the volume by
the same amount. Given that unit tests are good for catching obvious
mistakes, the test should still be adequate.
2018-08-27 14:02:12 +03:00