Format source code

Formatted all of the source code that was not accordance with the coding
style. This was caused by merges from 2.2 into 2.3.
This commit is contained in:
Markus Mäkelä 2018-11-01 14:03:12 +02:00
parent 80b23b428a
commit e5d6e5329a
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
6 changed files with 46 additions and 46 deletions

View File

@ -4,19 +4,19 @@
#include "testconnections.h"
int main(int argc, char **argv)
int main(int argc, char** argv)
{
TestConnections::require_repl_version("10.2.0");
TestConnections test(argc, argv);
auto batch = [&](std::vector<std::string> queries){
test.maxscales->connect();
for (const auto& a: queries)
{
test.try_query(test.maxscales->conn_rwsplit[0], "%s", a.c_str());
}
test.maxscales->disconnect();
};
auto batch = [&](std::vector<std::string> queries) {
test.maxscales->connect();
for (const auto& a : queries)
{
test.try_query(test.maxscales->conn_rwsplit[0], "%s", a.c_str());
}
test.maxscales->disconnect();
};
batch({"CREATE USER 'test' IDENTIFIED BY 'test'",
"GRANT SELECT ON *.* TO test",

View File

@ -7,7 +7,7 @@
#include "testconnections.h"
int main(int argc, char **argv)
int main(int argc, char** argv)
{
TestConnections test(argc, argv);
test.repl->connect();

View File

@ -628,7 +628,7 @@ void TestConnections::process_template(int m, const char* template_name, const c
{
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\" ";
" -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 << "/\" ";

View File

@ -1409,27 +1409,27 @@ void append_field_info(json_t* pParent,
json_t* pFields = json_array();
std::for_each(begin, end, [pFields](const QC_FIELD_INFO& info) {
std::string name;
std::string name;
if (info.database)
{
name += info.database;
name += '.';
mxb_assert(info.table);
}
if (info.database)
{
name += info.database;
name += '.';
mxb_assert(info.table);
}
if (info.table)
{
name += info.table;
name += '.';
}
if (info.table)
{
name += info.table;
name += '.';
}
mxb_assert(info.column);
mxb_assert(info.column);
name += info.column;
name += info.column;
json_array_append_new(pFields, json_string(name.c_str()));
});
json_array_append_new(pFields, json_string(name.c_str()));
});
json_object_set_new(pParent, zName, pFields);
}
@ -1452,18 +1452,17 @@ void append_function_info(json_t* pParams, GWBUF* pBuffer)
qc_get_function_info(pBuffer, &begin, &n);
std::for_each(begin, begin + n, [pFunctions](const QC_FUNCTION_INFO& info) {
json_t* pFunction = json_object();
json_t* pFunction = json_object();
json_object_set_new(pFunction, CN_NAME, json_string(info.name));
json_object_set_new(pFunction, CN_NAME, json_string(info.name));
append_field_info(pFunction, CN_ARGUMENTS, info.fields, info.fields + info.n_fields);
append_field_info(pFunction, CN_ARGUMENTS, info.fields, info.fields + info.n_fields);
json_array_append_new(pFunctions, pFunction);
});
json_array_append_new(pFunctions, pFunction);
});
json_object_set_new(pParams, CN_FUNCTIONS, pFunctions);
}
}
std::unique_ptr<json_t> qc_classify_as_json(const char* zHost, const std::string& statement)

View File

@ -934,7 +934,7 @@ static bool roles_are_available(MYSQL* conn, SERVICE* service, SERVER* server)
return rval;
}
static bool have_mdev13453_problem(MYSQL *con, SERVER *server)
static bool have_mdev13453_problem(MYSQL* con, SERVER* server)
{
bool rval = false;
@ -968,14 +968,14 @@ static bool have_mdev13453_problem(MYSQL *con, SERVER *server)
return rval;
}
bool query_and_process_users(const char* query, MYSQL *con, sqlite3* handle, SERVICE* service, int* users)
bool query_and_process_users(const char* query, MYSQL* con, sqlite3* handle, SERVICE* service, int* users)
{
bool rval = false;
if (mxs_mysql_query(con, "USE mysql") == 0 && // Set default database in case we use CTEs
mxs_mysql_query(con, query) == 0)
if (mxs_mysql_query(con, "USE mysql") == 0 // Set default database in case we use CTEs
&& mxs_mysql_query(con, query) == 0)
{
MYSQL_RES *result = mysql_store_result(con);
MYSQL_RES* result = mysql_store_result(con);
if (result)
{

View File

@ -275,8 +275,8 @@ int MySQLSendHandshake(DCB* dcb)
}
}
MySQLProtocol *protocol = DCB_PROTOCOL(dcb, MySQLProtocol);
GWBUF *buf;
MySQLProtocol* protocol = DCB_PROTOCOL(dcb, MySQLProtocol);
GWBUF* buf;
std::string version = get_version_string(dcb->service);
gw_generate_random_str(server_scramble, GW_MYSQL_SCRAMBLE_SIZE);
@ -311,11 +311,12 @@ int MySQLSendHandshake(DCB* dcb)
int plugin_name_len = strlen(plugin_name);
mysql_payload_size =
sizeof(mysql_protocol_version) + (version.length() + 1) + sizeof(mysql_thread_id_num) + 8 +
sizeof(/* mysql_filler */ uint8_t) + sizeof(mysql_server_capabilities_one) + sizeof(mysql_server_language) +
sizeof(mysql_server_status) + sizeof(mysql_server_capabilities_two) + sizeof(mysql_scramble_len) +
sizeof(mysql_filler_ten) + 12 + sizeof(/* mysql_last_byte */ uint8_t) + plugin_name_len +
sizeof(/* mysql_last_byte */ uint8_t);
sizeof(mysql_protocol_version) + (version.length() + 1) + sizeof(mysql_thread_id_num) + 8
+ sizeof( /* mysql_filler */ uint8_t) + sizeof(mysql_server_capabilities_one)
+ sizeof(mysql_server_language)
+ sizeof(mysql_server_status) + sizeof(mysql_server_capabilities_two) + sizeof(mysql_scramble_len)
+ sizeof(mysql_filler_ten) + 12 + sizeof( /* mysql_last_byte */ uint8_t) + plugin_name_len
+ sizeof( /* mysql_last_byte */ uint8_t);
// allocate memory for packet header + payload
if ((buf = gwbuf_alloc(sizeof(mysql_packet_header) + mysql_payload_size)) == NULL)
@ -340,7 +341,7 @@ int MySQLSendHandshake(DCB* dcb)
mysql_handshake_payload = mysql_handshake_payload + sizeof(mysql_protocol_version);
// write server version plus 0 filler
strcpy((char *)mysql_handshake_payload, version.c_str());
strcpy((char*)mysql_handshake_payload, version.c_str());
mysql_handshake_payload = mysql_handshake_payload + version.length();
*mysql_handshake_payload = 0x00;