Merge branch '2.2' into develop
This commit is contained in:
@ -39,6 +39,7 @@ For more details, please refer to:
|
|||||||
the master. There is also limited capability for rejoining nodes.
|
the master. There is also limited capability for rejoining nodes.
|
||||||
|
|
||||||
For more details, please refer to:
|
For more details, please refer to:
|
||||||
|
* [MariaDB MaxScale 2.2.14 Release Notes](Release-Notes/MaxScale-2.2.14-Release-Notes.md)
|
||||||
* [MariaDB MaxScale 2.2.13 Release Notes](Release-Notes/MaxScale-2.2.13-Release-Notes.md)
|
* [MariaDB MaxScale 2.2.13 Release Notes](Release-Notes/MaxScale-2.2.13-Release-Notes.md)
|
||||||
* [MariaDB MaxScale 2.2.12 Release Notes](Release-Notes/MaxScale-2.2.12-Release-Notes.md)
|
* [MariaDB MaxScale 2.2.12 Release Notes](Release-Notes/MaxScale-2.2.12-Release-Notes.md)
|
||||||
* [MariaDB MaxScale 2.2.11 Release Notes](Release-Notes/MaxScale-2.2.11-Release-Notes.md)
|
* [MariaDB MaxScale 2.2.11 Release Notes](Release-Notes/MaxScale-2.2.11-Release-Notes.md)
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
Release 2.2.14 is a GA release.
|
Release 2.2.14 is a GA release.
|
||||||
|
|
||||||
This document describes the changes in release 2.2.14, when compared to the
|
This document describes the changes in release 2.2.14, when compared to
|
||||||
previous release in the same series.
|
release 2.2.13.
|
||||||
|
|
||||||
For any problems you encounter, please consider submitting a bug
|
For any problems you encounter, please consider submitting a bug
|
||||||
report on [our Jira](https://jira.mariadb.org/projects/MXS).
|
report on [our Jira](https://jira.mariadb.org/projects/MXS).
|
||||||
@ -14,7 +14,10 @@ report on [our Jira](https://jira.mariadb.org/projects/MXS).
|
|||||||
|
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
|
|
||||||
|
* [MXS-2041](https://jira.mariadb.org/browse/MXS-2041) Crash on failure to create schemarouter session
|
||||||
|
* [MXS-2040](https://jira.mariadb.org/browse/MXS-2040) Default monitor timeouts are too short
|
||||||
* [MXS-2037](https://jira.mariadb.org/browse/MXS-2037) % wildcards not working with source in Named Server Filter
|
* [MXS-2037](https://jira.mariadb.org/browse/MXS-2037) % wildcards not working with source in Named Server Filter
|
||||||
|
* [MXS-2036](https://jira.mariadb.org/browse/MXS-2036) A slave with sql thread stopped causes wrong master after failover
|
||||||
* [MXS-2034](https://jira.mariadb.org/browse/MXS-2034) query_retry_timeout was not set
|
* [MXS-2034](https://jira.mariadb.org/browse/MXS-2034) query_retry_timeout was not set
|
||||||
* [MXS-2027](https://jira.mariadb.org/browse/MXS-2027) LOAD DATA LOCAL INFILE is not ignored by protocol modules
|
* [MXS-2027](https://jira.mariadb.org/browse/MXS-2027) LOAD DATA LOCAL INFILE is not ignored by protocol modules
|
||||||
* [MXS-2024](https://jira.mariadb.org/browse/MXS-2024) Crash in reauthenticate_client
|
* [MXS-2024](https://jira.mariadb.org/browse/MXS-2024) Crash in reauthenticate_client
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
major=`cmake -P ../../VERSION.cmake -L|grep 'MAXSCALE_VERSION_MAJOR'|sed 's/.*=//'`
|
major="`cd ../../ && cmake -P ./VERSION.cmake -L|grep 'MAXSCALE_VERSION_MAJOR'|sed 's/.*=//'`"
|
||||||
minor=`cmake -P ../../VERSION.cmake -L|grep 'MAXSCALE_VERSION_MINOR'|sed 's/.*=//'`
|
minor="`cd ../../ && cmake -P ./VERSION.cmake -L|grep 'MAXSCALE_VERSION_MINOR'|sed 's/.*=//'`"
|
||||||
patch=`cmake -P ../../VERSION.cmake -L|grep 'MAXSCALE_VERSION_PATCH'|sed 's/.*=//'`
|
patch="`cd ../../ && cmake -P ./VERSION.cmake -L|grep 'MAXSCALE_VERSION_PATCH'|sed 's/.*=//'`"
|
||||||
maturity=`cmake -P ../../VERSION.cmake -L|grep 'MAXSCALE_MATURITY'|sed 's/.*=//'`
|
maturity="`cd ../../ && cmake -P ./VERSION.cmake -L|grep 'MAXSCALE_MATURITY'|sed 's/.*=//'`"
|
||||||
|
|
||||||
VERSION=${major}.${minor}.${patch}
|
VERSION="${major}.${minor}.${patch}"
|
||||||
|
|
||||||
cat <<EOF > MaxScale-$VERSION-Release-Notes.md
|
cat <<EOF > MaxScale-$VERSION-Release-Notes.md
|
||||||
# MariaDB MaxScale ${VERSION} Release Notes
|
# MariaDB MaxScale ${VERSION} Release Notes
|
||||||
|
|||||||
@ -4,7 +4,7 @@ if (BUILD_MAXCTRL)
|
|||||||
|
|
||||||
if (NPM_FOUND AND NODEJS_FOUND AND NODEJS_VERSION VERSION_GREATER "6.0.0")
|
if (NPM_FOUND AND NODEJS_FOUND AND NODEJS_VERSION VERSION_GREATER "6.0.0")
|
||||||
|
|
||||||
include(configure_version.cmake)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lib/version.js.in ${CMAKE_CURRENT_BINARY_DIR}/lib/version.js @ONLY)
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/maxctrl/maxctrl
|
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/maxctrl/maxctrl
|
||||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.sh ${CMAKE_SOURCE_DIR}
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.sh ${CMAKE_SOURCE_DIR}
|
||||||
|
|||||||
@ -1,2 +0,0 @@
|
|||||||
include(../VERSION.cmake)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lib/version.js.in ${CMAKE_CURRENT_BINARY_DIR}/lib/version.js @ONLY)
|
|
||||||
@ -6,7 +6,7 @@
|
|||||||
"main": "maxctrl.js",
|
"main": "maxctrl.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "nyc mocha --exit --timeout 15000 --slow 10000",
|
"test": "nyc mocha --exit --timeout 15000 --slow 10000",
|
||||||
"preinstall": "cmake -P configure_version.cmake"
|
"preinstall": "test -f lib/version.js || cp lib/version.js.in lib/version.js"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"maxscale"
|
"maxscale"
|
||||||
|
|||||||
@ -1058,5 +1058,9 @@ add_test_executable(mxs1985_kill_hang.cpp mxs1985_kill_hang replication LABELS R
|
|||||||
# https://jira.mariadb.org/browse/MXS-1113
|
# https://jira.mariadb.org/browse/MXS-1113
|
||||||
add_test_executable(mxs1113_schemarouter_ps.cpp mxs1113_schemarouter_ps mxs1113_schemarouter_ps LABELS schemarouter BREAKS_REPL)
|
add_test_executable(mxs1113_schemarouter_ps.cpp mxs1113_schemarouter_ps mxs1113_schemarouter_ps LABELS schemarouter BREAKS_REPL)
|
||||||
|
|
||||||
|
# MXS-2037: Wildcards not working with source in Named Server Filter
|
||||||
|
# https://jira.mariadb.org/browse/MXS-2037
|
||||||
|
add_test_executable(mxs2037_namedserver_wildcards.cpp mxs2037_namedserver_wildcards mxs2037_namedserver_wildcards LABELS namedserverfilter LIGHT REPL_BACKEND)
|
||||||
|
|
||||||
|
|
||||||
configure_file(templates.h.in ${CMAKE_CURRENT_BINARY_DIR}/templates.h @ONLY)
|
configure_file(templates.h.in ${CMAKE_CURRENT_BINARY_DIR}/templates.h @ONLY)
|
||||||
|
|||||||
@ -0,0 +1,95 @@
|
|||||||
|
[maxscale]
|
||||||
|
threads=###threads###
|
||||||
|
log_warning=1
|
||||||
|
|
||||||
|
[namedserverfilter]
|
||||||
|
type=filter
|
||||||
|
module=namedserverfilter
|
||||||
|
match01=SELECT
|
||||||
|
target01=server1
|
||||||
|
source=127.%.%.%
|
||||||
|
|
||||||
|
[MySQL Monitor]
|
||||||
|
type=monitor
|
||||||
|
module=mysqlmon
|
||||||
|
###repl51###
|
||||||
|
servers=server1,server2,server3,server4
|
||||||
|
user=maxskysql
|
||||||
|
passwd=skysql
|
||||||
|
monitor_interval=1000
|
||||||
|
|
||||||
|
[RW Split Router]
|
||||||
|
type=service
|
||||||
|
router=readwritesplit
|
||||||
|
servers=server1,server2,server3,server4
|
||||||
|
user=maxskysql
|
||||||
|
passwd=skysql
|
||||||
|
filters=namedserverfilter
|
||||||
|
|
||||||
|
[CLI]
|
||||||
|
type=service
|
||||||
|
router=cli
|
||||||
|
|
||||||
|
[CLI Listener]
|
||||||
|
type=listener
|
||||||
|
service=CLI
|
||||||
|
protocol=maxscaled
|
||||||
|
socket=default
|
||||||
|
|
||||||
|
[Read Connection Router Slave]
|
||||||
|
type=service
|
||||||
|
router=readconnroute
|
||||||
|
router_options=slave
|
||||||
|
servers=server1,server2,server3,server4
|
||||||
|
user=maxskysql
|
||||||
|
passwd=skysql
|
||||||
|
|
||||||
|
[Read Connection Router Master]
|
||||||
|
type=service
|
||||||
|
router=readconnroute
|
||||||
|
router_options=master
|
||||||
|
servers=server1,server2,server3,server4
|
||||||
|
user=maxskysql
|
||||||
|
passwd=skysql
|
||||||
|
|
||||||
|
[RW Split Listener]
|
||||||
|
type=listener
|
||||||
|
service=RW Split Router
|
||||||
|
protocol=MySQLClient
|
||||||
|
port=4006
|
||||||
|
|
||||||
|
[Read Connection Listener Slave]
|
||||||
|
type=listener
|
||||||
|
service=Read Connection Router Slave
|
||||||
|
protocol=MySQLClient
|
||||||
|
port=4009
|
||||||
|
|
||||||
|
[Read Connection Listener Master]
|
||||||
|
type=listener
|
||||||
|
service=Read Connection Router Master
|
||||||
|
protocol=MySQLClient
|
||||||
|
port=4008
|
||||||
|
|
||||||
|
[server1]
|
||||||
|
type=server
|
||||||
|
address=###node_server_IP_1###
|
||||||
|
port=###node_server_port_1###
|
||||||
|
protocol=MySQLBackend
|
||||||
|
|
||||||
|
[server2]
|
||||||
|
type=server
|
||||||
|
address=###node_server_IP_2###
|
||||||
|
port=###node_server_port_2###
|
||||||
|
protocol=MySQLBackend
|
||||||
|
|
||||||
|
[server3]
|
||||||
|
type=server
|
||||||
|
address=###node_server_IP_3###
|
||||||
|
port=###node_server_port_3###
|
||||||
|
protocol=MySQLBackend
|
||||||
|
|
||||||
|
[server4]
|
||||||
|
type=server
|
||||||
|
address=###node_server_IP_4###
|
||||||
|
port=###node_server_port_4###
|
||||||
|
protocol=MySQLBackend
|
||||||
@ -22,6 +22,7 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
char* version;
|
char* version;
|
||||||
|
|
||||||
|
TestConnections::multiple_maxscales(true);
|
||||||
TestConnections* Test = new TestConnections(argc, argv);
|
TestConnections* Test = new TestConnections(argc, argv);
|
||||||
Test->set_timeout(10);
|
Test->set_timeout(10);
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,7 @@ int main(int argc, char* argv[])
|
|||||||
bool passive;
|
bool passive;
|
||||||
char str[1024];
|
char str[1024];
|
||||||
|
|
||||||
|
TestConnections::multiple_maxscales(true);
|
||||||
TestConnections* Test = new TestConnections(argc, argv);
|
TestConnections* Test = new TestConnections(argc, argv);
|
||||||
// Test->set_timeout(10);
|
// Test->set_timeout(10);
|
||||||
|
|
||||||
|
|||||||
23
maxscale-system-test/mxs2037_namedserver_wildcards.cpp
Normal file
23
maxscale-system-test/mxs2037_namedserver_wildcards.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* MXS-2037: Wildcards not working with source in NamedServerFilter
|
||||||
|
*
|
||||||
|
* https://jira.mariadb.org/browse/MXS-2037
|
||||||
|
*
|
||||||
|
* This test only tests that ip addresses with wildcards are accepted by
|
||||||
|
* NamedServerFilter. The actual matching functionality is not tested
|
||||||
|
* because the client IPs can change with the different test environments
|
||||||
|
* and that would make it complicated to check if the matching is correct.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "testconnections.h"
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
TestConnections test(argc, argv);
|
||||||
|
test.set_timeout(10);
|
||||||
|
test.maxscales->connect_maxscale(0);
|
||||||
|
test.add_result(execute_query(test.maxscales->conn_rwsplit[0], "select 1"), "Can't connect to backend");
|
||||||
|
test.maxscales->close_maxscale_connections(0);
|
||||||
|
return test.global_result;
|
||||||
|
}
|
||||||
@ -21,13 +21,13 @@ int main(int argc, char** argv)
|
|||||||
test.repl->connect();
|
test.repl->connect();
|
||||||
delete_slave_binlogs(test);
|
delete_slave_binlogs(test);
|
||||||
|
|
||||||
test.maxscales->wait_for_monitor();
|
test.maxscales->wait_for_monitor(2);
|
||||||
basic_test(test);
|
basic_test(test);
|
||||||
print_gtids(test);
|
print_gtids(test);
|
||||||
|
|
||||||
// Part 1
|
// Part 1
|
||||||
int node0_id = prepare_test_1(test);
|
int node0_id = prepare_test_1(test);
|
||||||
test.maxscales->wait_for_monitor();
|
test.maxscales->wait_for_monitor(2);
|
||||||
check_test_1(test, node0_id);
|
check_test_1(test, node0_id);
|
||||||
|
|
||||||
if (test.global_result != 0)
|
if (test.global_result != 0)
|
||||||
@ -37,7 +37,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
// Part 2
|
// Part 2
|
||||||
prepare_test_2(test);
|
prepare_test_2(test);
|
||||||
test.maxscales->wait_for_monitor();
|
test.maxscales->wait_for_monitor(2);
|
||||||
check_test_2(test);
|
check_test_2(test);
|
||||||
|
|
||||||
if (test.global_result != 0)
|
if (test.global_result != 0)
|
||||||
@ -47,7 +47,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
// Part 3
|
// Part 3
|
||||||
prepare_test_3(test);
|
prepare_test_3(test);
|
||||||
test.maxscales->wait_for_monitor();
|
test.maxscales->wait_for_monitor(2);
|
||||||
check_test_3(test);
|
check_test_3(test);
|
||||||
|
|
||||||
return test.global_result;
|
return test.global_result;
|
||||||
|
|||||||
@ -25,6 +25,7 @@ static bool manual_debug = false;
|
|||||||
static std::string required_repl_version;
|
static std::string required_repl_version;
|
||||||
static std::string required_galera_version;
|
static std::string required_galera_version;
|
||||||
static bool restart_galera = false;
|
static bool restart_galera = false;
|
||||||
|
static bool multiple_maxscales = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void signal_set(int sig, void (* handler)(int))
|
static void signal_set(int sig, void (* handler)(int))
|
||||||
@ -57,6 +58,11 @@ void TestConnections::skip_maxscale_start(bool value)
|
|||||||
maxscale::start = !value;
|
maxscale::start = !value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestConnections::multiple_maxscales(bool value)
|
||||||
|
{
|
||||||
|
maxscale::multiple_maxscales = value;
|
||||||
|
}
|
||||||
|
|
||||||
void TestConnections::require_repl_version(const char* version)
|
void TestConnections::require_repl_version(const char* version)
|
||||||
{
|
{
|
||||||
maxscale::required_repl_version = version;
|
maxscale::required_repl_version = version;
|
||||||
@ -666,11 +672,17 @@ void TestConnections::process_template(int m, const char* template_name, const c
|
|||||||
|
|
||||||
void TestConnections::init_maxscales()
|
void TestConnections::init_maxscales()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < maxscales->N; i++)
|
// Always initialize the first MaxScale
|
||||||
|
init_maxscale(0);
|
||||||
|
|
||||||
|
if (maxscale::multiple_maxscales)
|
||||||
|
{
|
||||||
|
for (int i = 1; i < maxscales->N; i++)
|
||||||
{
|
{
|
||||||
init_maxscale(i);
|
init_maxscale(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TestConnections::init_maxscale(int m)
|
void TestConnections::init_maxscale(int m)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -250,6 +250,9 @@ public:
|
|||||||
/** Skip initial start of MaxScale */
|
/** Skip initial start of MaxScale */
|
||||||
static void skip_maxscale_start(bool value);
|
static void skip_maxscale_start(bool value);
|
||||||
|
|
||||||
|
/** Prepare multiple maxscale instances */
|
||||||
|
static void multiple_maxscales(bool value);
|
||||||
|
|
||||||
/** Test requires a certain backend version */
|
/** Test requires a certain backend version */
|
||||||
static void require_repl_version(const char* version);
|
static void require_repl_version(const char* version);
|
||||||
static void require_galera_version(const char* version);
|
static void require_galera_version(const char* version);
|
||||||
|
|||||||
@ -344,6 +344,7 @@ MXS_DOWNSTREAM* filter_apply(const SFilterDef& filter, MXS_SESSION* session, MXS
|
|||||||
|
|
||||||
if ((me = (MXS_DOWNSTREAM*)MXS_CALLOC(1, sizeof(MXS_DOWNSTREAM))) == NULL)
|
if ((me = (MXS_DOWNSTREAM*)MXS_CALLOC(1, sizeof(MXS_DOWNSTREAM))) == NULL)
|
||||||
{
|
{
|
||||||
|
MXS_OOM();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
me->instance = filter->filter;
|
me->instance = filter->filter;
|
||||||
@ -351,6 +352,7 @@ MXS_DOWNSTREAM* filter_apply(const SFilterDef& filter, MXS_SESSION* session, MXS
|
|||||||
|
|
||||||
if ((me->session = filter->obj->newSession(me->instance, session)) == NULL)
|
if ((me->session = filter->obj->newSession(me->instance, session)) == NULL)
|
||||||
{
|
{
|
||||||
|
MXS_ERROR("Failed to create filter session for '%s'", filter->name.c_str());
|
||||||
MXS_FREE(me);
|
MXS_FREE(me);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,8 @@
|
|||||||
#define MYSQL57_PASSWORD "authentication_string"
|
#define MYSQL57_PASSWORD "authentication_string"
|
||||||
|
|
||||||
// Query used with 10.0 or older
|
// Query used with 10.0 or older
|
||||||
#define NEW_LOAD_DBUSERS_QUERY "SELECT u.user, u.host, d.db, u.select_priv, u.%s \
|
#define NEW_LOAD_DBUSERS_QUERY \
|
||||||
|
"SELECT u.user, u.host, d.db, u.select_priv, u.%s \
|
||||||
FROM mysql.user AS u LEFT JOIN mysql.db AS d \
|
FROM mysql.user AS u LEFT JOIN mysql.db AS d \
|
||||||
ON (u.user = d.user AND u.host = d.host) WHERE u.plugin IN ('', 'mysql_native_password') %s \
|
ON (u.user = d.user AND u.host = d.host) WHERE u.plugin IN ('', 'mysql_native_password') %s \
|
||||||
UNION \
|
UNION \
|
||||||
@ -53,8 +54,8 @@
|
|||||||
ON (u.user = t.user AND u.host = t.host) WHERE u.plugin IN ('', 'mysql_native_password') %s"
|
ON (u.user = t.user AND u.host = t.host) WHERE u.plugin IN ('', 'mysql_native_password') %s"
|
||||||
|
|
||||||
// Used with 10.2 or newer, supports composite roles
|
// Used with 10.2 or newer, supports composite roles
|
||||||
const char* mariadb_102_users_query =
|
const char* mariadb_102_users_query
|
||||||
// `t` is users that are not roles
|
= // `t` is users that are not roles
|
||||||
"WITH RECURSIVE t AS ( "
|
"WITH RECURSIVE t AS ( "
|
||||||
" SELECT u.user, u.host, d.db, u.select_priv, u.password AS password, u.is_role, u.default_role"
|
" SELECT u.user, u.host, d.db, u.select_priv, u.password AS password, u.is_role, u.default_role"
|
||||||
" FROM mysql.user AS u LEFT JOIN mysql.db AS d "
|
" FROM mysql.user AS u LEFT JOIN mysql.db AS d "
|
||||||
@ -78,8 +79,8 @@ const char* mariadb_102_users_query =
|
|||||||
"SELECT DISTINCT t.user, t.host, t.db, t.select_priv, t.password FROM users AS t %s";
|
"SELECT DISTINCT t.user, t.host, t.db, t.select_priv, t.password FROM users AS t %s";
|
||||||
|
|
||||||
// Query used with MariaDB 10.1, supports basic roles
|
// Query used with MariaDB 10.1, supports basic roles
|
||||||
const char* mariadb_users_query =
|
const char* mariadb_users_query
|
||||||
// First, select all users
|
= // First, select all users
|
||||||
"SELECT t.user, t.host, t.db, t.select_priv, t.password FROM "
|
"SELECT t.user, t.host, t.db, t.select_priv, t.password FROM "
|
||||||
"( "
|
"( "
|
||||||
" SELECT u.user, u.host, d.db, u.select_priv, u.password AS password, u.is_role "
|
" SELECT u.user, u.host, d.db, u.select_priv, u.password AS password, u.is_role "
|
||||||
@ -156,9 +157,9 @@ static char* get_users_query(const char *server_version, int version, bool inclu
|
|||||||
{
|
{
|
||||||
if (is_mariadb) // 10.1.1 or newer, supports default roles
|
if (is_mariadb) // 10.1.1 or newer, supports default roles
|
||||||
{
|
{
|
||||||
return version >= 100202 ?
|
return version >= 100202
|
||||||
get_mariadb_102_users_query(include_root) :
|
? get_mariadb_102_users_query(include_root)
|
||||||
get_mariadb_users_query(include_root);
|
: get_mariadb_users_query(include_root);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Either an older MariaDB version or a MySQL variant, use the legacy query
|
// Either an older MariaDB version or a MySQL variant, use the legacy query
|
||||||
@ -946,8 +947,8 @@ int get_users_from_server(MYSQL* con, SERVER_REF* server_ref, SERVICE* service,
|
|||||||
|
|
||||||
if (query)
|
if (query)
|
||||||
{
|
{
|
||||||
if (mxs_mysql_query(con, "USE mysql") == 0 && // Set default database in case we use CTEs
|
if (mxs_mysql_query(con, "USE mysql") == 0 // Set default database in case we use CTEs
|
||||||
mxs_mysql_query(con, query) == 0)
|
&& mxs_mysql_query(con, query) == 0)
|
||||||
{
|
{
|
||||||
MYSQL_RES* result = mysql_store_result(con);
|
MYSQL_RES* result = mysql_store_result(con);
|
||||||
|
|
||||||
|
|||||||
@ -52,6 +52,7 @@ TeeSession* TeeSession::create(Tee* my_instance, MXS_SESSION* session)
|
|||||||
if ((match && (md_match = pcre2_match_data_create_from_pattern(match, NULL)) == NULL)
|
if ((match && (md_match = pcre2_match_data_create_from_pattern(match, NULL)) == NULL)
|
||||||
|| (exclude && (md_exclude = pcre2_match_data_create_from_pattern(exclude, NULL)) == NULL))
|
|| (exclude && (md_exclude = pcre2_match_data_create_from_pattern(exclude, NULL)) == NULL))
|
||||||
{
|
{
|
||||||
|
MXS_OOM();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +60,9 @@ TeeSession* TeeSession::create(Tee* my_instance, MXS_SESSION* session)
|
|||||||
(MySQLProtocol*)session->client_dcb->protocol,
|
(MySQLProtocol*)session->client_dcb->protocol,
|
||||||
my_instance->get_service())) == NULL)
|
my_instance->get_service())) == NULL)
|
||||||
{
|
{
|
||||||
|
MXS_ERROR("Failed to create local client connection to '%s'%s",
|
||||||
|
my_instance->get_service()->name,
|
||||||
|
my_instance->get_service()->ports ? "" : ": Service has no network listeners");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -667,7 +667,7 @@ static inline bool session_ok_to_route(DCB* dcb)
|
|||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool expecting_resultset(MySQLProtocol* proto)
|
static inline bool expecting_text_result(MySQLProtocol* proto)
|
||||||
{
|
{
|
||||||
return proto->current_command == MXS_COM_QUERY
|
return proto->current_command == MXS_COM_QUERY
|
||||||
|| proto->current_command == MXS_COM_STMT_EXECUTE
|
|| proto->current_command == MXS_COM_STMT_EXECUTE
|
||||||
@ -861,7 +861,7 @@ static int gw_read_and_write(DCB* dcb)
|
|||||||
|
|
||||||
if (collecting_resultset(proto, capabilities))
|
if (collecting_resultset(proto, capabilities))
|
||||||
{
|
{
|
||||||
if (expecting_resultset(proto))
|
if (expecting_text_result(proto))
|
||||||
{
|
{
|
||||||
if (mxs_mysql_is_result_set(read_buffer))
|
if (mxs_mysql_is_result_set(read_buffer))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -37,7 +37,7 @@ static std::string extract_error(GWBUF* buffer)
|
|||||||
{
|
{
|
||||||
size_t replylen = MYSQL_GET_PAYLOAD_LEN(GWBUF_DATA(buffer));
|
size_t replylen = MYSQL_GET_PAYLOAD_LEN(GWBUF_DATA(buffer));
|
||||||
char replybuf[replylen];
|
char replybuf[replylen];
|
||||||
gwbuf_copy_data(buffer, 0, gwbuf_length(buffer), (uint8_t*)replybuf);
|
gwbuf_copy_data(buffer, 0, sizeof(replybuf), (uint8_t*)replybuf);
|
||||||
std::string err;
|
std::string err;
|
||||||
std::string msg;
|
std::string msg;
|
||||||
err.append(replybuf + 8, 5);
|
err.append(replybuf + 8, 5);
|
||||||
|
|||||||
@ -641,7 +641,8 @@ void SchemaRouterSession::handleError(GWBUF* pMessage,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ERRACT_REPLY_CLIENT:
|
case ERRACT_REPLY_CLIENT:
|
||||||
if (m_client->session->state == SESSION_STATE_ROUTER_READY)
|
// The session pointer can be NULL if the creation fails when filters are being set up
|
||||||
|
if (m_client->session && m_client->session->state == SESSION_STATE_ROUTER_READY)
|
||||||
{
|
{
|
||||||
m_client->func.write(m_client, gwbuf_clone(pMessage));
|
m_client->func.write(m_client, gwbuf_clone(pMessage));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user