Format all sources with Uncrustify

Formatted all sources and manually tuned some files to make the code look
neater.
This commit is contained in:
Markus Mäkelä
2018-09-10 12:40:03 +03:00
parent edd5ddcc88
commit d11c78ad80
183 changed files with 1865 additions and 1695 deletions

View File

@ -45,4 +45,4 @@ void load(long* new_inserts,
bool galera,
bool report_errors);
#endif // BIG_LOAD_H
#endif // BIG_LOAD_H

View File

@ -14,4 +14,4 @@
*/
int big_transaction(MYSQL* conn, int N);
#endif // BIG_TRANSACTION_H
#endif // BIG_TRANSACTION_H

View File

@ -1,6 +1,6 @@
/**
* @file binlog_big_transaction.cpp test of simple binlog router setup and execute a number of big
*transactions
* transactions
*/

View File

@ -1,6 +1,6 @@
/**
* @file binlog_change_master.cpp In the binlog router setup stop Master and promote one of the Slaves to be
*new Master
* new Master
* - setup binlog
* - start thread wich executes transactions
* - block master

View File

@ -10,7 +10,7 @@
* - stop all Maxscale machines with STOP SLAVE command
* - check which Maxscale machine contains most recent data (let's call this machine 'most_recent_maxscale')
* - use CHANGE MASETER on the second Maxscale machine to point it to the Maxscale machine from the previous
*step ('most_recent_maxscale')
* step ('most_recent_maxscale')
* - wait until second Maxscale is in sync with 'most_recent_maxscale' (use SHOW MASTER STATUS)
* - select new master (HOW??)
* - set all Maxscale machines to be a slaves of new master

View File

@ -23,7 +23,7 @@ int test_longblob(TestConnections* Test,
/**
* @brief check_longblob_data Does SELECT against table created by test_longblob() and cheks that data are
*correct
* correct
* @param Test TestConnection object
* @param conn MYSQL connection handler
* @param chunk_size size of one data chunk (in sizeof(long usingned))
@ -37,4 +37,4 @@ int check_longblob_data(TestConnections* Test,
int chunks,
int rows);
#endif // BLOB_TEST_H
#endif // BLOB_TEST_H

View File

@ -1,11 +1,11 @@
/**
* @file bug469 bug469 regression test case ("rwsplit counts every connection twice in master - counnection
*counts leak")
* counts leak")
* - use maxadmin command "show server server1" and check "Current no. of conns" and "Number of connections" -
*both should be 0
* both should be 0
* - execute simple query against RWSplit
* - use maxadmin command "show server server1" and check "Current no. of conns" (should be 0) and "Number of
*connections" (should be 1)
* connections" (should be 1)
*/

View File

