104 Commits

Author SHA1 Message Date
Markus Makela
d3da98b58f Merge branch 'MXS-544' into develop-MXS-544-merge 2016-03-03 21:39:39 +02:00
Johan Wikman
cb3213af63 server/include/poll.h renamed to server/include/maxscale/poll.h
Due to an include conflict between /usr/include/poll.h and
maxscale/server/include/poll.h the latter was moved to
maxscale/server/include/maxscale/poll.h.

Once 1.4 is out, all maxscale header files will be moved to that
same sub-directory. That will prevent include conflicts and also
make it easy to see which include files belong to maxscale and
which do not.
2016-03-01 12:56:39 +02:00
Markus Makela
b88d66357e Shard router is no longer built by default
The shardrouter module is not finished and should not be built for releases.
2016-02-29 17:18:20 +02:00
Markus Makela
bf24f18805 Merge branch 'develop' into MXS-544 2016-02-29 10:40:33 +02:00
counterpoint
395cbdc103 Simplify handling of "client data" by having a pointer to it only in DCB and not in session structure. Change name of session->client to session->client_dcb for greater clarity. Temporary free of client data in DCB, to be moved to authenticator when it becomes a module. Fix incorrect name of listener_alloc. 2016-02-23 11:13:21 +00:00
Markus Makela
cfefc046e9 Merge branch 'release-1.3.0' into develop 2016-02-11 10:23:00 +02:00
Markus Makela
9acdd4e70c Fixed tests failing to build
The tests were not linking against the maxscale-common library.
2016-02-09 10:59:11 +02:00
Johan Wikman
4a4f22c9a7 Make query_classifier part of core.
The query classifier interface is now built as an integral
part of MaxScale core.
2016-02-08 11:44:07 +02:00
Markus Makela
e7fb2640d3 Fixed authentication failing due to unknown database even though it exists
When the shard maps are being updated they are set into a stale state. This
means that one client connection is updating the shard maps and the information
in the shard map is not the most recent. This does mean that the information
is valid and authentication should succeed even if the shard map is stale.
2016-02-03 00:47:06 +02:00
Johan Wikman
fc6f49fe8a 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-02-01 15:43:05 +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
Johan Wikman
040c67127a Reindent schemarouter.c
- Untabify
- 4 space indent
- Allman + other style issues.
2016-01-12 13:54:23 +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
Johan Wikman
ec281849aa Remove explicit calls to parse_query.
Now that all query classifier functions parse the query if it
has not been parsed, there is no reason for any module to call
parse_query explicitly.
2016-01-11 10:15:13 +02:00
Markus Makela
05a7f5759b Fixed thread safety issues in schemarouter and shardrouter
Fixed strtok being used in a multithreaded context and removed unused code.
2016-01-04 18:40:00 +02:00
Markus Makela
78b5777d6e Fixes to Coverity defects
Few fixes to possible use of freed memory and resource leaks.
2015-12-15 13:13:53 +02:00
Markus Makela
d6afe70c6f Fix to MXS-323: Routers properly handle client DCB errors
All routers now detect if a client DCB is passed to handleError and
take the appropriate action.
2015-12-02 18:01:14 +02:00
Markus Makela
a829b38873 Fix to MXS-363: Added soname versions to libraries
The soname version numbers were missing from all the library targets
properties which caused ldconfig to warn about non-symlink libraries
being installed.
2015-11-30 10:46:08 +02:00
Johan Wikman
a8535f42af Remove all traces of logfile_t
The earlier log file based approach for enabling and disabling
messages has now been completely replaced with the syslog priority
based approach.

Similarly as with log files before it is now possible to enable
and disable a log priority for a particular session, even though
it apparently has not been used much.

