diff --git a/maxscale-system-test/keepalived_func.h b/maxscale-system-test/keepalived_func.h index 016c84c1c..186a1dd7a 100644 --- a/maxscale-system-test/keepalived_func.h +++ b/maxscale-system-test/keepalived_func.h @@ -8,6 +8,6 @@ char virtual_ip[16]; char* print_version_string(TestConnections* Test); void configure_keepalived(TestConnections* Test, char* keepalived_file); -void stop_keepalived(TestConnections* Test); +void stop_keepalived(TestConnections* Test); #endif // KEEPALIVED_FUNC_H diff --git a/maxscale-system-test/mm.cpp b/maxscale-system-test/mm.cpp index da2a7dd43..7eb760096 100644 --- a/maxscale-system-test/mm.cpp +++ b/maxscale-system-test/mm.cpp @@ -43,7 +43,7 @@ int check_conf(TestConnections& test, int blocked_node) for (int i = 0; i < 2; i++) { - if ( i != blocked_node) + if (i != blocked_node) { test.tprintf("Checking data from node %d (%s)\n", i, test.repl->IP[i]); test.set_timeout(100); @@ -63,7 +63,7 @@ int check_conf(TestConnections& test, int blocked_node) return global_result; } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { TestConnections test(argc, argv); @@ -72,19 +72,19 @@ int main(int argc, char *argv[]) test.repl->set_repl_user(); - test.start_mm(0); // first node - slave, second - master + test.start_mm(0); // first node - slave, second - master test.set_timeout(120); - test.maxscales->get_maxadmin_param(0, (char *) "show server server1", (char *) "Status:", maxadmin_result); + test.maxscales->get_maxadmin_param(0, (char*) "show server server1", (char*) "Status:", maxadmin_result); test.tprintf("node0 %s\n", maxadmin_result); - if (strstr(maxadmin_result, "Slave, Running") == NULL ) + if (strstr(maxadmin_result, "Slave, Running") == NULL) { test.add_result(1, "Node0 is not slave, status is %s\n", maxadmin_result); } test.set_timeout(120); - test.maxscales->get_maxadmin_param(0, (char *) "show server server2", (char *) "Status:", maxadmin_result); + test.maxscales->get_maxadmin_param(0, (char*) "show server server2", (char*) "Status:", maxadmin_result); test.tprintf("node1 %s\n", maxadmin_result); - if (strstr(maxadmin_result, "Master, Running") == NULL ) + if (strstr(maxadmin_result, "Master, Running") == NULL) { test.add_result(1, "Node1 is not master, status is %s\n", maxadmin_result); } @@ -97,9 +97,9 @@ int main(int argc, char *argv[]) test.stop_timeout(); test.maxscales->wait_for_monitor(); test.set_timeout(120); - test.maxscales->get_maxadmin_param(0, (char *) "show server server1", (char *) "Status:", maxadmin_result); + test.maxscales->get_maxadmin_param(0, (char*) "show server server1", (char*) "Status:", maxadmin_result); printf("node0 %s\n", maxadmin_result); - if (strstr(maxadmin_result, "Down") == NULL ) + if (strstr(maxadmin_result, "Down") == NULL) { test.add_result(1, "Node0 is not down, status is %s\n", maxadmin_result); } @@ -116,9 +116,9 @@ int main(int argc, char *argv[]) test.tprintf("Block master\n"); test.repl->block_node(1); test.maxscales->wait_for_monitor(); - test.maxscales->get_maxadmin_param(0, (char *) "show server server2", (char *) "Status:", maxadmin_result); + test.maxscales->get_maxadmin_param(0, (char*) "show server server2", (char*) "Status:", maxadmin_result); printf("node1 %s\n", maxadmin_result); - if (strstr(maxadmin_result, "Down") == NULL ) + if (strstr(maxadmin_result, "Down") == NULL) { test.add_result(1, "Node1 is not down, status is %s\n", maxadmin_result); } @@ -126,7 +126,7 @@ int main(int argc, char *argv[]) test.set_timeout(120); test.repl->connect(); - execute_query(test.repl->nodes[0], (char *) "SET GLOBAL READ_ONLY=OFF"); + execute_query(test.repl->nodes[0], (char*) "SET GLOBAL READ_ONLY=OFF"); test.repl->close_connections(); test.maxscales->wait_for_monitor(); @@ -141,7 +141,7 @@ int main(int argc, char *argv[]) test.set_timeout(120); printf("Make node 2 slave\n"); test.repl->connect(); - execute_query(test.repl->nodes[1], (char *) "SET GLOBAL READ_ONLY=ON"); + execute_query(test.repl->nodes[1], (char*) "SET GLOBAL READ_ONLY=ON"); test.repl->close_connections(); test.maxscales->wait_for_monitor(); @@ -150,16 +150,16 @@ int main(int argc, char *argv[]) test.add_result(check_conf(test, 2), "Configuration broken\n"); test.set_timeout(60); - test.maxscales->get_maxadmin_param(0, (char *) "show server server2", (char *) "Status:", maxadmin_result); + test.maxscales->get_maxadmin_param(0, (char*) "show server server2", (char*) "Status:", maxadmin_result); printf("node1 %s\n", maxadmin_result); - if (strstr(maxadmin_result, "Slave, Running") == NULL ) + if (strstr(maxadmin_result, "Slave, Running") == NULL) { test.add_result(1, "Node1 is not slave, status is %s\n", maxadmin_result); } test.set_timeout(60); - test.maxscales->get_maxadmin_param(0, (char *) "show server server1", (char *) "Status:", maxadmin_result); + test.maxscales->get_maxadmin_param(0, (char*) "show server server1", (char*) "Status:", maxadmin_result); test.tprintf("node0 %s\n", maxadmin_result); - if (strstr(maxadmin_result, "Master, Running") == NULL ) + if (strstr(maxadmin_result, "Master, Running") == NULL) { test.add_result(1, "Node0 is not master, status is %s\n", maxadmin_result); } diff --git a/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp b/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp index c66bda9d5..8063f2ee7 100644 --- a/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp +++ b/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp @@ -59,8 +59,8 @@ void test_sleep(int seconds) // The amount of time slept between various operations that are // expected to take some time before becoming visible. -const int HEARTBEAT_PERIOD = 2; // Seconds -const int REPLICATION_SLEEP = 6; // Seconds +const int HEARTBEAT_PERIOD = 2; // Seconds +const int REPLICATION_SLEEP = 6; // Seconds string get_gtid_current_pos(TestConnections& test, MYSQL* pMysql) { @@ -247,7 +247,7 @@ void select(TestConnections& test, MYSQL* pSlave) bool insert_select(TestConnections& test, MYSQL* pSlave, MYSQL* pMaster) { insert(test, pMaster); - test_sleep(REPLICATION_SLEEP); // To ensure that the insert reaches the slave. + test_sleep(REPLICATION_SLEEP); // To ensure that the insert reaches the slave. select(test, pSlave); return test.global_result == 0; @@ -334,7 +334,7 @@ void restore_server_ids(TestConnections& test, const map& server_id { for_each(server_ids_by_index.begin(), server_ids_by_index.end(), - [&test] (const pair& server_id_by_index) { + [&test](const pair& server_id_by_index) { test.try_query(test.galera->nodes[server_id_by_index.first], "set GLOBAL server_id=%s", server_id_by_index.second.c_str()); }); @@ -345,9 +345,9 @@ void restart_slave(TestConnections& test, MYSQL* pSlave) { Row row; - auto replication_failed = [] (const std::string& column) { - return column.find("Got fatal error") != string::npos; - }; + auto replication_failed = [](const std::string& column) { + return column.find("Got fatal error") != string::npos; + }; cout << "Stopping slave." << endl; test.try_query(pSlave, "STOP SLAVE"); @@ -404,7 +404,6 @@ bool test_multiple_masters(TestConnections& test, MYSQL* pSlave) return test.global_result == 0; } - } int main(int argc, char* argv[]) @@ -419,7 +418,7 @@ int main(int argc, char* argv[]) if (!dont_setup_galera) { setup_galera(test); - test.galera->start_replication(); // Causes restart. + test.galera->start_replication(); // Causes restart. } const char* zValue; @@ -441,7 +440,7 @@ int main(int argc, char* argv[]) if (setup_server_ids(test, &server_ids_by_index)) { - for (Approach approach : { Approach::GTID, Approach::FILE_POS } ) + for (Approach approach : {Approach::GTID, Approach::FILE_POS}) { inserted_rows = 0; @@ -483,7 +482,7 @@ int main(int argc, char* argv[]) { if (setup_blr(test, pMaxscale, gtid, approach)) { - int slave_index = test.repl->N - 1; // We use the last slave. + int slave_index = test.repl->N - 1; // We use the last slave. Mariadb_nodes& ms = *test.repl; ms.connect(slave_index); diff --git a/maxscale-system-test/mxs2054_hybrid_cluster.cpp b/maxscale-system-test/mxs2054_hybrid_cluster.cpp index f414839e1..b6133b1dd 100644 --- a/maxscale-system-test/mxs2054_hybrid_cluster.cpp +++ b/maxscale-system-test/mxs2054_hybrid_cluster.cpp @@ -21,7 +21,8 @@ int main(int argc, char** argv) test.maxscales->connect(); - Row server1 = get_row(test.maxscales->conn_rwsplit[0], "SELECT @@server_id, @@last_insert_id, id FROM test.t1"); + Row server1 = get_row(test.maxscales->conn_rwsplit[0], + "SELECT @@server_id, @@last_insert_id, id FROM test.t1"); Row server2 = get_row(test.maxscales->conn_rwsplit[0], "SELECT @@server_id, id FROM test.t2"); Row server3 = get_row(test.maxscales->conn_rwsplit[0], "SELECT @@server_id, id FROM test.t3"); Row server4 = get_row(test.maxscales->conn_rwsplit[0], "SELECT @@server_id, id FROM test.t4"); @@ -29,10 +30,14 @@ int main(int argc, char** argv) test.maxscales->disconnect(); test.repl->connect(); - test.expect(server1[0] == test.repl->get_server_id_str(0), "First query without hint should go to server1, the master"); - test.expect(server2[0] == test.repl->get_server_id_str(1), "Second query without hint should go to server2, the slave"); - test.expect(server3[0] == test.repl->get_server_id_str(2), "First query with hint should go to server3, the first unmonitored server"); - test.expect(server4[0] == test.repl->get_server_id_str(3), "Second query with hint should go to server4, the second unmonitored server"); + test.expect(server1[0] == test.repl->get_server_id_str(0), + "First query without hint should go to server1, the master"); + test.expect(server2[0] == test.repl->get_server_id_str(1), + "Second query without hint should go to server2, the slave"); + test.expect(server3[0] == test.repl->get_server_id_str(2), + "First query with hint should go to server3, the first unmonitored server"); + test.expect(server4[0] == test.repl->get_server_id_str(3), + "Second query with hint should go to server4, the second unmonitored server"); test.repl->disconnect(); return test.global_result; diff --git a/maxscale-system-test/testconnections.cpp b/maxscale-system-test/testconnections.cpp index 3368493b8..a87bd5d5a 100644 --- a/maxscale-system-test/testconnections.cpp +++ b/maxscale-system-test/testconnections.cpp @@ -626,7 +626,9 @@ void TestConnections::process_template(int m, const char* template_name, const c if (backend_ssl) { - ss << " -e \"s|type=server|type=server\\nssl=required\\nssl_cert=/###access_homedir###/certs/client-cert.pem\\nssl_key=/###access_homedir###/certs/client-key.pem\\nssl_ca_cert=/###access_homedir###/certs/ca.pem|g\" "; + ss + << + " -e \"s|type=server|type=server\\nssl=required\\nssl_cert=/###access_homedir###/certs/client-cert.pem\\nssl_key=/###access_homedir###/certs/client-key.pem\\nssl_ca_cert=/###access_homedir###/certs/ca.pem|g\" "; } ss << " -e \"s/###threads###/" << threads << "/\" "; diff --git a/server/core/config.cc b/server/core/config.cc index 684ef447b..53b04bd37 100644 --- a/server/core/config.cc +++ b/server/core/config.cc @@ -2516,7 +2516,7 @@ static int handle_global_item(const char* name, const char* value) if (gateway.writeq_high_water < MIN_WRITEQ_HIGH_WATER) { MXS_WARNING("The specified writeq high water mark %lu, is smaller " - "than the minimum allowed size %lu. Changing to minimum.", + "than the minimum allowed size %lu. Changing to minimum.", gateway.writeq_high_water, MIN_WRITEQ_HIGH_WATER); gateway.writeq_high_water = MIN_WRITEQ_HIGH_WATER; @@ -2534,7 +2534,7 @@ static int handle_global_item(const char* name, const char* value) if (gateway.writeq_low_water < MIN_WRITEQ_LOW_WATER) { MXS_WARNING("The specified writeq low water mark %lu, is smaller " - "than the minimum allowed size %lu. Changing to minimum.", + "than the minimum allowed size %lu. Changing to minimum.", gateway.writeq_low_water, MIN_WRITEQ_LOW_WATER); gateway.writeq_low_water = MIN_WRITEQ_LOW_WATER; diff --git a/server/core/monitor.cc b/server/core/monitor.cc index 34b85879a..fb1bc8967 100644 --- a/server/core/monitor.cc +++ b/server/core/monitor.cc @@ -367,7 +367,7 @@ bool monitor_add_server(MXS_MONITOR* mon, SERVER* server) db->next = NULL; db->mon_err_count = 0; db->log_version_err = true; - // Pretend disk space was just checked. + // Pretend disk space was just checked. db->disk_space_checked = maxscale::MonitorInstance::get_time_ms(); diff --git a/server/core/service.cc b/server/core/service.cc index 911f1e38f..3d1e4c258 100644 --- a/server/core/service.cc +++ b/server/core/service.cc @@ -93,7 +93,7 @@ Service* service_alloc(const char* name, const char* router, MXS_CONFIG_PARAMETE return NULL; } - Service* service = new( std::nothrow) Service(name, router, params); + Service* service = new(std::nothrow) Service(name, router, params); if (service == nullptr) { diff --git a/server/modules/monitor/mariadbmon/mariadbserver.cc b/server/modules/monitor/mariadbmon/mariadbserver.cc index 64616a7b8..49790d143 100644 --- a/server/modules/monitor/mariadbmon/mariadbserver.cc +++ b/server/modules/monitor/mariadbmon/mariadbserver.cc @@ -1471,7 +1471,7 @@ bool MariaDBServer::promote(ClusterOperation& op) else if (op.type == OperationType::FAILOVER) { stopped = remove_slave_conns(op, {*master_conn}); - master_conn = NULL; // The connection pointed to may no longer exist. + master_conn = NULL; // The connection pointed to may no longer exist. } if (stopped)