@ -2,7 +2,7 @@
* @file bug471.cpp bug471 regression case ( Routing Hints route to server sometimes doesn't work )
*
* - try "select @@server_id; -- maxscale route to server server%d" (where %d - server number) and compares
*result
* result
* with "select @@server_id;" sent directly to backend node.
* - do it 25 times.
*/

View File

@ -2,7 +2,7 @@
* @file bug479.cpp regression case for bug 479 ( Undefined filter reference in MaxScale.cnf causes a crash)
*
* - Maxscale.cnf with "filters=non existing filter | не существуюший фильтер", cheks error log for warnings
*and
* and
* - check if Maxscale is alive
*/

View File

@ -1,6 +1,6 @@
/**
* @file bug488.cpp regression case for bug 488 ("SHOW VARIABLES randomly failing with "Lost connection to
*MySQL server")
* MySQL server")
*
* - try "SHOW VARIABLES;" 100 times against all Maxscale services
* First round: 100 iterations for RWSplit, then ReadConn Master, then ReadConn Slave

View File

@ -1,6 +1,6 @@
/**
* @file bug495.cpp regression case for bug 495 ( Referring to a nonexisting server in servers=... doesn't
*even raise a warning )
* even raise a warning )
*
* - Maxscale.cnf with "servers= server1, server2,server3 ,server4,server5"
* but 'server5' is not defined. Test checks error log for proper error message.

View File

@ -98,17 +98,15 @@ int main(int argc, char* argv[])
char last_insert_id1[1024];
char last_insert_id2[1024];
if ((
find_field(
Test->maxscales->conn_rwsplit[0],
sel1,
"@@server_id",
&last_insert_id1[0])
find_field(Test->maxscales->conn_rwsplit[0],
sel1,
"@@server_id",
&last_insert_id1[0])
!= 0 ) || (
find_field(
Test->repl->nodes[0],
sel1,
"@@server_id",
&last_insert_id2[0])
find_field(Test->repl->nodes[0],
sel1,
"@@server_id",
&last_insert_id2[0])
!= 0 ))
{
Test->tprintf("@@server_id fied not found!!\n");

View File

@ -1,12 +1,12 @@
/**
* @file bug509.cpp regression case for bug 509 and 507 ( "Referring to a nonexisting server in servers=...
*doesn't even raise a warning"
* doesn't even raise a warning"
* and "rw-split router does not send last_insert_id() to master" )
*
* - "CREATE TABLE t2 (id INT(10) NOT NULL AUTO_INCREMENT, x int, PRIMARY KEY (id));",
* - do a number of INSERTs first using RWsplit, then directly Galera nodes.
* - do "select @@wsrep_node_address, last_insert_id();" and "select last_insert_id(), @@wsrep_node_address;"
*and compares results.
* and compares results.
* - do "insert into t2 (x) values (i);" 1000 times and compares results of
* "select @@wsrep_node_address, last_insert_id();" and "select last_insert_id(), @@wsrep_node_address;"
*
@ -86,17 +86,15 @@ int main(int argc, char* argv[])
char last_insert_id1[1024];
char last_insert_id2[1024];
if ((
find_field(
Test->maxscales->conn_rwsplit[0],
sel1,
"last_insert_id()",
&last_insert_id1[0])
find_field(Test->maxscales->conn_rwsplit[0],
sel1,
"last_insert_id()",
&last_insert_id1[0])
!= 0 ) || (
find_field(
Test->maxscales->conn_rwsplit[0],
sel2,
"last_insert_id()",
&last_insert_id2[0])
find_field(Test->maxscales->conn_rwsplit[0],
sel2,
"last_insert_id()",
&last_insert_id2[0])
!= 0 ))
{
Test->tprintf("last_insert_id() fied not found!!\n");

View File

@ -5,11 +5,11 @@
* - check number of connections to Master - failure if there are more then 100 connections to master.
* - close RWSptit and ReadConn master connections and check connections to master again.
* - create 50 ReadConn slave connection in parallel threads, execute "SELECT * FROM t1" ones for every
*connections, then
* connections, then
* start using one of connections to create "SELECT" load.
* - check number of connections to Master again, wait 5 seconds and check number of connections to
* master ones more time: now expecting 0 connections to master (fail if there is a least one connection to
*master).
* master).
* - close and reopens all ReadConn slave connections in the main thread and check connections to master again
* - close all connection in all threads, close parallel thread
* - do final 'connections to master' check

View File

@ -1,6 +1,6 @@
/**
* @file bug587.cpp regression case for the bug 587 ( "Hint filter don't work if listed before regex filter
*in configuration file" )
* in configuration file" )
*
* - Maxscale.cnf
* @verbatim

View File

@ -2,7 +2,7 @@
* @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")
* 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

View File

@ -1,6 +1,6 @@
/**
* @file bug601.cpp regression case for bug 601 ("COM_CHANGE_USER fails with correct user/pwd if executed
*during authentication")
* during authentication")
* - configure Maxscale.cnf to use only one thread
* - in 100 parallel threads start to open/close session
* - do change_user 2000 times

View File

@ -1,6 +1,6 @@
/**
* @file bug643.cpp regression case for bugs 643 ("Hints, RWSplit: MaxScale goes into infinite loop and
*crashes") and bug645
* crashes") and bug645
* - setup RWSplit in the following way for bug643
* @verbatim
* [RW Split Router]

View File

@ -1,6 +1,6 @@
/**
* @file bug643.cpp regression case for bugs 643 ("Hints, RWSplit: MaxScale goes into infinite loop and
*crashes") and bug645
* crashes") and bug645
* - setup RWSplit in the following way for bug643
* @verbatim
* [hints]

View File

@ -1,6 +1,6 @@
/**
* @file bug650.cpp regression case for bug 650 ("Hints, RWSplit: MaxScale goes into infinite loop and
*crashes") and bug645
* crashes") and bug645
* - try simple query using all services
* - check for errors in the log
*/

View File

@ -1,10 +1,10 @@
/**
* @file bug653.cpp regression case for bug 653 ("Memory corruption when users with long hostnames that can
*no the resolved are loaded into MaxScale")
* no the resolved are loaded into MaxScale")
*
* - CREATE USER
*'user_with_very_long_hostname'@'very_long_hostname_that_can_not_be_resolved_and_it_probably_caused_crash.com.net.org'
*IDENTIFIED BY 'old';
* IDENTIFIED BY 'old';
* - try to connect using user 'user_with_very_long_hostname'
* - DROP USER
*'user_with_very_long_hostname'@'very_long_hostname_that_can_not_be_resolved_and_it_probably_caused_crash.com.net.org'

View File

@ -1,6 +1,6 @@
/**
* @file bug654.cpp regression case for bug654 abd 698 ("maxadm: show dbusers <two-part service name without
*quotation> causes SEGFAULT", "Using invalid parameter in many maxadmin commands causes MaxScale to fail")
* quotation> causes SEGFAULT", "Using invalid parameter in many maxadmin commands causes MaxScale to fail")
*
* - execute maxadmin command show dbusers RW Split Router and show dbusers "RW Split Router"
* . execute different maxadmin commands with wrong parameters

View File

@ -1,6 +1,6 @@
/**
* @file bug656.cpp Checks Maxscale behaviour in case if Master node is blocked - NOT NEEDED BECAUSE IT IS
*ALREADY CHECKED BY OTHER TESTS!!!!
* ALREADY CHECKED BY OTHER TESTS!!!!
*
* - ConnecT to RWSplit
* - block Mariadb server on Master node by Firewall

View File

@ -1,7 +1,7 @@
/**
* @file bug662.cpp regression case for bug 662 ("MaxScale hangs in startup if backend server is not
*responsive"), covers also bug680 ("RWSplit can't load DB user if backend is not available at MaxScale
*start")
* responsive"), covers also bug680 ("RWSplit can't load DB user if backend is not available at MaxScale
* start")
*
* - Block all Mariadb servers
* - Restart MaxScale

View File

@ -41,4 +41,4 @@ const char* bug670_sql
delete from mysql.t1 where id = 7; \
select 1 as \"endof cycle\" from dual;\n";
#endif // BUG670_SQL_H
#endif // BUG670_SQL_H

View File

@ -1,6 +1,6 @@
/**
* @file bug673.cpp regression case for bug673 ("MaxScale crashes if "Users table data" is empty and "show
*dbusers" is executed in maxadmin")
* dbusers" is executed in maxadmin")
*
* - Configure wrong IP for all backends
* - Execute maxadmin command show dbusers "RW Split Router"

View File

@ -1,6 +1,6 @@
/**
* @file bug681.cpp - regression test for bug681 ("crash if max_slave_connections=10% and 4 or less backends
*are configured")
* are configured")
*
* - Configure RWSplit with max_slave_connections=10%
* - check ReadConn master and ReadConn slave are alive and RWSplit is not started

View File

@ -1,6 +1,6 @@
/**
* @file bug694.cpp - regression test for bug694 ("RWSplit: SELECT @a:=@a+1 as a, test.b FROM test breaks
*client session")
* client session")
*
* - set use_sql_variables_in=all in MaxScale.cnf
* - connect to readwritesplit router and execute:

View File

@ -1,6 +1,6 @@
/**
* @file bug699.cpp regression case for bug 699 ( "rw-split sensitive to order of terms in field list of
*SELECT (round 2)" )
* SELECT (round 2)" )
*
* - compare @@hostname from "select @@wsrep_node_name, @@hostname" and "select @@hostname,
*@@wsrep_node_name"
@ -223,17 +223,15 @@ int main(int argc, char* argv[])
char serverid2[1024];
if ((
find_field(
Test->maxscales->conn_rwsplit[0],
sel3,
"@@server_id",
&serverid1[0])
find_field(Test->maxscales->conn_rwsplit[0],
sel3,
"@@server_id",
&serverid1[0])
!= 0 ) || (
find_field(
Test->maxscales->conn_rwsplit[0],
sel4,
"@@server_id",
&serverid2[0])
find_field(Test->maxscales->conn_rwsplit[0],
sel4,
"@@server_id",
&serverid2[0])
!= 0 ))
{
Test->add_result(1, "@@server_id field not found!!\n");
@ -249,17 +247,15 @@ int main(int argc, char* argv[])
}
if ((
find_field(
Test->maxscales->conn_rwsplit[0],
sel1,
"@@hostname",
&serverid1[0])
find_field(Test->maxscales->conn_rwsplit[0],
sel1,
"@@hostname",
&serverid1[0])
!= 0 ) || (
find_field(
Test->maxscales->conn_rwsplit[0],
sel2,
"@@hostname",
&serverid2[0])
find_field(Test->maxscales->conn_rwsplit[0],
sel2,
"@@hostname",
&serverid2[0])
!= 0 ))
{
Test->add_result(1, "@@hostname field not found!!\n");

View File

@ -1,6 +1,6 @@
/**
* @file bug705.cpp regression case for bug 705 ("Authentication fails when the user connects to a database
*when the SQL mode includes ANSI_QUOTES")
* when the SQL mode includes ANSI_QUOTES")
*
* - use only one backend
* - derectly to backend SET GLOBAL sql_mode="ANSI"
@ -117,11 +117,11 @@
|
| mysql root@centos-7-minimal:[Mon Jan 26 14:27:33 2015][(none)]> SET SESSION sql_mode = "POSTGRESQL";
|select @@sql_mode;
|
|
|
|
|
|
|
|
|
|
| Query
|OK, 0 rows affected (0.00 sec)
|
@ -197,7 +197,8 @@
|via mysql client
| Comment 5 ivan.stoykov@skysql.com 2015-01-26 16:37:32 UTC
| There is at least one case that after setting the sql_mode to string :
| "REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
|
|"REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
|at 10.0.15-MariaDB-wsrep-log , using maxscale in this way returned an error.
|
| $ mysql --host max-scale-host --user=test --password=xxx --port 4449 mysqlslap

View File

@ -1,6 +1,6 @@
/**
* @file bug711.cpp bug711 regression case (Some MySQL Workbench Management actions hang with R/W split
*router)
* router)
* - configure rwsplit with use_sql_variables_in=all
* - try SHOW GLOBAL STATUS with all maxscales->routers[0]
* - check if Maxscale is still alive

View File

@ -1,6 +1,6 @@
/**
* @file bug730.cpp regression case for bug 730 ("Regex filter and shorter than original replacement queries
*MaxScale")
* MaxScale")
*
* - setup regex filter, add it to all maxscales->routers[0]
* @verbatim

View File

@ -123,9 +123,9 @@ int bind_by_row(MYSQL* mysql)
struct st_data data[] =
{
{0, STMT_INDICATOR_NULL, "Monty", STMT_INDICATOR_NTS, "Widenius", STMT_INDICATOR_NTS },
{0, STMT_INDICATOR_NULL, "David", STMT_INDICATOR_NTS, "Axmark", STMT_INDICATOR_NTS },
{0, STMT_INDICATOR_NULL, "default", STMT_INDICATOR_DEFAULT, "N.N.", STMT_INDICATOR_NTS },
{0, STMT_INDICATOR_NULL, "Monty", STMT_INDICATOR_NTS, "Widenius", STMT_INDICATOR_NTS},
{0, STMT_INDICATOR_NULL, "David", STMT_INDICATOR_NTS, "Axmark", STMT_INDICATOR_NTS},
{0, STMT_INDICATOR_NULL, "default", STMT_INDICATOR_DEFAULT, "N.N.", STMT_INDICATOR_NTS},
};
unsigned int array_size = 3;

View File

@ -1,6 +1,6 @@
/**
* @file change_master_during_seesion.cpp Tries to reconfigure replication setup to use another node as a
*Master
* Master
* - connect to RWSplit
* - reconfugure backend
* - checks that after time > monitor_interval everything is ok

View File

@ -2,13 +2,13 @@
* @file change_user.cpp mysql_change_user test
*
* - using RWSplit and user 'skysql': GRANT SELECT ON test.* TO user@'%' identified by 'pass2'; FLUSH
*PRIVILEGES;
* PRIVILEGES;
* - create a new connection to RSplit as 'user'
* - try INSERT expecting 'access denied'
* - call mysql_change_user() to change user to 'skysql'
* - try INSERT again expecting success
* - try to execute mysql_change_user() to switch to user 'user' but use rong password (expecting access
*denied)
* denied)
* - try INSERT again expecting success (user should not be changed)
*/

View File

@ -2,7 +2,7 @@
* @file connection_limit.cpp connection_limit check if max_connections parameter works
*
* - Maxscale.cnf contains max_connections=10 for RWSplit, max_connections=20 for ReadConn master and
*max_connections=25 for ReadConn slave
* max_connections=25 for ReadConn slave
* - create max num of connections and check tha N+1 connection fails
*/

View File

@ -22,7 +22,7 @@ MYSQL* connect_to_serv(TestConnections* Test, bool binlog);
/**
* @brief set_max_packet Executes 'cmd' on Master of RWSplit ('cmd' should be 'set global
*max_paxket_size=...')
* max_paxket_size=...')
* @param Test TestConnections object
* @param binlog if true - connects to Master, otherwise - to RWSplit router
* @param cmd command to execute
@ -36,4 +36,4 @@ void set_max_packet(TestConnections* Test, bool binlog, char* cmd);
*/
void different_packet_size(TestConnections* Test, bool binlog);
#endif // DIFFERENT_SIZE_H
#endif // DIFFERENT_SIZE_H

View File

@ -14,4 +14,4 @@ using namespace std;
*/
int execute_cmd(char* cmd, char** res);
#endif // EXECUTE_CMD_H
#endif // EXECUTE_CMD_H

View File

@ -7,7 +7,7 @@
* - unblock backend nodes
* - wait for monitor
* - check that we are still using the last node to which we failed over to and that the old nodes are in
*maintenance mode
* maintenance mode
*/

View File

@ -11,4 +11,4 @@
*/
void copy_rules(TestConnections* Test, const char* rules_name, const char* rules_dir);
#endif // FW_COPY_RULES_H
#endif // FW_COPY_RULES_H

View File

@ -1,16 +1,16 @@
/**
* @file fwf - Firewall filter test (also regression test for MXS-683 "qc_mysqlembedded reports as-name
*instead of original-name")
* instead of original-name")
* - setup Firewall filter to use rules from rule file fw/ruleXX, where XX - number of sub-test
* - execute queries for fw/passXX file, expect OK
* - execute queries from fw/denyXX, expect Access Denied error (mysql_error 1141)
* - repeat for all XX
* - setup Firewall filter to block queries next 2 minutes using 'at_time' statement (see template
*fw/rules_at_time)
* fw/rules_at_time)
* - start sending queries, expect Access Denied now and OK after two mintes
* - setup Firewall filter to limit a number of queries during certain time
* - start sending queries as fast as possible, expect OK for N first quries and Access Denied for next
*queries
* queries
* - wait, start sending queries again, but only one query per second, expect OK
* - try to load rules with syntax error, expect failure for all sessions and queries
*/

View File

@ -5,11 +5,11 @@
* - execute queries from fw/denyXX, expect Access Denied error (mysql_error 1141)
* - repeat for all XX
* - setup Firewall filter to block queries next 2 minutes using 'at_time' statement (see template
*fw/rules_at_time)
* fw/rules_at_time)
* - start sending queries, expect Access Denied now and OK after two mintes
* - setup Firewall filter to limit a number of queries during certain time
* - start sending queries as fast as possible, expect OK for N first quries and Access Denied for next
*queries
* queries
* - wait, start sending queries again, but only one query per second, expect OK
* - try to load rules with syntax error, expect failure for all sessions and queries
*/

