Uncrustify maxscale

See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
This commit is contained in:
Niclas Antti
2018-09-09 22:26:19 +03:00
parent fa7ec95069
commit c447e5cf15
849 changed files with 35002 additions and 27238 deletions

View File

@ -1,7 +1,8 @@
/**
* @file bug592.cpp regression case for bug 592 ( "slave in "Running" state breaks authorization" ) MXS-326
*
* - stop all slaves: "stop slave;" directly to every node (now they are in "Running" state, not in "Russning, Slave")
* - stop all slaves: "stop slave;" directly to every node (now they are in "Running" state, not in "Russning,
*Slave")
* - via RWSplit "CREATE USER 'test_user'@'%' IDENTIFIED BY 'pass'"
* - try to connect using 'test_user' (expecting success)
* - start all slaves: "start slave;" directly to every node
@ -9,88 +10,88 @@
*/
/*
Timofey Turenko 2014-10-24 09:35:35 UTC
1. setup: Master/Slave replication
2. reboot slaves
3. create user usinf connection to RWSplit
4. try to use this user to connect to Maxscale
expected result:
Authentication is ok
actual result:
Access denied for user 'user'@'192.168.122.1' (using password: YES)
Th issue was discovered with following setup state:
MaxScale> show servers
Server 0x3428260 (server1)
Server: 192.168.122.106
Status: Master, Running
Protocol: MySQLBackend
Port: 3306
Server Version: 5.5.40-MariaDB-log
Node Id: 106
Master Id: -1
Slave Ids: 107, 108 , 109
Repl Depth: 0
Number of connections: 0
Current no. of conns: 0
Current no. of operations: 0
Server 0x3428160 (server2)
Server: 192.168.122.107
Status: Slave, Running
Protocol: MySQLBackend
Port: 3306
Server Version: 5.5.40-MariaDB-log
Node Id: 107
Master Id: 106
Slave Ids:
Repl Depth: 1
Number of connections: 0
Current no. of conns: 0
Current no. of operations: 0
Server 0x3428060 (server3)
Server: 192.168.122.108
Status: Running
Protocol: MySQLBackend
Port: 3306
Server Version: 5.5.40-MariaDB-log
Node Id: 108
Master Id: 106
Slave Ids:
Repl Depth: 1
Number of connections: 0
Current no. of conns: 0
Current no. of operations: 0
Server 0x338c3f0 (server4)
Server: 192.168.122.109
Status: Running
Protocol: MySQLBackend
Port: 3306
Server Version: 5.5.40-MariaDB-log
Node Id: 109
Master Id: 106
Slave Ids:
Repl Depth: 1
Number of connections: 0
Current no. of conns: 0
Current no. of operations: 0
Maxscale read mysql.user table from server4 which was not properly replicated
Comment 1 Mark Riddoch 2014-11-05 09:55:07 UTC
In the reload users routine, if there is a master available then use that rather than the first.
*/
* Timofey Turenko 2014-10-24 09:35:35 UTC
* 1. setup: Master/Slave replication
* 2. reboot slaves
* 3. create user usinf connection to RWSplit
* 4. try to use this user to connect to Maxscale
*
* expected result:
* Authentication is ok
*
* actual result:
* Access denied for user 'user'@'192.168.122.1' (using password: YES)
*
* Th issue was discovered with following setup state:
*
* MaxScale> show servers
* Server 0x3428260 (server1)
* Server: 192.168.122.106
* Status: Master, Running
* Protocol: MySQLBackend
* Port: 3306
* Server Version: 5.5.40-MariaDB-log
* Node Id: 106
* Master Id: -1
* Slave Ids: 107, 108 , 109
* Repl Depth: 0
* Number of connections: 0
* Current no. of conns: 0
* Current no. of operations: 0
* Server 0x3428160 (server2)
* Server: 192.168.122.107
* Status: Slave, Running
* Protocol: MySQLBackend
* Port: 3306
* Server Version: 5.5.40-MariaDB-log
* Node Id: 107
* Master Id: 106
* Slave Ids:
* Repl Depth: 1
* Number of connections: 0
* Current no. of conns: 0
* Current no. of operations: 0
* Server 0x3428060 (server3)
* Server: 192.168.122.108
* Status: Running
* Protocol: MySQLBackend
* Port: 3306
* Server Version: 5.5.40-MariaDB-log
* Node Id: 108
* Master Id: 106
* Slave Ids:
* Repl Depth: 1
* Number of connections: 0
* Current no. of conns: 0
* Current no. of operations: 0
* Server 0x338c3f0 (server4)
* Server: 192.168.122.109
* Status: Running
* Protocol: MySQLBackend
* Port: 3306
* Server Version: 5.5.40-MariaDB-log
* Node Id: 109
* Master Id: 106
* Slave Ids:
* Repl Depth: 1
* Number of connections: 0
* Current no. of conns: 0
* Current no. of operations: 0
*
*
* Maxscale read mysql.user table from server4 which was not properly replicated
* Comment 1 Mark Riddoch 2014-11-05 09:55:07 UTC
* In the reload users routine, if there is a master available then use that rather than the first.
*/
#include <iostream>
#include "testconnections.h"
int main(int argc, char *argv[])
int main(int argc, char* argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
TestConnections* Test = new TestConnections(argc, argv);
Test->set_timeout(10);
int i;
@ -99,13 +100,17 @@ int main(int argc, char *argv[])
for (i = 1; i < Test->repl->N; i++)
{
execute_query(Test->repl->nodes[i], (char *) "stop slave;");
execute_query(Test->repl->nodes[i], (char*) "stop slave;");
}
execute_query(Test->maxscales->conn_rwsplit[0], (char *) "CREATE USER 'test_user'@'%%' IDENTIFIED BY 'pass'");
execute_query(Test->maxscales->conn_rwsplit[0],
(char*) "CREATE USER 'test_user'@'%%' IDENTIFIED BY 'pass'");
MYSQL * conn = open_conn_no_db(Test->maxscales->rwsplit_port[0], Test->maxscales->IP[0], (char *) "test_user", (char *) "pass",
Test->ssl);
MYSQL* conn = open_conn_no_db(Test->maxscales->rwsplit_port[0],
Test->maxscales->IP[0],
(char*) "test_user",
(char*) "pass",
Test->ssl);
if (conn == NULL)
{
@ -114,10 +119,10 @@ int main(int argc, char *argv[])
for (i = 1; i < Test->repl->N; i++)
{
execute_query(Test->repl->nodes[i], (char *) "start slave;");
execute_query(Test->repl->nodes[i], (char*) "start slave;");
}
execute_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP USER 'test_user'@'%%'");
execute_query(Test->maxscales->conn_rwsplit[0], (char*) "DROP USER 'test_user'@'%%'");
Test->repl->close_connections();
Test->maxscales->close_maxscale_connections(0);
@ -125,5 +130,4 @@ int main(int argc, char *argv[])
int rval = Test->global_result;
delete Test;
return rval;
}