The local test-programs of the logging has got minimal attention
only to make them compile. They should get an overhaul as they did
not work before either.
2015-11-23 19:10:53 +02:00
Johan Wikman
0413c957f8 LOGIFs removed from schemarouters. 2015-11-17 14:18:51 +02:00
Markus Makela
b828b04c05 Fixed debug assertion. 2015-11-17 09:17:29 +02:00
Markus Makela
b22d40b06b Fixed PCRE2 beng built when CMake is configured
The bundled PCRE2 library will be built as a separate target and configuring
CMake no longer builds it. Instead, it will only be built when it is out of date.
This requires all targets to declare that they depend on the pcre2 target in
order for it to be built.
2015-11-16 13:59:47 +02:00
Johan Wikman
a355e1beef Printf format checking added to logging function.
Printf format checking added to logging function and all
issues that were revealed by that fixed.
2015-11-16 12:40:49 +02:00
Markus Makela
1f15843d61 Refactored schemarouter to use the resultset.h data types and functions
The generated responses to SHOW DATABASES are now generated by using the resultset.h
data types and functions.
2015-11-16 08:39:49 +02:00
Markus Makela
30d1fc66b7 getCapabilities no longer takes arguments and returns an int. 2015-11-11 18:14:03 +02:00
counterpoint
dee20fe077 Merge remote-tracking branch 'origin/develop' into MXS-329-develop-20151111
# Conflicts:
#	server/core/CMakeLists.txt
#	server/core/buffer.c
#	server/core/service.c
#	server/modules/filter/tee.c
#	server/modules/monitor/mysql_mon.c
#	server/modules/routing/binlog/blr.c
#	server/modules/routing/binlog/blr_slave.c
#	server/modules/routing/debugcmd.c
#	server/modules/routing/readwritesplit/readwritesplit.c
#	utils/skygw_utils.cc

- resolved.
2015-11-11 11:08:02 +00:00
Johan Wikman
834a88aeda Log variables moved to log_manager.h
The log manager variables lm_enabled_log_files_bitmask, log_ses_count
and tls_log_info that earlier were declared separately in every
c-file are now declared in the log_manager.h header.
2015-11-04 14:26:53 +02:00
Markus Makela
99ac4876f4 Fixed wrong variables being passed. 2015-11-03 12:16:22 +02:00
Markus Makela
a969de7d50 Changed unnecessary strncpy to strcpy. 2015-11-03 12:16:22 +02:00
Markus Makela
3903c4a35d Renamed and moved variables around
Renamed variables to make more sense and reordered them to be more in line with
the function's purpose.
2015-11-03 12:16:22 +02:00
Markus Makela
50b0a9b71b Code changes based on review of 1e8afe5063134b7c56492b3777ae1248b1587ba4 2015-11-03 12:16:22 +02:00
Markus Makela
d5c38b93f6 Fix to MXS-431: https://mariadb.atlassian.net/browse/MXS-431
Replaced the use of the shared MySQLSession structure with an internal variable
that tracks the currently active database.
2015-11-03 12:16:22 +02:00
Markus Makela
18c53bebf1 Fix to MXS-430: https://mariadb.atlassian.net/browse/MXS-430
Added caching of the hashtables used to map databases to servers.
2015-11-03 12:16:22 +02:00
Markus Makela
c37e18e3d2 Moved included headers back to .c file 2015-10-28 15:07:50 +02:00
Markus Makela
8d84deecc5 Updated schemarouter to use PCRE2 and moved includes to the header file. 2015-10-28 15:07:50 +02:00
Markus Makela
7e1034a740 All conflicts are printed when processing databases. 2015-10-05 10:20:58 +03:00
Markus Makela
6227d9f834 Cleaned up schemarouter code. 2015-10-05 10:20:58 +03:00
Markus Makela
a576606f2b Updated schemarouter duplicate DB code based on code review. 2015-10-05 10:20:58 +03:00
Markus Makela
af2bc91383 Cleaned up the clientReply function of the schemarouter. 2015-10-05 10:20:58 +03:00
Markus Makela
bff6db96a1 Same database on more than one server now cause the schemarouter session to be closed. 2015-10-05 10:20:58 +03:00
counterpoint
e38ea9d07d Correct missing return value. 2015-10-02 16:19:59 +01:00
counterpoint
2231d0870c Place checks in callback routines because DCB will not always contain a reference to a router session, and the associated data will be invalid in this case. 2015-09-25 12:17:18 +01:00
counterpoint
cfeaf7d6e9 Merge remote-tracking branch 'origin/develop' into MXS-329
Conflicts:
	server/core/session.c
2015-09-10 13:07:27 +01:00
counterpoint
f6916a23bd Move responsibility for closing DCB on error to router error handling. Check that routers remove or disable links to closed DCB. 2015-09-09 09:33:00 +01:00
counterpoint
986c918d52 Remove ERRACT_RESET action from router error handler; remove sole call from mysql_client. Correct comments on parameters for router error handlers. 2015-09-09 08:31:59 +01: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
9a6e3a9a86 Fix to Coverity defect. 2015-08-20 09:34:52 +03:00
Markus Makela
185ff4343c Added a missing NULL check. 2015-08-14 09:54:51 +03:00
Markus Makela
deee4479a3 Merge branch 'develop' into schemarouter_refresh 2015-08-10 12:35:22 +03:00