View File

@ -30,4 +30,4 @@ int print_delta(long int* new_selects,
int nodes_num);
#endif // GET_COM_SELECT_INSERT_H
#endif // GET_COM_SELECT_INSERT_H

View File

@ -10,4 +10,4 @@
*/
int get_my_ip(char* remote_ip, char* my_ip);
#endif // GET_MY_IP_H
#endif // GET_MY_IP_H

View File

@ -9,4 +9,4 @@ char virtual_ip[16];
char* print_version_string(TestConnections* Test);
void configure_keepalived(TestConnections* Test, char* keepalived_file);
#endif // KEEPALIVED_FUNC_H
#endif // KEEPALIVED_FUNC_H

View File

@ -157,23 +157,20 @@ int main(int argc, char* argv[])
Test->repl->close_connections();
Test->tprintf("Trying use usr1 to execute query: RW Split\n");
Test->add_result(
Test->repl->ssh_node(1,
"echo select User,Host from mysql.user | mysql -uusr1 -h maxscale.maxscale.test -P 4006",
false),
"Error executing query against RW Split\n");
Test->add_result(Test->repl->ssh_node(1,
"echo select User,Host from mysql.user | mysql -uusr1 -h maxscale.maxscale.test -P 4006",
false),
"Error executing query against RW Split\n");
Test->tprintf("Trying use usr1 to execute query: Read Connection Master\n");
Test->add_result(
Test->repl->ssh_node(1,
"echo select User,Host from mysql.user | mysql -uusr1 -h maxscale.maxscale.test -P 4008",
false),
"Error executing query against Read Connection Master\n");
Test->add_result(Test->repl->ssh_node(1,
"echo select User,Host from mysql.user | mysql -uusr1 -h maxscale.maxscale.test -P 4008",
false),
"Error executing query against Read Connection Master\n");
Test->tprintf("Trying use usr1 to execute query: Read Connection Slave\n");
Test->add_result(
Test->repl->ssh_node(1,
"echo select User,Host from mysql.user | mysql -uusr1 -h maxscale.maxscale.test -P 4009",
false),
"Error executing query against Read Connection Slave\n");
Test->add_result(Test->repl->ssh_node(1,
"echo select User,Host from mysql.user | mysql -uusr1 -h maxscale.maxscale.test -P 4009",
false),
"Error executing query against Read Connection Slave\n");
for (int i = 0; i < Test->repl->N; i++)
{

View File

@ -5,12 +5,12 @@
*'persistpoolmax=10' for all servers)
*
* - start two groups of threads: each group consists of 25 threads, each thread creates connections to
*RWSplit,
* RWSplit,
* threads from first group try to execute as many SELECTs as possible, from second group - one query per
*second
* second
* - after 100 seconds all threads are stopped
* - check number of connections to every slave: test PASSED if COM_SELECT difference between slaves is not
*greater then 3 times and no
* greater then 3 times and no
* more then 10% of quesries went to Master
*/

