Format all source files with Astyle
Formatted all source files Astyle.
This commit is contained in:
@ -554,7 +554,8 @@ dprintServer(DCB *dcb, const SERVER *server)
|
||||
dcb_printf(dcb, "\tPersistent pool size limit: %ld\n", server->persistpoolmax);
|
||||
dcb_printf(dcb, "\tPersistent max time (secs): %ld\n", server->persistmaxtime);
|
||||
dcb_printf(dcb, "\tConnections taken from pool: %lu\n", server->stats.n_from_pool);
|
||||
double d = (double)server->stats.n_from_pool / (double)(server->stats.n_connections + server->stats.n_from_pool + 1);
|
||||
double d = (double)server->stats.n_from_pool / (double)(server->stats.n_connections +
|
||||
server->stats.n_from_pool + 1);
|
||||
dcb_printf(dcb, "\tPool availability: %0.2lf%%\n", d * 100.0);
|
||||
}
|
||||
if (server->server_ssl)
|
||||
|
@ -473,7 +473,8 @@ test1()
|
||||
ss_info_dassert(hint == buffer->hint, "Buffer should point to first and only hint");
|
||||
ss_dfprintf(stderr, "\t..done\nSet a property for the buffer");
|
||||
gwbuf_add_property(buffer, (char*)"name", (char*)"value");
|
||||
ss_info_dassert(0 == strcmp("value", gwbuf_get_property(buffer, (char*)"name")), "Should now have correct property");
|
||||
ss_info_dassert(0 == strcmp("value", gwbuf_get_property(buffer, (char*)"name")),
|
||||
"Should now have correct property");
|
||||
strcpy((char*)GWBUF_DATA(buffer), "The quick brown fox jumps over the lazy dog");
|
||||
ss_dfprintf(stderr, "\t..done\nLoad some data into the buffer");
|
||||
ss_info_dassert('q' == GWBUF_DATA_CHAR(buffer, 4), "Fourth character of buffer must be 'q'");
|
||||
|
@ -62,7 +62,8 @@ test1()
|
||||
ss_dfprintf(stderr, "\t..done\nExtract SQL from buffer different way?");
|
||||
ss_info_dassert(0 == modutil_MySQL_Query(buffer, &sql, &length, &residual), "Default buffer should fail");
|
||||
ss_dfprintf(stderr, "\t..done\nReplace SQL in buffer");
|
||||
ss_info_dassert(0 == modutil_replace_SQL(buffer, (char*)"select * from some_table;"), "Default buffer should fail");
|
||||
ss_info_dassert(0 == modutil_replace_SQL(buffer, (char*)"select * from some_table;"),
|
||||
"Default buffer should fail");
|
||||
ss_dfprintf(stderr, "\t..done\nTidy up.");
|
||||
gwbuf_free(buffer);
|
||||
ss_dfprintf(stderr, "\t..done\n");
|
||||
|
@ -989,7 +989,8 @@ static void set_port(struct sockaddr_storage *addr, uint16_t port)
|
||||
}
|
||||
}
|
||||
|
||||
int open_network_socket(enum mxs_socket_type type, struct sockaddr_storage *addr, const char *host, uint16_t port)
|
||||
int open_network_socket(enum mxs_socket_type type, struct sockaddr_storage *addr, const char *host,
|
||||
uint16_t port)
|
||||
{
|
||||
ss_dassert(type == MXS_SOCKET_NETWORK || type == MXS_SOCKET_LISTENER);
|
||||
struct addrinfo *ai = NULL, hint = {};
|
||||
|
@ -91,12 +91,16 @@ extern "C" MXS_MODULE* MXS_CREATE_MODULE()
|
||||
NULL, /* Thread finish. */
|
||||
{
|
||||
{ Config::rules_name, MXS_MODULE_PARAM_STRING, NULL, MXS_MODULE_OPT_REQUIRED },
|
||||
{ Config::warn_type_mismatch_name,
|
||||
{
|
||||
Config::warn_type_mismatch_name,
|
||||
MXS_MODULE_PARAM_ENUM, Config::warn_type_mismatch_default,
|
||||
MXS_MODULE_OPT_NONE, Config::warn_type_mismatch_values },
|
||||
{ Config::large_payload_name,
|
||||
MXS_MODULE_OPT_NONE, Config::warn_type_mismatch_values
|
||||
},
|
||||
{
|
||||
Config::large_payload_name,
|
||||
MXS_MODULE_PARAM_ENUM, Config::large_payload_default,
|
||||
MXS_MODULE_OPT_NONE, Config::large_payload_values },
|
||||
MXS_MODULE_OPT_NONE, Config::large_payload_values
|
||||
},
|
||||
{ MXS_END_MODULE_PARAMS }
|
||||
}
|
||||
};
|
||||
|
@ -1152,7 +1152,8 @@ static int send_ok_upstream(MAXROWS_SESSION_DATA *csdata)
|
||||
{
|
||||
/* Note: sequence id is always 01 (4th byte) */
|
||||
const static uint8_t ok[MYSQL_OK_PACKET_MIN_LEN] = { 07, 00, 00, 01, 00, 00,
|
||||
00, 02, 00, 00, 00 };
|
||||
00, 02, 00, 00, 00
|
||||
};
|
||||
|
||||
ss_dassert(csdata->res.data != NULL);
|
||||
|
||||
|
@ -99,7 +99,8 @@ void avro_close_binlog(int fd)
|
||||
* @param filepath Path to the created file
|
||||
* @param json_schema The schema of the table in JSON format
|
||||
*/
|
||||
AVRO_TABLE* avro_table_alloc(const char* filepath, const char* json_schema, const char *codec, size_t block_size)
|
||||
AVRO_TABLE* avro_table_alloc(const char* filepath, const char* json_schema, const char *codec,
|
||||
size_t block_size)
|
||||
{
|
||||
AVRO_TABLE *table = MXS_CALLOC(1, sizeof(AVRO_TABLE));
|
||||
if (table)
|
||||
|
@ -185,13 +185,17 @@ MXS_MODULE* MXS_CREATE_MODULE()
|
||||
{"transaction_safety", MXS_MODULE_PARAM_BOOL, "false"},
|
||||
{"semisync", MXS_MODULE_PARAM_BOOL, "false"},
|
||||
{"encrypt_binlog", MXS_MODULE_PARAM_BOOL, "false"},
|
||||
{"encryption_algorithm", MXS_MODULE_PARAM_ENUM, "aes_cbc",
|
||||
MXS_MODULE_OPT_NONE, enc_algo_values},
|
||||
{
|
||||
"encryption_algorithm", MXS_MODULE_PARAM_ENUM, "aes_cbc",
|
||||
MXS_MODULE_OPT_NONE, enc_algo_values
|
||||
},
|
||||
{"encryption_key_file", MXS_MODULE_PARAM_PATH, NULL, MXS_MODULE_OPT_PATH_R_OK},
|
||||
{"mariadb10_slave_gtid", MXS_MODULE_PARAM_BOOL, "false"},
|
||||
{"mariadb10_master_gtid", MXS_MODULE_PARAM_BOOL, "false"},
|
||||
{"binlog_structure", MXS_MODULE_PARAM_ENUM, "flat",
|
||||
MXS_MODULE_OPT_NONE, binlog_storage_values},
|
||||
{
|
||||
"binlog_structure", MXS_MODULE_PARAM_ENUM, "flat",
|
||||
MXS_MODULE_OPT_NONE, binlog_storage_values
|
||||
},
|
||||
{"shortburst", MXS_MODULE_PARAM_COUNT, DEF_SHORT_BURST},
|
||||
{"longburst", MXS_MODULE_PARAM_COUNT, DEF_LONG_BURST},
|
||||
{"burstsize", MXS_MODULE_PARAM_SIZE, DEF_BURST_SIZE},
|
||||
@ -1975,10 +1979,12 @@ static json_t* diagnostics_json(const MXS_ROUTER *router)
|
||||
{
|
||||
json_t* obj = json_object();
|
||||
|
||||
json_object_set_new(obj, "ssl_ca_cert", json_string(router_inst->service->dbref->server->server_ssl->ssl_ca_cert));
|
||||
json_object_set_new(obj, "ssl_ca_cert",
|
||||
json_string(router_inst->service->dbref->server->server_ssl->ssl_ca_cert));
|
||||
json_object_set_new(obj, "ssl_cert", json_string(router_inst->service->dbref->server->server_ssl->ssl_cert));
|
||||
json_object_set_new(obj, "ssl_key", json_string(router_inst->service->dbref->server->server_ssl->ssl_key));
|
||||
json_object_set_new(obj, "ssl_version", json_string(router_inst->ssl_version ? router_inst->ssl_version : "MAX"));
|
||||
json_object_set_new(obj, "ssl_version",
|
||||
json_string(router_inst->ssl_version ? router_inst->ssl_version : "MAX"));
|
||||
|
||||
json_object_set_new(rval, "master_ssl", obj);
|
||||
}
|
||||
|
@ -486,7 +486,8 @@ blr_skip_leading_sql_comments(const char *sql_query)
|
||||
{
|
||||
const char *p = sql_query;
|
||||
|
||||
while (*p) {
|
||||
while (*p)
|
||||
{
|
||||
if (*p == '/' && p[1] == '*')
|
||||
{
|
||||
++p; // skip '/'
|
||||
@ -709,7 +710,8 @@ blr_slave_query(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, GWBUF *queue)
|
||||
}
|
||||
}
|
||||
else
|
||||
{ /* Handle ADMIN commands */
|
||||
{
|
||||
/* Handle ADMIN commands */
|
||||
if (blr_handle_admin_stmt(router,
|
||||
slave,
|
||||
word,
|
||||
@ -829,7 +831,8 @@ static uint8_t timestamp_def[] =
|
||||
0x00, 0x00, 0x03, 0xfe, 0x00, 0x00, 0x02, 0x00
|
||||
};
|
||||
static uint8_t timestamp_eof[] = { 0x05, 0x00, 0x00, 0x05,
|
||||
0xfe, 0x00, 0x00, 0x02, 0x00 };
|
||||
0xfe, 0x00, 0x00, 0x02, 0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* Send a response to a "SELECT UNIX_TIMESTAMP()" request.
|
||||
|
@ -262,7 +262,8 @@ printUsage(const char *progname)
|
||||
printVersion(progname);
|
||||
|
||||
printf("The MaxScale binlog check utility.\n\n");
|
||||
printf("Usage: %s [-f] [-M] [-d] [-V] [-H] [-K file] [-A algo] [-R pos] [-T pos] [<binlog file>]\n\n", progname);
|
||||
printf("Usage: %s [-f] [-M] [-d] [-V] [-H] [-K file] [-A algo] [-R pos] [-T pos] [<binlog file>]\n\n",
|
||||
progname);
|
||||
printf(" -f|--fix Fix binlog file, require write permissions (truncate)\n");
|
||||
printf(" -d|--debug Print debug messages\n");
|
||||
printf(" -M|--mariadb10 MariaDB 10 binlog compatibility\n");
|
||||
|
@ -799,8 +799,10 @@ int main(int argc, char **argv)
|
||||
/**
|
||||
* Verify SQL query initial comment skipping function works on a real use case.
|
||||
*/
|
||||
const char *mysql_connector_j_actual = blr_skip_leading_sql_comments("/* mysql-connector-java-5.1.39 ( Revision: 3289a357af6d09ecc1a10fd3c26e95183e5790ad ) */SELECT @@session.auto_increment_increment AS auto_increment_increment, @@character_set_client AS character_set_client, @@character_set_connection AS character_set_connection, @@character_set_results AS character_set_results, @@character_set_server AS character_set_server, @@init_connect AS init_connect, @@interactive_timeout AS interactive_timeout, @@license AS license, @@lower_case_table_names AS lower_case_table_names, @@max_allowed_packet AS max_allowed_packet, @@net_buffer_length AS net_buffer_length, @@net_write_timeout AS net_write_timeout, @@query_cache_size AS query_cache_size, @@query_cache_type AS query_cache_type, @@sql_mode AS sql_mode, @@system_time_zone AS system_time_zone, @@time_zone AS time_zone, @@tx_isolation AS tx_isolation, @@wait_timeout AS wait_timeout");
|
||||
const char *mysql_connector_j_expected = "SELECT @@session.auto_increment_increment AS auto_increment_increment, @@character_set_client AS character_set_client, @@character_set_connection AS character_set_connection, @@character_set_results AS character_set_results, @@character_set_server AS character_set_server, @@init_connect AS init_connect, @@interactive_timeout AS interactive_timeout, @@license AS license, @@lower_case_table_names AS lower_case_table_names, @@max_allowed_packet AS max_allowed_packet, @@net_buffer_length AS net_buffer_length, @@net_write_timeout AS net_write_timeout, @@query_cache_size AS query_cache_size, @@query_cache_type AS query_cache_type, @@sql_mode AS sql_mode, @@system_time_zone AS system_time_zone, @@time_zone AS time_zone, @@tx_isolation AS tx_isolation, @@wait_timeout AS wait_timeout";
|
||||
const char *mysql_connector_j_actual =
|
||||
blr_skip_leading_sql_comments("/* mysql-connector-java-5.1.39 ( Revision: 3289a357af6d09ecc1a10fd3c26e95183e5790ad ) */SELECT @@session.auto_increment_increment AS auto_increment_increment, @@character_set_client AS character_set_client, @@character_set_connection AS character_set_connection, @@character_set_results AS character_set_results, @@character_set_server AS character_set_server, @@init_connect AS init_connect, @@interactive_timeout AS interactive_timeout, @@license AS license, @@lower_case_table_names AS lower_case_table_names, @@max_allowed_packet AS max_allowed_packet, @@net_buffer_length AS net_buffer_length, @@net_write_timeout AS net_write_timeout, @@query_cache_size AS query_cache_size, @@query_cache_type AS query_cache_type, @@sql_mode AS sql_mode, @@system_time_zone AS system_time_zone, @@time_zone AS time_zone, @@tx_isolation AS tx_isolation, @@wait_timeout AS wait_timeout");
|
||||
const char *mysql_connector_j_expected =
|
||||
"SELECT @@session.auto_increment_increment AS auto_increment_increment, @@character_set_client AS character_set_client, @@character_set_connection AS character_set_connection, @@character_set_results AS character_set_results, @@character_set_server AS character_set_server, @@init_connect AS init_connect, @@interactive_timeout AS interactive_timeout, @@license AS license, @@lower_case_table_names AS lower_case_table_names, @@max_allowed_packet AS max_allowed_packet, @@net_buffer_length AS net_buffer_length, @@net_write_timeout AS net_write_timeout, @@query_cache_size AS query_cache_size, @@query_cache_type AS query_cache_type, @@sql_mode AS sql_mode, @@system_time_zone AS system_time_zone, @@time_zone AS time_zone, @@tx_isolation AS tx_isolation, @@wait_timeout AS wait_timeout";
|
||||
if (strcmp(mysql_connector_j_actual, mysql_connector_j_expected) == 0)
|
||||
{
|
||||
printf("Test %d PASSED\n", tests);
|
||||
|
Reference in New Issue
Block a user