Merge branch 'develop' into MXS-1266
This commit is contained in:
@ -46,15 +46,11 @@ find_package(Avro)
|
||||
find_package(GSSAPI)
|
||||
find_package(SQLite)
|
||||
|
||||
# Find or build PCRE2
|
||||
# Build PCRE2 so we always know the version
|
||||
# Read BuildPCRE2 for details about how to add pcre2 as a dependency to a target
|
||||
find_package(PCRE2)
|
||||
if(NOT PCRE2_FOUND)
|
||||
message(STATUS "Using bundled PCRE2 library")
|
||||
include(cmake/BuildPCRE2.cmake)
|
||||
endif()
|
||||
include(cmake/BuildPCRE2.cmake)
|
||||
|
||||
include_directories(${PCRE2_INCLUDE_DIRS})
|
||||
include_directories(BEFORE ${PCRE2_INCLUDE_DIRS})
|
||||
|
||||
# If the connector was not found, download and build it from source
|
||||
if(NOT MARIADB_CONNECTOR_FOUND)
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -198,23 +198,21 @@ specified name.
|
||||
|
||||
#### `with`
|
||||
|
||||
The value of this key is an object that specifies what the value
|
||||
of the matched column should be replaced with. Currently, the object
|
||||
is expected to contain either the key `value` or the key `fill`. The
|
||||
value of both must be a string. If both keys are specified, then
|
||||
`value` takes presedence.
|
||||
The value of this key is an object that specifies what the value of the matched
|
||||
column should be replaced with. Currently, the object is expected to contain
|
||||
either the key `value` or the key `fill`. The value of both must be a string
|
||||
with length greater than zero. If both keys are specified, `value` takes
|
||||
precedence. If `fill` is not specified, the default `X` is used as its value.
|
||||
|
||||
If `value` is specified, then its value is used to replace the actual
|
||||
value verbatim and the length of the specified value must match the
|
||||
actual returned value (from the server) exactly. If the lengths do
|
||||
not match, then if `fill` is specified its value will be used to
|
||||
mask the actual value. Otherwise an error is logged and the value
|
||||
is *not* masked.
|
||||
If `value` is specified, then its value is used to replace the actual value
|
||||
verbatim and the length of the specified value must match the actual returned
|
||||
value (from the server) exactly. If the lengths do not match, the value of
|
||||
`fill` is used to mask the actual value.
|
||||
|
||||
If `fill` is specified, then its value will be used for masking the
|
||||
value; as such if the lenghts match, by cutting it if the actual value
|
||||
is shorter, and by repeating it, fully or partially, the necessary
|
||||
amount of times, if the actual value is longer.
|
||||
When the value of `fill` (fill-value) is used for masking the returned value,
|
||||
the fill-value is used as many times as necessary to match the length of the
|
||||
return value. If required, only a part of the fill-value may be used in the end
|
||||
of the mask value to get the lengths to match.
|
||||
```
|
||||
{
|
||||
"rules": [
|
||||
|
@ -6,12 +6,15 @@ The tee filter is a "plumbing" fitting in the MariaDB MaxScale filter toolkit.
|
||||
It can be used in a filter pipeline of a service to make copies of requests from
|
||||
the client and send the copies to another service within MariaDB MaxScale.
|
||||
|
||||
**Please Note:** Starting with MaxScale 2.2.0, any client that connects to a
|
||||
service which uses a tee filter will require a grant for the loopback address,
|
||||
i.e. `127.0.0.1`.
|
||||
|
||||
## Configuration
|
||||
|
||||
The configuration block for the TEE filter requires the minimal filter
|
||||
parameters in its section within the MaxScale configuration file. The service to
|
||||
send the duplicates to must be defined. Currently the tee filter does not
|
||||
support multi-statements.
|
||||
send the duplicates to must be defined.
|
||||
|
||||
```
|
||||
[DataMartFilter]
|
||||
|
@ -111,10 +111,16 @@ Credentials for authentication.
|
||||
#### Content-Type
|
||||
|
||||
All PUT and POST requests must use the `Content-Type: application/json` media
|
||||
type and the request body must be a valid JSON representation of a resource. All
|
||||
PATCH requests must use the `Content-Type: application/json` media type and the
|
||||
request body must be a JSON document containing a partial definition of the
|
||||
original resource.
|
||||
type and the request body must be a complete and valid JSON representation of a
|
||||
resource. All PATCH requests must use the `Content-Type: application/json` media
|
||||
type and the request body must be a JSON document containing a partial
|
||||
definition of the original resource.
|
||||
|
||||
The current version of the API supports PATCH-like PUT requests with
|
||||
partial definitions of resources in the request body. This is discouraged
|
||||
as it goes against the intended use of the PUT method. Future versions of
|
||||
the MaxScale REST API can remove this support which means that this
|
||||
functionality is deprecated.
|
||||
|
||||
#### Host
|
||||
|
||||
|
@ -304,89 +304,69 @@ GET /v1/maxscale/modules
|
||||
"self": "http://localhost:8989/v1/maxscale/modules/"
|
||||
},
|
||||
"data": {
|
||||
"id": "readwritesplit",
|
||||
"id": "dbfwfilter",
|
||||
"type": "module",
|
||||
"attributes": {
|
||||
"module_type": "Router",
|
||||
"version": "V1.1.0",
|
||||
"description": "A Read/Write splitting router for enhancement read scalability",
|
||||
"api": "router",
|
||||
"module_type": "Filter",
|
||||
"version": "V1.2.0",
|
||||
"description": "Firewall Filter",
|
||||
"api": "filter",
|
||||
"status": "GA",
|
||||
"commands": [
|
||||
{
|
||||
"id": "rules/reload",
|
||||
"type": "module_command",
|
||||
"links": {
|
||||
"self": "http://localhost:8989/v1/modules/dbfwfilter/rules/reload"
|
||||
},
|
||||
"attributes": {
|
||||
"method": "POST",
|
||||
"arg_min": 1,
|
||||
"arg_max": 2,
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Filter to reload",
|
||||
"type": "FILTER",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Path to rule file",
|
||||
"type": "[STRING]",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "use_sql_variables_in",
|
||||
"type": "enum",
|
||||
"default_value": "all",
|
||||
"enum_values": [
|
||||
"all",
|
||||
"master"
|
||||
]
|
||||
"name": "rules",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"name": "slave_selection_criteria",
|
||||
"type": "enum",
|
||||
"default_value": "LEAST_CURRENT_OPERATIONS",
|
||||
"enum_values": [
|
||||
"LEAST_GLOBAL_CONNECTIONS",
|
||||
"LEAST_ROUTER_CONNECTIONS",
|
||||
"LEAST_BEHIND_MASTER",
|
||||
"LEAST_CURRENT_OPERATIONS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "master_failure_mode",
|
||||
"type": "enum",
|
||||
"default_value": "fail_instantly",
|
||||
"enum_values": [
|
||||
"fail_instantly",
|
||||
"fail_on_write",
|
||||
"error_on_write"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "max_slave_replication_lag",
|
||||
"type": "int",
|
||||
"default_value": "-1"
|
||||
},
|
||||
{
|
||||
"name": "max_slave_connections",
|
||||
"type": "string",
|
||||
"default_value": "255"
|
||||
},
|
||||
{
|
||||
"name": "retry_failed_reads",
|
||||
"type": "bool",
|
||||
"default_value": "true"
|
||||
},
|
||||
{
|
||||
"name": "disable_sescmd_history",
|
||||
"type": "bool",
|
||||
"default_value": "true"
|
||||
},
|
||||
{
|
||||
"name": "max_sescmd_history",
|
||||
"type": "count",
|
||||
"default_value": "0"
|
||||
},
|
||||
{
|
||||
"name": "strict_multi_stmt",
|
||||
"type": "bool",
|
||||
"default_value": "true"
|
||||
},
|
||||
{
|
||||
"name": "master_accept_reads",
|
||||
"name": "log_match",
|
||||
"type": "bool",
|
||||
"default_value": "false"
|
||||
},
|
||||
{
|
||||
"name": "connection_keepalive",
|
||||
"type": "count",
|
||||
"default_value": "0"
|
||||
"name": "log_no_match",
|
||||
"type": "bool",
|
||||
"default_value": "false"
|
||||
},
|
||||
{
|
||||
"name": "action",
|
||||
"type": "enum",
|
||||
"default_value": "block",
|
||||
"enum_values": [
|
||||
"allow",
|
||||
"block",
|
||||
"ignore"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"links": {
|
||||
"self": "http://localhost:8989/v1/modules/readwritesplit"
|
||||
"self": "http://localhost:8989/v1/modules/dbfwfilter"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -267,7 +267,7 @@ The :name in the URI must map to a monitor name with all whitespace replaced wit
|
||||
hyphens. The request body must be a valid JSON document representing the modified monitor.
|
||||
|
||||
```
|
||||
PUT /v1/monitor/:name
|
||||
PATCH /v1/monitor/:name
|
||||
```
|
||||
|
||||
### Modifiable Fields
|
||||
|
@ -312,7 +312,7 @@ Status: 403 Forbidden
|
||||
### Update a server
|
||||
|
||||
```
|
||||
PUT /v1/servers/:name
|
||||
PATCH /v1/servers/:name
|
||||
```
|
||||
|
||||
The _:name_ in the URI must map to a server name with all whitespace replaced
|
||||
@ -443,12 +443,12 @@ Request for `PUT /v1/server/server1`:
|
||||
}
|
||||
```
|
||||
|
||||
The current implementation accepts both PUT and PATCH requests with partially
|
||||
defined resources as request body. If parts of the resource are not defined
|
||||
(e.g. the `attributes` field in the above example), those parts of the resource
|
||||
are not modified. All parts that are defined are interpreted as the new
|
||||
definition of those part of the resource. In the above example, the
|
||||
`relationships` of the resource are completely redefined.
|
||||
The current implementation accepts PATCH requests with partially defined
|
||||
resources as request body. If parts of the resource are not defined (e.g. the
|
||||
`attributes` field in the above example), those parts of the resource are not
|
||||
modified. All parts that are defined are interpreted as the new definition of
|
||||
those part of the resource. In the above example, the `relationships` of the
|
||||
resource are completely redefined.
|
||||
|
||||
#### Response
|
||||
|
||||
|
@ -265,7 +265,7 @@ The _:name_ in the URI must map to a service name and the request body must be a
|
||||
valid JSON Patch document which is applied to the resource.
|
||||
|
||||
```
|
||||
PUT /v1/services/:name
|
||||
PATCH /v1/services/:name
|
||||
```
|
||||
|
||||
The following standard service parameters can be modified.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# MariaDB MaxScale 2.1.2 Release Notes
|
||||
# MariaDB MaxScale 2.1.2 Release Notes -- 2017-04-03
|
||||
|
||||
Release 2.1.2 is a Beta release.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# MariaDB MaxScale 2.1.3 Release Notes
|
||||
# MariaDB MaxScale 2.1.3 Release Notes -- 2017-05-23
|
||||
|
||||
Release 2.1.3 is a GA release.
|
||||
|
||||
|
@ -23,6 +23,18 @@ This filter now uses the PCRE2-libarary to match queries. Previously, it used
|
||||
the POSIX-version of PCRE2. The filter also accepts multiple match-server pairs.
|
||||
Please see the NamedServerFilter documentation for details.
|
||||
|
||||
### Tee Filter
|
||||
|
||||
The `tee` filter has been rewritten to better suit the way MaxScale now
|
||||
functions. The filter requires that the service where the branched session is
|
||||
created has at least one network listener. The users must also be able to
|
||||
connect from the local MaxScale host. Usually this means that an extra grant for
|
||||
the loopback address is required (e.g. `myuser@127.0.0.1`).
|
||||
|
||||
In addition to the aforementioned requirements, a failure to create a branched
|
||||
session no longer causes the actual client session to be closed. In most cases,
|
||||
this is desired behavior.
|
||||
|
||||
## Dropped Features
|
||||
|
||||
### MaxAdmin
|
||||
|
@ -5,7 +5,7 @@
|
||||
# Use of this software is governed by the Business Source License included
|
||||
# in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
#
|
||||
# Change Date: 2019-07-01
|
||||
# Change Date: 2020-01-01
|
||||
#
|
||||
# On the date above, in accordance with the Business Source License, use
|
||||
# of this software will be governed by version 2 or later of the General
|
||||
|
@ -4,13 +4,13 @@ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
||||
Parameters
|
||||
|
||||
Licensor: MariaDB Corporation Ab
|
||||
Licensed Work: MariaDB MaxScale (TM) v.2.1.
|
||||
Licensed Work: MariaDB MaxScale (TM) v.2.2.
|
||||
The Licensed Work is (c) 2017 MariaDB Corporation Ab
|
||||
Additional Use Grant: You may use the Licensed Work when your application
|
||||
uses the Licensed Work with a total of less than three
|
||||
server instances for any purpose.
|
||||
|
||||
Change Date: 2019-07-01
|
||||
Change Date: 2020-01-01
|
||||
|
||||
Change License: Version 2 or later of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
@ -36,6 +36,7 @@
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
#include <stdbool.h>
|
||||
#include <pwd.h>
|
||||
|
||||
#include <maxscale/version.h>
|
||||
|
||||
@ -253,6 +254,11 @@ main(int argc, char **argv)
|
||||
|
||||
if ((so = connectUsingInetSocket(hostname, port, user, passwd)) == -1)
|
||||
{
|
||||
if (access(MAXADMIN_DEFAULT_SOCKET, R_OK) == 0)
|
||||
{
|
||||
fprintf(stderr, "Found default MaxAdmin socket in: %s\n", MAXADMIN_DEFAULT_SOCKET);
|
||||
fprintf(stderr, "Try connecting with:\n\n\tmaxadmin -S %s\n\n", MAXADMIN_DEFAULT_SOCKET);
|
||||
}
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
@ -597,7 +603,13 @@ authUnixSocket(int so)
|
||||
|
||||
if (!authenticated)
|
||||
{
|
||||
fprintf(stderr, "Could connect to MaxScale, but was not authorized.\n");
|
||||
uid_t id = geteuid();
|
||||
struct passwd* pw = getpwuid(id);
|
||||
fprintf(stderr, "Could connect to MaxScale, but was not authorized.\n"
|
||||
"Check that the current user is added to the list of allowed users.\n"
|
||||
"To add this user to the list, execute:\n\n"
|
||||
"\tsudo maxadmin enable account %s\n\n"
|
||||
"This assumes that the root user account is enabled in MaxScale.\n", pw->pw_name);
|
||||
}
|
||||
|
||||
return authenticated;
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
@ -673,7 +673,8 @@ static MXS_ROUTER* createInstance(SERVICE* service, char** options)
|
||||
* the pointer. */
|
||||
|
||||
/* Register a custom command */
|
||||
if (!modulecmd_register_command("rrrouter", "test_command", custom_cmd_example,
|
||||
if (!modulecmd_register_command("rrrouter", "test_command",
|
||||
MODULECMD_TYPE_ACTIVE, custom_cmd_example,
|
||||
2, custom_cmd_args))
|
||||
{
|
||||
MXS_ERROR("Module command registration failed.");
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
@ -24,6 +24,7 @@
|
||||
|
||||
#include <maxscale/modinfo.h>
|
||||
#include <maxscale/jansson.h>
|
||||
#include <maxscale/pcre2.h>
|
||||
|
||||
MXS_BEGIN_DECLS
|
||||
|
||||
@ -108,6 +109,7 @@ extern const char CN_LOG_THROTTLING[];
|
||||
extern const char CN_MAXSCALE[];
|
||||
extern const char CN_MAX_CONNECTIONS[];
|
||||
extern const char CN_MAX_RETRY_INTERVAL[];
|
||||
extern const char CN_METHOD[];
|
||||
extern const char CN_MODULE[];
|
||||
extern const char CN_MODULES[];
|
||||
extern const char CN_MODULE_COMMAND[];
|
||||
@ -351,6 +353,34 @@ struct server* config_get_server(const MXS_CONFIG_PARAMETER *params, const char
|
||||
int config_get_server_list(const MXS_CONFIG_PARAMETER *params, const char *key,
|
||||
struct server*** output);
|
||||
|
||||
/**
|
||||
* Get a compiled regular expression. The returned @c pcre2_code should be freed
|
||||
* by the caller.
|
||||
*
|
||||
* @param params List of configuration parameters
|
||||
* @param key Parameter name
|
||||
* @param options PCRE2 compilation options
|
||||
* @return The compiled PCRE2 code, or NULL on error
|
||||
*/
|
||||
pcre2_code* config_get_compiled_regex(const MXS_CONFIG_PARAMETER *params, const char *key,
|
||||
uint32_t options);
|
||||
|
||||
/**
|
||||
* Get a compiled regular expression and the capture count of the pattern. The
|
||||
* @c pcre2_code should be freed by the caller.
|
||||
*
|
||||
* @param params List of configuration parameters
|
||||
* @param key Parameter name
|
||||
* @param options PCRE2 compilation options
|
||||
* @param output_code Output for compilation result
|
||||
* @param output_capcount Output for capture count
|
||||
* @return True on success, false otherwise
|
||||
*/
|
||||
bool config_get_compiled_regex_capcount(const MXS_CONFIG_PARAMETER *params,
|
||||
const char *key, uint32_t options,
|
||||
pcre2_code** output_code,
|
||||
uint32_t* output_capcount);
|
||||
|
||||
/**
|
||||
* Parse a list of server names and write the results in an array of strings
|
||||
* with one server name in each. The output array and its elements should be
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
@ -274,7 +274,6 @@ DCB *dcb_alloc(dcb_role_t, struct servlistener *);
|
||||
void dcb_free(DCB *);
|
||||
void dcb_free_all_memory(DCB *dcb);
|
||||
DCB *dcb_connect(struct server *, struct session *, const char *);
|
||||
DCB *dcb_clone(DCB *);
|
||||
int dcb_read(DCB *, GWBUF **, int);
|
||||
int dcb_drain_writeq(DCB *);
|
||||
void dcb_close(DCB *);
|
||||
@ -363,11 +362,9 @@ int dcb_get_port(const DCB *dcb);
|
||||
/**
|
||||
* DCB flags values
|
||||
*/
|
||||
#define DCBF_CLONE 0x0001 /*< DCB is a clone */
|
||||
#define DCBF_HUNG 0x0002 /*< Hangup has been dispatched */
|
||||
#define DCBF_REPLIED 0x0004 /*< DCB was written to */
|
||||
|
||||
#define DCB_IS_CLONE(d) ((d)->flags & DCBF_CLONE)
|
||||
#define DCB_REPLIED(d) ((d)->flags & DCBF_REPLIED)
|
||||
|
||||
MXS_END_DECLS
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
@ -183,7 +183,7 @@ protected:
|
||||
* class MyFilter : public maxscale::Filter<MyFilter, MyFilterSession>
|
||||
* {
|
||||
* public:
|
||||
* static MyFilter* create(const char* zName, char** pzOptions, FILTER_PARAMETER** ppParams);
|
||||
* static MyFilter* create(const char* zName, char** pzOptions, MXS_CONFIG_PARAMETER* ppParams);
|
||||
*
|
||||
* MyFilterSession* newSession(MXS_SESSION* pSession);
|
||||
*
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
@ -84,7 +84,8 @@ enum mxs_module_param_type
|
||||
MXS_MODULE_PARAM_PATH, /**< Path to a file or a directory */
|
||||
MXS_MODULE_PARAM_SERVICE, /**< Service name */
|
||||
MXS_MODULE_PARAM_SERVER, /**< Server name */
|
||||
MXS_MODULE_PARAM_SERVERLIST /**< List of server names, separated by ',' */
|
||||
MXS_MODULE_PARAM_SERVERLIST, /**< List of server names, separated by ',' */
|
||||
MXS_MODULE_PARAM_REGEX /**< A regex string enclosed in '/' */
|
||||
};
|
||||
|
||||
/** Maximum and minimum values for integer types */
|
||||
@ -246,6 +247,8 @@ static inline const char* mxs_module_param_type_to_string(enum mxs_module_param_
|
||||
return "server";
|
||||
case MXS_MODULE_PARAM_SERVERLIST:
|
||||
return "serverlist";
|
||||
case MXS_MODULE_PARAM_REGEX:
|
||||
return "regular expression";
|
||||
default:
|
||||
ss_dassert(!true);
|
||||
return "unknown";
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
@ -65,6 +65,13 @@ typedef struct
|
||||
This should always be the first argument
|
||||
if the function requires an output DCB. */
|
||||
|
||||
/** What type of an action does the command perform? */
|
||||
enum modulecmd_type
|
||||
{
|
||||
MODULECMD_TYPE_PASSIVE, /**< Command only displays data */
|
||||
MODULECMD_TYPE_ACTIVE /**< Command can modify data */
|
||||
};
|
||||
|
||||
/**
|
||||
* Options for arguments, bits 9 through 32
|
||||
*/
|
||||
@ -123,6 +130,7 @@ typedef struct modulecmd
|
||||
{
|
||||
char *identifier; /**< Unique identifier */
|
||||
char *domain; /**< Command domain */
|
||||
enum modulecmd_type type; /**< Command type, either active or passive */
|
||||
MODULECMDFN func; /**< The registered function */
|
||||
int arg_count_min; /**< Minimum number of arguments */
|
||||
int arg_count_max; /**< Maximum number of arguments */
|
||||
@ -130,6 +138,9 @@ typedef struct modulecmd
|
||||
struct modulecmd *next; /**< Next command */
|
||||
} MODULECMD;
|
||||
|
||||
/** Check if the module command can modify the data/state of the module */
|
||||
#define MODULECMD_MODIFIES_DATA(t) (t->type == MODULECMD_TYPE_ACTIVE)
|
||||
|
||||
/**
|
||||
* @brief Register a new command
|
||||
*
|
||||
@ -143,7 +154,8 @@ typedef struct modulecmd
|
||||
* @return True if the module was successfully registered, false on error
|
||||
*/
|
||||
bool modulecmd_register_command(const char *domain, const char *identifier,
|
||||
MODULECMDFN entry_point, int argc, modulecmd_arg_type_t *argv);
|
||||
enum modulecmd_type type, MODULECMDFN entry_point,
|
||||
int argc, modulecmd_arg_type_t *argv);
|
||||
|
||||
/**
|
||||
* @brief Find a registered command
|
||||
@ -196,6 +208,15 @@ void modulecmd_arg_free(MODULECMD_ARG *arg);
|
||||
*/
|
||||
bool modulecmd_arg_is_present(const MODULECMD_ARG *arg, int idx);
|
||||
|
||||
/**
|
||||
* @brief Check if module command requires an output DCB
|
||||
*
|
||||
* @param cmd Command to check
|
||||
*
|
||||
* @return True if module requires a DCB for printing output
|
||||
*/
|
||||
bool modulecmd_requires_output_dcb(const MODULECMD* cmd);
|
||||
|
||||
/**
|
||||
* @brief Call a registered command
|
||||
*
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
@ -98,11 +98,4 @@ bool poll_add_fd_to_worker(int wid, int fd, uint32_t events, MXS_POLL_DATA* data
|
||||
*/
|
||||
bool poll_remove_fd_from_worker(int wid, int fd);
|
||||
|
||||
/**
|
||||
* Check whether there are cross-thread messages for current thread.
|
||||
*
|
||||
* @attention Only to be called by the system.
|
||||
*/
|
||||
void poll_check_message(void);
|
||||
|
||||
MXS_END_DECLS
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,36 +5,13 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
* Public License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 01-06-2013 Mark Riddoch Initial implementation
|
||||
* 14-06-2013 Massimiliano Pinto Added specific data
|
||||
* for MySQL session
|
||||
* 04-07-2013 Massimiliano Pinto Added new MySQL protocol status for asynchronous connection
|
||||
* Added authentication reply status
|
||||
* 12-07-2013 Massimiliano Pinto Added routines for change_user
|
||||
* 14-02-2014 Massimiliano Pinto setipaddress returns int
|
||||
* 25-02-2014 Massimiliano Pinto Added dcb parameter to gw_find_mysql_user_password_sha1()
|
||||
* and repository to gw_check_mysql_scramble_data()
|
||||
* It's now possible to specify a different users' table than
|
||||
* dcb->service->users default
|
||||
* 26-02-2014 Massimiliano Pinto Removed previously added parameters to gw_check_mysql_scramble_data() and
|
||||
* gw_find_mysql_user_password_sha1()
|
||||
* 28-02-2014 Massimiliano Pinto MYSQL_DATABASE_MAXLEN,MYSQL_USER_MAXLEN moved to dbusers.h
|
||||
* 07-02-2016 Martin Brampton Extend MYSQL_session type; add MYSQL_AUTH_SUCCEEDED
|
||||
* 17-05-2016 Martin Brampton Moved gw_find_mysql_user_password_sha1 to mysql_auth.c
|
||||
*
|
||||
*/
|
||||
|
||||
#include <maxscale/cdefs.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -431,6 +408,30 @@ void init_response_status(GWBUF* buf, uint8_t cmd, int* npackets, size_t* nbytes
|
||||
bool read_complete_packet(DCB *dcb, GWBUF **readbuf);
|
||||
bool gw_get_shared_session_auth_info(DCB* dcb, MYSQL_session* session);
|
||||
|
||||
/**
|
||||
* Decode server handshake
|
||||
*
|
||||
* @param conn The MySQLProtocol structure
|
||||
* @param payload The handshake payload without the network header
|
||||
*
|
||||
* @return 0 on success, -1 on failure
|
||||
*
|
||||
*/
|
||||
int gw_decode_mysql_server_handshake(MySQLProtocol *conn, uint8_t *payload);
|
||||
|
||||
/**
|
||||
* Create a response to the server handshake
|
||||
*
|
||||
* @param session Session object
|
||||
* @param conn MySQL Protocol object for this connection
|
||||
* @param with_ssl Whether to create an SSL response or a normal response packet
|
||||
* @param ssl_established Set to true if the SSL response has been sent
|
||||
*
|
||||
* @return Generated response packet
|
||||
*/
|
||||
GWBUF* gw_generate_auth_response(MXS_SESSION* session, MySQLProtocol *conn,
|
||||
bool with_ssl, bool ssl_established);
|
||||
|
||||
/** Read the backend server's handshake */
|
||||
bool gw_read_backend_handshake(DCB *dcb, GWBUF *buffer);
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
@ -144,7 +144,6 @@ typedef struct session
|
||||
MXS_DOWNSTREAM head; /*< Head of the filter chain */
|
||||
MXS_UPSTREAM tail; /*< The tail of the filter chain */
|
||||
int refcount; /*< Reference count on the session */
|
||||
bool ses_is_child; /*< this is a child session */
|
||||
mxs_session_trx_state_t trx_state; /*< The current transaction state. */
|
||||
bool autocommit; /*< Whether autocommit is on. */
|
||||
struct
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
* Change Date: 2020-01-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
|
@ -121,7 +121,7 @@ add_test_executable(bug547.cpp bug547 replication LABELS readwritesplit REPL_BAC
|
||||
add_test_executable(bug681.cpp bug681 galera.bug681 LABELS readwritesplit GALERA_BACKEND)
|
||||
|
||||
# Regression case for the bug "crash with tee filter"
|
||||
add_test_executable(bug643.cpp bug643 bug643 LABELS tee REPL_BACKEND)
|
||||
#add_test_executable(bug643.cpp bug643 bug643 LABELS tee REPL_BACKEND)
|
||||
|
||||
# Regression case for the bug ""Different error messages from MariaDB and Maxscale"
|
||||
add_test_script(bug561.sh bug561.sh replication LABELS MySQLAuth REPL_BACKEND)
|
||||
@ -166,13 +166,13 @@ add_test_executable(bug626.cpp bug626 replication LABELS MySQLAuth MySQLProtocol
|
||||
add_test_executable(bug634.cpp bug634 replication LABELS readwritesplit REPL_BACKEND)
|
||||
|
||||
# Regression cases for several TEE filter hangs
|
||||
add_test_executable(bug645.cpp bug645 bug645 LABELS tee REPL_BACKEND)
|
||||
add_test_executable(bug645_1.cpp bug645_1 bug645_1 LABELS tee REPL_BACKEND)
|
||||
add_test_executable(bug649.cpp bug649 bug645 LABELS tee)
|
||||
add_test_executable(bug650.cpp bug650 bug650 LABELS tee REPL_BACKEND)
|
||||
#add_test_executable(bug645.cpp bug645 bug645 LABELS tee REPL_BACKEND)
|
||||
#add_test_executable(bug645_1.cpp bug645_1 bug645_1 LABELS tee REPL_BACKEND)
|
||||
#add_test_executable(bug649.cpp bug649 bug645 LABELS tee)
|
||||
#add_test_executable(bug650.cpp bug650 bug650 LABELS tee REPL_BACKEND)
|
||||
|
||||
# Heavy test for TEE filter
|
||||
add_test_script(bug648 sql_queries bug648 LABELS tee UNSTABLE HEAVY REPL_BACKEND)
|
||||
#add_test_script(bug648 sql_queries bug648 LABELS tee UNSTABLE HEAVY REPL_BACKEND)
|
||||
|
||||
# Crash when host name for some user in mysql.user is very long
|
||||
add_test_executable(bug653.cpp bug653 replication LABELS MySQLAuth MySQLProtocol REPL_BACKEND)
|
||||
@ -181,7 +181,7 @@ add_test_executable(bug653.cpp bug653 replication LABELS MySQLAuth MySQLProtocol
|
||||
add_test_executable(bug654.cpp bug654 replication LABELS maxscale REPL_BACKEND)
|
||||
|
||||
# Regression case for the bug "Tee filter: closing child session causes MaxScale to fail"
|
||||
add_test_executable(bug657.cpp bug657 bug657 LABELS tee REPL_BACKEND)
|
||||
#add_test_executable(bug657.cpp bug657 bug657 LABELS tee REPL_BACKEND)
|
||||
|
||||
# Block backends (master or all slaves) and tries to connect Maxscale
|
||||
add_test_executable(bug658.cpp bug658 replication LABELS readwritesplit readconnroute maxscale REPL_BACKEND)
|
||||
@ -193,7 +193,7 @@ add_test_executable(bug662.cpp bug662 replication LABELS readwritesplit readconn
|
||||
add_test_executable(bug664.cpp bug664 bug664 LABELS MySQLAuth MySQLProtocol)
|
||||
|
||||
# TEE fileter: execute long sequence of queries ans session commands in the loop
|
||||
add_test_executable(bug670.cpp bug670 bug670 LABELS tee REPL_BACKEND)
|
||||
#add_test_executable(bug670.cpp bug670 bug670 LABELS tee REPL_BACKEND)
|
||||
|
||||
# Regression case for the bug "MaxScale crashes if "Users table data" is empty and "show dbusers" is executed in maxadmin"
|
||||
add_test_executable(bug673.cpp bug673 bug673 LABELS MySQLAuth REPL_BACKEND)
|
||||
@ -327,7 +327,7 @@ add_test_executable(mm.cpp mm mm LABELS mmmon BREAKS_REPL)
|
||||
add_test_executable(mm_mysqlmon.cpp mm_mysqlmon mm_mysqlmon LABELS mysqlmon REPL_BACKEND BREAKS_REPL)
|
||||
|
||||
# MySQL Monitor crash safety
|
||||
add_test_executable(mysqlmon_backup.cpp mysqlmon_backup mysqlmon_backup LABELS mysqlmon REPL_BACKEND)
|
||||
#add_test_executable(mysqlmon_backup.cpp mysqlmon_backup mysqlmon_backup LABELS mysqlmon REPL_BACKEND)
|
||||
|
||||
# Regression case for the bug "Two monitors loaded at the same time result into not working installation"
|
||||
add_test_executable(mxs118.cpp mxs118 mxs118 LABELS maxscale LIGHT REPL_BACKEND)
|
||||
@ -366,7 +366,7 @@ add_test_executable(mxs431.cpp mxs431 sharding LABELS schemarouter REPL_BACKEND
|
||||
add_test_executable(mxs47.cpp mxs47 replication LABELS MySQLProtocol LIGHT REPL_BACKEND)
|
||||
|
||||
# Regression case for the bug "USE <db> hangs when Tee filter uses matching"
|
||||
add_test_executable(mxs501_tee_usedb.cpp mxs501_tee_usedb mxs501 LABELS tee REPL_BACKEND)
|
||||
#add_test_executable(mxs501_tee_usedb.cpp mxs501_tee_usedb mxs501 LABELS tee REPL_BACKEND)
|
||||
|
||||
# Open connection, execute 'change user', close connection in the loop
|
||||
add_test_executable(mxs548_short_session_change_user.cpp mxs548_short_session_change_user mxs548 LABELS MySQLProtocol REPL_BACKEND)
|
||||
@ -421,7 +421,6 @@ add_test_executable(mxs812_2.cpp mxs812_2 longblob LABELS readwritesplit REPL_BA
|
||||
add_test_executable(mxs822_maxpasswd.cpp mxs822_maxpasswd maxpasswd LABELS maxscale REPL_BACKEND)
|
||||
|
||||
# Do only SELECTS during time > wait_timeout and then do INSERT
|
||||
# This test will fail because the functionality hasn't been implemented
|
||||
add_test_executable(mxs827_write_timeout.cpp mxs827_write_timeout mxs827_write_timeout LABELS readwritesplit REPL_BACKEND)
|
||||
|
||||
# Block and unblock first and second slaves and check that they are recovered
|
||||
@ -536,8 +535,8 @@ add_test_executable(rwsplit_read_only_trx.cpp rwsplit_read_only_trx rwsplit_read
|
||||
|
||||
# Test replication-manager with MaxScale
|
||||
add_test_executable(replication_manager.cpp replication_manager replication_manager LABELS maxscale REPL_BACKEND)
|
||||
add_test_executable_notest(replication_manager_2nodes.cpp replication_manager_2nodes replication_manager_2nodes LABELS maxscale REPL_BACKEND)
|
||||
add_test_executable_notest(replication_manager_3nodes.cpp replication_manager_3nodes replication_manager_3nodes LABELS maxscale REPL_BACKEND)
|
||||
#add_test_executable_notest(replication_manager_2nodes.cpp replication_manager_2nodes replication_manager_2nodes LABELS maxscale REPL_BACKEND)
|
||||
#add_test_executable_notest(replication_manager_3nodes.cpp replication_manager_3nodes replication_manager_3nodes LABELS maxscale REPL_BACKEND)
|
||||
|
||||
# Schemarouter duplicate database detection test: create DB on all nodes and then try query againt schema router
|
||||
add_test_executable(schemarouter_duplicate_db.cpp schemarouter_duplicate_db schemarouter_duplicate_db LABELS schemarouter REPL_BACKEND)
|
||||
@ -584,11 +583,15 @@ add_test_script(sql_queries_pers10 sql_queries sql_queries_pers10 LABELS maxscal
|
||||
# Execute queries of different size, check data is the same when accessing via Maxscale and directly to backend, client ssl is ON
|
||||
add_test_script(ssl sql_queries ssl LABELS maxscale readwritesplit REPL_BACKEND)
|
||||
|
||||
|
||||
# Check load balancing, client ssl is ON
|
||||
add_test_script(ssl_load load_balancing ssl_load LABELS maxscale readwritesplit REPL_BACKEND)
|
||||
|
||||
# Disabled due to some strangeness in Connector-C 3.0 TLS connections which
|
||||
# cause uneven distribution of connections.
|
||||
#add_test_script(ssl_load load_balancing ssl_load LABELS maxscale readwritesplit REPL_BACKEND)
|
||||
|
||||
# Check load balancing, client ssl is ON, Galera backend
|
||||
add_test_script(ssl_load_galera load_balancing_galera ssl_load_galera LABELS maxscale readwritesplit GALERA_BACKEND)
|
||||
#add_test_script(ssl_load_galera load_balancing_galera ssl_load_galera LABELS maxscale readwritesplit GALERA_BACKEND)
|
||||
|
||||
# Testing slaves who have lost their master and how MaxScale works with them
|
||||
add_test_executable(stale_slaves.cpp stale_slaves replication LABELS mysqlmon REPL_BACKEND)
|
||||
@ -606,7 +609,7 @@ add_test_executable(test_hints.cpp test_hints hints2 LABELS hintfilter LIGHT REP
|
||||
add_test_executable(avro.cpp avro avro LABELS avrorouter binlogrouter LIGHT BREAKS_REPL)
|
||||
|
||||
# Test avrorouter file compression
|
||||
add_test_script(avro_compression avro avro_compression LABELS avrorouter binlogrouter LIGHT BREAKS_REPL)
|
||||
#add_test_script(avro_compression avro avro_compression LABELS avrorouter binlogrouter LIGHT BREAKS_REPL)
|
||||
|
||||
# In the binlog router setup stop Master and promote one of the Slaves to be new Master
|
||||
add_test_executable(binlog_change_master.cpp binlog_change_master setup_binlog_tx_safe LABELS binlogrouter BREAKS_REPL)
|
||||
@ -680,7 +683,7 @@ add_test_executable(kerberos_setup.cpp kerberos_setup kerberos LABELS HEAVY gssa
|
||||
#add_test_executable(bad_pers.cpp bad_pers bad_pers LABELS REPL_BACKEND)
|
||||
|
||||
# Test Aurora RDS monitor
|
||||
add_test_executable(auroramon.cpp auroramon auroramon LABELS HEAVY EXTERNAL_BACKEND)
|
||||
#add_test_executable(auroramon.cpp auroramon auroramon LABELS HEAVY EXTERNAL_BACKEND)
|
||||
|
||||
# Disabled for the time being
|
||||
# add_test_executable(gatekeeper.cpp gatekeeper gatekeeper LABELS gatekeeper)
|
||||
|
@ -25,45 +25,33 @@ using std::endl;
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
TestConnections * Test = new TestConnections(argc, argv);
|
||||
Test->set_timeout(600);
|
||||
Test->stop_maxscale();
|
||||
Test->ssh_maxscale(true, (char *) "rm -rf /var/lib/maxscale/avro");
|
||||
TestConnections test(argc, argv);
|
||||
test.set_timeout(600);
|
||||
test.ssh_maxscale(true, (char *) "rm -rf /var/lib/maxscale/avro");
|
||||
|
||||
Test->repl->connect();
|
||||
execute_query(Test->repl->nodes[0], "DROP TABLE IF EXISTS t1");
|
||||
Test->repl->close_connections();
|
||||
sleep(5);
|
||||
/** Start master to binlogrouter replication */
|
||||
if (!test.replicate_from_master())
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
test.set_timeout(120);
|
||||
test.repl->connect();
|
||||
|
||||
Test->start_binlog();
|
||||
create_t1(test.repl->nodes[0]);
|
||||
insert_into_t1(test.repl->nodes[0], 3);
|
||||
execute_query(test.repl->nodes[0], "FLUSH LOGS");
|
||||
|
||||
Test->set_timeout(120);
|
||||
|
||||
Test->stop_maxscale();
|
||||
|
||||
Test->ssh_maxscale(true, "rm -rf /var/lib/maxscale/avro");
|
||||
|
||||
Test->set_timeout(120);
|
||||
|
||||
Test->start_maxscale();
|
||||
|
||||
Test->set_timeout(60);
|
||||
|
||||
Test->repl->connect();
|
||||
create_t1(Test->repl->nodes[0]);
|
||||
insert_into_t1(Test->repl->nodes[0], 3);
|
||||
execute_query(Test->repl->nodes[0], "FLUSH LOGS");
|
||||
|
||||
Test->repl->close_connections();
|
||||
|
||||
Test->set_timeout(120);
|
||||
test.repl->close_connections();
|
||||
|
||||
/** Give avrorouter some time to process the events */
|
||||
test.stop_timeout();
|
||||
sleep(10);
|
||||
test.set_timeout(120);
|
||||
|
||||
char * avro_check = Test->ssh_maxscale_output(true,
|
||||
"maxavrocheck -vv /var/lib/maxscale/avro/test.t1.000001.avro | grep \"{\"");
|
||||
char * output = Test->ssh_maxscale_output(true, "maxavrocheck -d /var/lib/maxscale/avro/test.t1.000001.avro");
|
||||
char * avro_check = test.ssh_maxscale_output(true,
|
||||
"maxavrocheck -vv /var/lib/maxscale/avro/test.t1.000001.avro | grep \"{\"");
|
||||
char * output = test.ssh_maxscale_output(true, "maxavrocheck -d /var/lib/maxscale/avro/test.t1.000001.avro");
|
||||
|
||||
std::istringstream iss;
|
||||
iss.str(output);
|
||||
@ -74,13 +62,13 @@ int main(int argc, char *argv[])
|
||||
for (std::string line; std::getline(iss, line);)
|
||||
{
|
||||
long long int x1, fl;
|
||||
Test->set_timeout(20);
|
||||
test.set_timeout(20);
|
||||
get_x_fl_from_json((char*)line.c_str(), &x1, &fl);
|
||||
|
||||
if (x1 != x1_exp || fl != fl_exp)
|
||||
{
|
||||
Test->add_result(1, "Output:x1 %lld, fl %lld, Expected: x1 %d, fl %d",
|
||||
x1, fl, x1_exp, fl_exp);
|
||||
test.add_result(1, "Output:x1 %lld, fl %lld, Expected: x1 %d, fl %d",
|
||||
x1, fl, x1_exp, fl_exp);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -89,19 +77,17 @@ int main(int argc, char *argv[])
|
||||
x1_exp = 0;
|
||||
x = x * 16;
|
||||
fl_exp++;
|
||||
Test->tprintf("fl = %d", fl_exp);
|
||||
test.tprintf("fl = %d", fl_exp);
|
||||
}
|
||||
}
|
||||
|
||||
if (fl_exp != 3)
|
||||
{
|
||||
Test->add_result(1, "not enough lines in avrocheck output\n");
|
||||
test.add_result(1, "not enough lines in avrocheck output");
|
||||
}
|
||||
|
||||
Test->set_timeout(120);
|
||||
execute_query(test.repl->nodes[0], "DROP TABLE test.t1;RESET MASTER");
|
||||
test.repl->fix_replication();
|
||||
|
||||
int rval = Test->global_result;
|
||||
delete Test;
|
||||
return rval;
|
||||
return test.global_result;
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,10 @@ int main(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
// Wait for the connections to clean up
|
||||
Test->stop_timeout();
|
||||
sleep(5);
|
||||
|
||||
Test->check_maxscale_alive();
|
||||
int rval = Test->global_result;
|
||||
delete Test;
|
||||
|
@ -25,6 +25,7 @@ TestConnections * Test ;
|
||||
int exit_flag;
|
||||
int master = 0;
|
||||
int i_trans = 0;
|
||||
const int trans_max = 100;
|
||||
int failed_transaction_num = 0;
|
||||
|
||||
/** The amount of rows each transaction inserts */
|
||||
@ -294,7 +295,7 @@ void *transaction_thread( void *ptr )
|
||||
Test->add_result(mysql_errno(conn), "Error connecting to Binlog router, error: %s\n", mysql_error(conn));
|
||||
create_t1(conn);
|
||||
|
||||
while ((exit_flag == 0))
|
||||
while ((exit_flag == 0) && i_trans < trans_max)
|
||||
{
|
||||
Test->tprintf("Transaction %d\n", i_trans);
|
||||
trans_result = transaction(conn, i_trans);
|
||||
|
@ -43,12 +43,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
Test->set_timeout(30);
|
||||
Test->tprintf("Trying some queries, expecting failure, but not a crash\n");
|
||||
execute_query(Test->conn_rwsplit, (char *) "DROP TABLE IF EXISTS t1");
|
||||
execute_query(Test->conn_rwsplit, (char *) "CREATE TABLE t1 (x INT)");
|
||||
execute_query(Test->conn_rwsplit, (char *) "INSERT INTO t1 (x) VALUES (1)");
|
||||
execute_query(Test->conn_rwsplit, (char *) "select * from t1");
|
||||
execute_query(Test->conn_master, (char *) "select * from t1");
|
||||
execute_query(Test->conn_slave, (char *) "select * from t1");
|
||||
execute_query(Test->conn_rwsplit, "DROP TABLE IF EXISTS t1");
|
||||
execute_query(Test->conn_rwsplit, "CREATE TABLE t1 (x INT)");
|
||||
execute_query(Test->conn_rwsplit, "INSERT INTO t1 (x) VALUES (1)");
|
||||
execute_query(Test->conn_rwsplit, "select * from t1");
|
||||
execute_query(Test->conn_master, "select * from t1");
|
||||
execute_query(Test->conn_slave, "select * from t1");
|
||||
|
||||
Test->set_timeout(10);
|
||||
Test->close_maxscale_connections();
|
||||
@ -58,12 +58,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
Test->stop_timeout();
|
||||
sleep(15);
|
||||
Test->check_log_err((char *) "fatal signal 11", false);
|
||||
Test->check_log_err((char *) "Failed to create new router session for service 'RW-Split-Router'", true);
|
||||
Test->check_log_err((char *)
|
||||
"Failed to create new router session for service 'Read-Connection-Router-Master'", true);
|
||||
Test->check_log_err((char *) "Failed to create new router session for service 'Read-Connection-Router-Slave'",
|
||||
true);
|
||||
Test->check_log_err("fatal signal 11", false);
|
||||
Test->check_log_err("Failed to create new router session for service", true);
|
||||
|
||||
int rval = Test->global_result;
|
||||
delete Test;
|
||||
|
@ -22,16 +22,6 @@ service=RW Split Router
|
||||
* - check warnig in the log "RW Split Router: Recursive use of tee filter in service"
|
||||
*/
|
||||
|
||||
/*
|
||||
Mark Riddoch 2014-12-11 11:59:19 UTC
|
||||
There is a recursive use of the tee filter in the configuration.
|
||||
|
||||
The "RW Split Router" uses the"duplicate" filter that will then duplicate all traffic to the original destination and another copy of the "RW Split Router", which again will duplicate all traffic to the original destination and another copy of the "RW Split Router"...
|
||||
|
||||
Really this needs to be trapped as a configuration error.
|
||||
*/
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include "testconnections.h"
|
||||
|
||||
@ -56,7 +46,7 @@ int main(int argc, char *argv[])
|
||||
Test->add_result(1, "FAIL: Query to broken service succeeded!\n");
|
||||
}
|
||||
Test->close_maxscale_connections();
|
||||
Test->check_log_err((char *) "RW-Split-Router: Recursive use of tee filter in service", true);
|
||||
Test->check_log_err("Recursive use of tee filter in service", true);
|
||||
|
||||
int rval = Test->global_result;
|
||||
delete Test;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user