View File

@ -5,12 +5,12 @@
*'persistpoolmax=1' and 'persistpoolmax=10' for all servers)
*
* - start two groups of threads: each group consists of 25 threads, each thread creates connections to
*RWSplit,
* RWSplit,
* threads from first group try to execute as many SELECTs as possible, from second group - one query per
*second
* second
* - after 100 seconds all threads are stopped
* - check number of connections to every slave: test PASSED if COM_SELECT difference between slaves is not
*greater then 3 times and no
* greater then 3 times and no
* more then 10% of quesries went to Master
*/

View File

@ -134,7 +134,7 @@ static MYSQL* open_conn_no_db(int port,
/**
* @brief Executes SQL query. Function also executes mysql_store_result() and mysql_free_result() to clean up
*returns
* returns
* @param conn MYSQL connection
* @param format SQL string with printf style formatting
* @param ... Parameters for @c format
@ -144,7 +144,7 @@ int execute_query(MYSQL* conn, const char* format, ...) mxb_attribute((format(pr
/**
* @brief execute_query_from_file Read a line from a file, trim leading and trailing whitespace and execute
*it.
* it.
* @param conn MYSQL handler
* @param file file handler
* @return 0 in case of success
@ -153,7 +153,7 @@ int execute_query_from_file(MYSQL* conn, FILE* file);
/**
* @brief Executes SQL query. Function also executes mysql_store_result() and mysql_free_result() to clean up
*returns
* returns
* @param conn MYSQL connection struct
* @param sql SQL string
* @return 0 in case of success
@ -344,4 +344,4 @@ private:
MYSQL* m_conn = nullptr;
};
#endif // MARIADB_FUNC_H
#endif // MARIADB_FUNC_H

View File

@ -228,12 +228,11 @@ int Mariadb_nodes::find_master()
int master_node = 255;
while ((found == 0) && (i < N))
{
if (find_field(
nodes[i],
(char*) "show slave status;",
(char*) "Master_Host",
&str[0]
) == 0)
if (find_field(nodes[i],
(char*) "show slave status;",
(char*) "Master_Host",
&str[0]
) == 0)
{
found = 1;
strcpy(master_IP, str);

View File

@ -344,7 +344,7 @@ public:
/**
* @brief disable_ssl Modifies my.cnf in order to get rid of ssl, redefine access user to allow
*connections without ssl
* connections without ssl
* @return 0 if success
*/
int disable_ssl();
@ -485,4 +485,4 @@ public:
// }
};
#endif // MARIADB_NODES_H
#endif // MARIADB_NODES_H

View File

@ -66,7 +66,7 @@ int sendCommand(int so, char* cmd, char* buf);
/**
* @brief Send a comamnd using the MaxScaled protocol, search for certain numeric parameter in MaxScaled
*output.
* output.
*
* Input terminates with a lien containing just the text OK
*
@ -108,4 +108,4 @@ int execute_maxadmin_command_tcp(char* hostname, char* user, char* password, cha
*/
int execute_maxadmin_command_print_pcp(char* hostname, char* user, char* password, char* cmd);
#endif // MAXADMIN_OPERATIONS_H
#endif // MAXADMIN_OPERATIONS_H

View File

@ -22,4 +22,4 @@ int setnonblocking(int sock);
int get_x_fl_from_json(char* line, long long int* x1, long long int* fl);
#endif // MAXINFO_FUNC_H
#endif // MAXINFO_FUNC_H

View File

@ -108,10 +108,10 @@ public:
/**
* @brief ConnectMaxscale Opens connections to RWSplit, ReadConn master and ReadConn slave Maxscale
*services
* services
* Opens connections to RWSplit, ReadConn master and ReadConn slave Maxscale services
* Connections stored in maxscales->conn_rwsplit[0], maxscales->conn_master[0] and
*maxscales->conn_slave[0] MYSQL structs
* maxscales->conn_slave[0] MYSQL structs
* @return 0 in case of success
*/
int connect_maxscale(int m = 0);
@ -132,21 +132,21 @@ public:
/**
* @brief ConnectRWSplit Opens connections to RWSplit and store MYSQL struct in
*maxscales->conn_rwsplit[0]
* maxscales->conn_rwsplit[0]
* @return 0 in case of success
*/
int connect_rwsplit(int m = 0);
/**
* @brief ConnectReadMaster Opens connections to ReadConn master and store MYSQL struct in
*maxscales->conn_master[0]
* maxscales->conn_master[0]
* @return 0 in case of success
*/
int connect_readconn_master(int m = 0);
/**
* @brief ConnectReadSlave Opens connections to ReadConn slave and store MYSQL struct in
*maxscales->conn_slave[0]
* maxscales->conn_slave[0]
* @return 0 in case of success
*/
int connect_readconn_slave(int m = 0);
@ -280,7 +280,7 @@ public:
/**
* @brief find_master_maxadmin Tries to find node with 'Master' status using Maxadmin connand 'show
*server'
* server'
* @param nodes Mariadb_nodes object
* @return node index if one master found, -1 if no master found or several masters found
*/
@ -309,4 +309,4 @@ public:
void wait_for_monitor(int intervals = 1, int m = 0);
};
#endif // MAXSCALES_H
#endif // MAXSCALES_H

View File

@ -1,6 +1,6 @@
/**
* @file mxs1045.cpp Regression case for the bug "Defunct processes after maxscale have executed script during
*failover"
* failover"
* - configure monitor:
* @verbatim
* script=/bin/sh -c "echo hello world!"

View File

@ -236,7 +236,7 @@ int compare_expected(TestConnections* Test, const char* sql, my_ulonglong exp_i,
/**
* @brief compare_stmt_expected Execute prepared statement and compare number of rows in every result set with
*expected values
* expected values
* This function uses mysql_stmt-* functions (COM_STMT_EXECUTE, COM_STMT_FETCH)
* @param Test TestConnections object
* @param stmt MYSQL_STMT prepared statement handler

View File

@ -8,7 +8,7 @@
* - check that all slave have the same data
* - 'maxbinlogcheck' against Maxscale binlog file
* - check 'maxbinlogcheck' output for lack of errors and presence of 'Decrypting binlog file with algorithm'
*message
* message
* - try remote access to Maxscale binlog with 'mysqlbinlog'
* - copy Maxscale binlogs to Master and check output of 'show binary logs' before and after copying
* (expect same file name and size, but different checksums)
@ -22,7 +22,7 @@
/**
* @brief get_first_binlog_file Get name, size and checksum of first binlog file from 'show binary logs'
*output list
* output list
* @param Test TestConnections object
* @param name string for file name
* @param size variable for file size

View File

@ -1,6 +1,6 @@
/**
* @file mxs118.cpp bug mxs118 regression case ("Two monitors loaded at the same time result into not working
*installation")
* installation")
*
* - Configure two monitors using same backend serves
* - try to connect to maxscale

View File

@ -1,6 +1,6 @@
/**
* @file mxs127.cpp - bug mxs-127 regression case ("disable_sescmd_history causes MaxScale to crash under
*load")
* load")
* - execute set @test=%d 10000 times against RWSplit, ReadConn Master and ReadConn Slave
*/

View File

@ -1,6 +1,6 @@
/**
* MXS-1476: priority value ignored when a Galera node rejoins with a lower wsrep_local_index than current
*master
* master
*
* https://jira.mariadb.org/browse/MXS-1476
*/

View File

@ -1,6 +1,6 @@
/**
* @file mxs244_prepared_stmt_loop.cpp mxs244_prepared_stmt_loop executed following statements in the loop
*against all maxscales->routers[0]:
* against all maxscales->routers[0]:
* @verbatim
* SET NAMES "UTF8";
* PREPARE s1 FROM 'SHOW GLOBAL STATUS WHERE variable_name = ?';

View File

@ -1,6 +1,6 @@
/**
* @file mxs280_select_outfile.cpp bug mxs280 regression case ("SELECT INTO OUTFILE query succeeds even if
*backed fails")
* backed fails")
*
* - Create /tmp/t1.csv on all backends
* - creat t1 table, put some data into it

View File

@ -51,8 +51,8 @@ int main(int argc, char** argv)
TestConnections test(argc, argv);
self = &test;
Queries rw_ok({{"INSERT INTO test.t1 VALUES (1)", true}, {"SELECT * FROM test.t1", true}});
Queries rw_err({{"INSERT INTO test.t1 VALUES (1)", false}, {"SELECT * FROM test.t1", true}});
Queries rw_ok({ {"INSERT INTO test.t1 VALUES (1)", true}, {"SELECT * FROM test.t1", true}});
Queries rw_err({ {"INSERT INTO test.t1 VALUES (1)", false}, {"SELECT * FROM test.t1", true}});
Func block_master = [&test]() {
test.repl->block_node(0);

View File

@ -4,7 +4,7 @@
* - create 'user' with password 'pass2'
* - create load on Master (3 threads are inserting data into 't1' in the loop)
* - in 40 parallel threads open connection, execute change_user to 'user', execute change_user to default
*user, close connection
* user, close connection
* - repeat test first only for RWSplit and second for all maxscales->routers[0]
* - check logs for lack of "Unable to write to backend 'server2' due to authentication failure" errors
* - check for lack of crashes in the log

View File

@ -2,7 +2,7 @@
* @file mxs564_big_dump.cpp MXS-564 regression case ("Loading database dump through readwritesplit fails")
* - configure Maxscale to use Galera cluster
* - start several threads which are executing session command and then sending INSERT queries agaist RWSplit
*router
* router
* - after a while block first slave
* - after a while block second slave
* - check that all INSERTs are ok

View File

@ -1,6 +1,6 @@
/**
* @file max621_unreadable_cnf.cpp mxs621 regression case ("MaxScale fails to start silently if config file is
*not readable")
* not readable")
*
* - make maxscale.cnf unreadable
* - try to restart Maxscale

View File

@ -1,6 +1,6 @@
/**
* @file mxs652_bad_ssl.cpp mxs652 regression case ("ssl is configured in a wrong way, but Maxscale can be
*started and works")
* started and works")
*
* - Maxscale.cnf contains ssl configuration for all services in 'router' section instead of 'listener' with
*'ssl=require'

View File

@ -1,6 +1,6 @@
/**
* @file mxs657_restart.cpp Regression case for MXS-657 ("Debug assertion when service is shut down and
*restarted repeatedly")
* restarted repeatedly")
* - playing with 'restart service' and restart Maxscale under load
*/

View File

@ -1,6 +1,6 @@
/**
* @file mxs657_restart_service.cpp mxs657 regression case ("Debug assertion when service is shut down and
*restarted repeatedly")
* restarted repeatedly")
*
* - shutdown and restart RW Split Router in the loop from a number of threads
* Note: does not work crash reliable way with 'smoke' option

View File

@ -1,6 +1,6 @@
/**
* @file mxs710_bad_socket.cpp mxs710_bad_socket regression case (Maxscale does not startup properly and
*crashes after trying to login to database)
* crashes after trying to login to database)
* - try to start maxscale with "socket=/var/lib/mysqld/mysql.sock" in the listener definition
* - do not expect crash
* - try the same with two listers for one service, one of them uses unreachable port

View File

@ -1,7 +1,7 @@
/**
* @file max720_line_with_no_equal.cpp mxs720 regression case - first part: line without "=", second - weird
*lines ("MaxScale fails to start and doesn't log any useful message when there are spurious characters in
*the config file")
* lines ("MaxScale fails to start and doesn't log any useful message when there are spurious characters in
* the config file")
*
* - use incorrect maxscale.cnf
* - check log for error

View File

@ -1,6 +1,6 @@
/**
* @file max720_wierd_line.cpp mxs720 regression case - second part: weird lines ("MaxScale fails to start
*and doesn't log any useful message when there are spurious characters in the config file")
* and doesn't log any useful message when there are spurious characters in the config file")
*
* - use incorrect maxscale.cnf
* - check log for error

View File

@ -1,6 +1,6 @@
/**
* @file mxs781_binlog_wrong_passwrd.cpp Try to configure binlog router to use wrong password for Master and
*check 'slave status' on binlog
* check 'slave status' on binlog
* - try to put wrong password when connect binlog router to real master
* - check binlog router status using 'show slave status', expect 'Slave stopped'
*/

View File

@ -1,6 +1,6 @@
/**
* @file mxs812_2.cpp - Execute binary protocol prepared statements while master is blocked, checks "Current
*no. of conns" after the test
* no. of conns" after the test
* - start threads which prepares and executes simple statement in the loop
* - every 5 seconds block and after another 5 seconds unblock Master
* - checks "Current no. of conns" after the test, expect 0

View File

@ -1,6 +1,6 @@
/**
* @file mxs822_maxpasswd.cpp Regression test for bug MXS-822 ("encrypted passwords containing special
*characters appear to not work")
* characters appear to not work")
* - create .secret with maxkeys
* - generate encripted password with maxpasswd, use password with special characters
* - replace passwords in maxscale.cnf with generated encripted password

View File

@ -1,6 +1,6 @@
/**
* @file mxs827_write_timeout "ReadWriteSplit only keeps used connection alive, query crashes after unused
*connection times out"
* connection times out"
* - SET wait_timeout=20
* - do only SELECT during 30 seconds
* - try INSERT

View File

@ -25,8 +25,7 @@ int main(int argc, char** argv)
"CREATE USER 'test2'@'%' IDENTIFIED BY 'test2'",
"GRANT dba TO 'test'@'%'",
"GRANT dba TO 'test2'@'%'",
"SET DEFAULT ROLE dba FOR 'test'@'%'"
}))
"SET DEFAULT ROLE dba FOR 'test'@'%'"}))
{
test.try_query(test.repl->nodes[0], "%s", a.c_str());
}
@ -52,8 +51,7 @@ int main(int argc, char** argv)
for (auto a : vector<string>({"DROP DATABASE IF EXISTS my_db",
"DROP ROLE IF EXISTS dba",
"DROP USER 'test'@'%'",
"DROP USER 'test2'@'%'"
}))
"DROP USER 'test2'@'%'"}))
{
execute_query_silent(test.repl->nodes[0], "%s", a.c_str());
}

View File

@ -5,12 +5,12 @@
* - Set nodes 0 and 1 into read-only mode
* - repeat status check
* - Configure nodes 1 and 2 (server2 and server3) into a master-master pair, make node 0 a slave of node 1
*and node 3 a slave of node 2
* and node 3 a slave of node 2
* - repeat status check
* - Set node 1 into read-only mode
* - repeat status check
* - Create two distinct groups (server1 and server2 are masters for eache others and same for server3 and
*server4)
* server4)
* - repeat status check
* - Set nodes 1 and 3 (server2 and server4) into read-only mode
*/

View File

@ -178,4 +178,4 @@ private:
int check_node_ssh(int node);
};
#endif // NODES_H
#endif // NODES_H

View File

@ -260,4 +260,4 @@ public:
const char* sg_intern;
};
#endif // RDS_VPC_H
#endif // RDS_VPC_H

View File

@ -1,6 +1,6 @@
/**
* @file readconnrouter_master.cpp Connect to ReadConn in master mode and check if there is only one backend
*connection to master
* connection to master
*
* - connect to ReadCon master
* - expect only 1 connection to node 0 and no connections to ther nodes

View File

@ -1,6 +1,6 @@
/**
* @file readconnrouter_slave.cpp Creates 100 connections to ReadConn in slave mode and check if connections
*are distributed among all slaves
* are distributed among all slaves
*
* - create 100 connections to ReadConn slave
* - check if all slave have equal number of connections (+-1)

View File

@ -1,6 +1,6 @@
/**
* @file regexfilter1.cpp Simple regexfilter tests; aslo regression case for mxs508 ("regex filter ignores
*username")
* username")
*
* Three services are configured with regexfilter, each with different parameters.
* All services are queried with SELECT 123. The first service should replace it

View File

@ -1,6 +1,6 @@
/**
* @file rw_select_insert.cpp Checks changes of COM_SELECT and COM_INSERT after queris to check if RWSplit
*sends queries to master or to slave depending on if it is write or read only query
* sends queries to master or to slave depending on if it is write or read only query
* - connect to RWSplit, create table
* - execute SELECT using RWSplit
* - check COM_SELECT and COM_INSERT change on all nodes
@ -18,7 +18,7 @@
/**
* @brief check_com_select Checks if COM_SELECT increase takes place only on one slave node and there is no
*COM_INSERT increase
* COM_INSERT increase
* @param new_selects COM_SELECT after query
* @param new_inserts COM_INSERT after query
* @param selects COM_SELECT before query

View File

@ -1,6 +1,6 @@
/**
* @file ses_bigmem Executes a lot of session commands with "disable_sescmd_history=true" and check that
*memory consumption is not increasing
* memory consumption is not increasing
* (relates to MXS-672 "maxscale possible memory leak"
*/

View File

@ -25,7 +25,7 @@
* - check data on all nodes
* - chack sha1
* - repeat last test with FLUSH LOGS on master 1. before putting data to Master 2. after putting data to
*master
* master
*/

View File

@ -1,6 +1,6 @@
/**
* @file short_sessions.cpp Executes a lof of short queries, use own short session for every query (some
*relations to bug#424)
* relations to bug#424)
*
* - using RSplit create table
* - close connection

View File

@ -1,6 +1,6 @@
/**
* @file show_monitor_crash.cpp show_monitor_crash regression case for crash if maxadmin 'show monitors'
*command is issued, but no monitor is not running
* command is issued, but no monitor is not running
*
* - maxscale.cnf contains wrong monitor config (user name is wrong)
* - issue 'show monitors' maxadmin command

View File

@ -1,6 +1,6 @@
/**
* @file slave_failover.cpp Check how Maxscale works in case of one slave failure, only one slave is
*configured
* configured
*
* - Connect to RWSplit
* - find which backend slave is used for connection

View File

@ -1,6 +1,6 @@
/**
* @file server_lag.cpp Create high INSERT load to create slave lag and check that Maxscale start routing
*queries to Master
* queries to Master
*
* - in Maxscqale.cnf set max_slave_replication_lag=20
* - in parallel thread execute as many INSERTs as possible

View File

@ -22,4 +22,4 @@ const char* setup_slave_no_pos
"MASTER_PORT=%d";
#endif // SQL_CONST_H
#endif // SQL_CONST_H

View File

@ -1,6 +1,6 @@
/**
* @file sql_queries.cpp Execute long sql queries as well as "use" command (also used for bug648 "use
*database is sent forever with tee filter to a readwrite split service")
* database is sent forever with tee filter to a readwrite split service")
* - also used for 'sql_queries_pers1' and 'sql_queries_pers10' tests (with 'persistpoolmax=1' and
*'persistpoolmax=10' for all servers)
* - for bug648:

View File

@ -74,4 +74,4 @@ int select_from_t1(MYSQL* conn, int N);
*/
int check_if_t1_exists(MYSQL* conn);
#endif // SQL_T1_H
#endif // SQL_T1_H

View File

@ -75,4 +75,4 @@ const char* sysbench_command_short
#endif // SYSBENCH_COMMANDS_H
#endif // SYSBENCH_COMMANDS_H

View File

@ -27,4 +27,4 @@ int start_transaction(TestConnections* Test);
*/
void test_binlog(TestConnections* Test);
#endif // TEST_BINLOG_FNC_H
#endif // TEST_BINLOG_FNC_H

View File

@ -107,18 +107,18 @@ TestConnections::TestConnections(int argc, char* argv[])
static struct option long_options[] =
{
{"help", no_argument, 0, 'h'},
{"verbose", no_argument, 0, 'v'},
{"silent", no_argument, 0, 'n'},
{"quiet", no_argument, 0, 'q'},
{"no-maxscale-start", no_argument, 0, 's'},
{"no-maxscale-init", no_argument, 0, 'i'},
{"no-nodes-check", no_argument, 0, 'r'},
{"restart-galera", no_argument, 0, 'g'},
{"no-timeouts", no_argument, 0, 'z'},
{"no-galera", no_argument, 0, 'y'},
{"local-maxscale", no_argument, 0, 'l'},
{0, 0, 0, 0 }
{"help", no_argument, 0, 'h' },
{"verbose", no_argument, 0, 'v' },
{"silent", no_argument, 0, 'n' },
{"quiet", no_argument, 0, 'q' },
{"no-maxscale-start", no_argument, 0, 's' },
{"no-maxscale-init", no_argument, 0, 'i' },
{"no-nodes-check", no_argument, 0, 'r' },
{"restart-galera", no_argument, 0, 'g' },
{"no-timeouts", no_argument, 0, 'z' },
{"no-galera", no_argument, 0, 'y' },
{"local-maxscale", no_argument, 0, 'l' },
{0, 0, 0, 0 }
};
int c;

View File

@ -29,11 +29,11 @@ typedef std::set<std::string> StringSet;
* - Maxscale_sshkey - ssh key for Maxscale machine
* - maxscale_cnf - name of maxscale .cnf file (full)
* - KillVMCommand - Command to kill a node (should handle one parameter: IP address of virtual machine to
*kill)
* kill)
* - StartVMCommand - Command to restart virtual machine (should handle one parameter: IP address of virtual
*machine to kill)
* machine to kill)
* - GetLogsCommand - Command to copy log files from node virtual machines (should handle one parameter: IP
*address of virtual machine to kill)
* address of virtual machine to kill)
* - SysbenchDir - path to SysBench directory (sysbanch should be >= 0.5)
* - node_N - Number of Master/Slave setup nodes
* - node_NNN - IP address of node NNN (NNN - 3 digits node index starting from 000)
@ -42,7 +42,7 @@ typedef std::set<std::string> StringSet;
* - node_User - User name to access Master/Slav setup
* - node_Password - Password to access Master/Slave setup
* - galera_N, galera_NNN, galera_port_NNN, galera_sshkey_NNN, galera_User, galera_Password - same for Galera
*setup
* setup
*
*/
class TestConnections
@ -54,7 +54,7 @@ private:
public:
/**
* @brief TestConnections constructor: reads environmental variables, copies MaxScale.cnf for MaxScale
*machine
* machine
* @param test_exec_name Path to currect executable
*/
TestConnections(int argc, char* argv[]);
@ -108,7 +108,7 @@ public:
/**
* @brief GetLogsCommand Command to copy log files from node virtual machines (should handle one
*parameter: IP address of virtual machine to kill)
* parameter: IP address of virtual machine to kill)
*/
char get_logs_command[4096];
@ -287,7 +287,7 @@ public:
/**
* @brief start_binlog configure first node as Master, Second as slave connected to Master and others as
*slave connected to MaxScale binlog router
* slave connected to MaxScale binlog router
* @return 0 in case of success
*/
int start_binlog(int m = 0);
@ -321,7 +321,7 @@ public:
/**
* @brief copy_all_logs_periodic Copies all MaxScale logs and (if happens) core to current workspace and
*sends time stemp to log copying script
* sends time stemp to log copying script
*/
int copy_all_logs_periodic();
@ -335,11 +335,11 @@ public:
/**
* @brief Test that connections to MaxScale are in the expected state
* @param rw_split State of the MaxScale connection to Readwritesplit. True for working connection, false
*for no connection.
* for no connection.
* @param rc_master State of the MaxScale connection to Readconnroute Master. True for working connection,
*false for no connection.
* false for no connection.
* @param rc_slave State of the MaxScale connection to Readconnroute Slave. True for working connection,
*false for no connection.
* false for no connection.
* @return 0 if connections are in the expected state
*/
int test_maxscale_connections(int m,
@ -351,11 +351,11 @@ public:
* @brief Create a number of connections to all services, run simple query, close all connections
* @param conn_N number of connections
* @param rwsplit_flag if true connections to RWSplit router will be created, if false - no connections to
*RWSplit
* RWSplit
* @param master_flag if true connections to ReadConn master router will be created, if false - no
*connections to ReadConn master
* connections to ReadConn master
* @param slave_flag if true connections to ReadConn slave router will be created, if false - no
*connections to ReadConn slave
* connections to ReadConn slave
* @param galera_flag if true connections to RWSplit router with Galera backend will be created, if false
*- no connections to RWSplit with Galera backend
* @return 0 in case of success
@ -402,10 +402,10 @@ public:
/**
* @brief Creats t1 table, insert data into it and checks if data can be correctly read from all Maxscale
*services
* services
* @param Test Pointer to TestConnections object that contains references to test setup
* @param N number of INSERTs; every next INSERT is longer 16 times in compare with previous one: for N=4
*last INSERT is about 700kb long
* last INSERT is about 700kb long
* @return 0 in case of no error and all checks are ok
*/
int insert_select(int m, int N);
@ -432,7 +432,7 @@ public:
* @param err_msg Error message to search in the log
* @param expected TRUE if err_msg is expedted in the log, false if err_msg should NOT be in the log
* @return 0 if (err_msg is found AND expected is TRUE) OR (err_msg is NOT found in the log AND expected
*is false)
* is false)
*/
void check_log_err(int m, const char* err_msg, bool expected);
@ -470,7 +470,7 @@ public:
/**
* @brief CheckMaxscaleAlive Checks if MaxScale is alive
* Reads test setup info from enviromental variables and tries to connect to all Maxscale services to
*check if i is alive.
* check if i is alive.
* Also 'show processlist' query is executed using all services
* @return 0 in case if success
*/
@ -598,4 +598,4 @@ void* log_copy_thread(void* ptr);
*/
std::string dump_status(const StringSet& current, const StringSet& expected);
#endif // TESTCONNECTIONS_H
#endif // TESTCONNECTIONS_H