fix warnings

pull/4304/head
Miro Stauder 3 years ago
parent 00e73a19bc
commit 9d07ffc4cc

@ -84,7 +84,7 @@ int main() {
ok(c != NULL && proxysql_admin->net.compress == 1 && rows==1, "cipher %s and compression (%d) used while reading %lu row(s) from %s", c, proxysql_admin->net.compress, rows, it->c_str());
MYSQL_ROW row;
while ((row = mysql_fetch_row(proxy_res))) {
diag(row[1]);
diag("%s", row[1]);
}
mysql_free_result(proxy_res);
}

@ -108,7 +108,7 @@ int main(int argc, char** argv) {
mysql_close(mysql);
unsigned long long end = monotonic_time();
unsigned long time_diff_ms = (end-begin)/1000;
ok(time_diff_ms>2900 && time_diff_ms < 3200 , "Total query execution time should be around 3 seconds. Actual : %llums", time_diff_ms);
ok(time_diff_ms>2900 && time_diff_ms < 3200 , "Total query execution time should be around 3 seconds. Actual : %lums", time_diff_ms);
}
diag("Setting mysql-init_connect to Syntax Error");

@ -118,7 +118,7 @@ int main(int argc, char** argv) {
mysql_close(mysql);
unsigned long long end = monotonic_time();
unsigned long time_diff_ms = (end-begin)/1000;
ok(time_diff_ms>2900 && time_diff_ms < 3200 , "Total query execution time should be around 3 seconds. Actual : %llums", time_diff_ms);
ok(time_diff_ms>2900 && time_diff_ms < 3200 , "Total query execution time should be around 3 seconds. Actual : %lums", time_diff_ms);
}
diag("Setting mysql_hostgroup_attributes.init_connect to Syntax Error");

@ -256,8 +256,8 @@ int main(int argc, char** argv) {
diag("Expected: id=%d, k=%d, c=%s, pad=%s", idx, k, p2.c_str(), p3.c_str());
diag("Retrieved: id=%d, k=%d, c=%s, pad=%s", id, k_i, str_data_c, str_data_pad);
} else {
diag("Expected: id=%d, k=%d, c=<OMITTED,length=%llu>, pad=%s", idx, k, p2.length(), p3.c_str());
diag("Retrieved: id=%d, k=%d, c=<OMITTED,length=%llu>, pad=%s", id, k_i, strlen(str_data_c), str_data_pad);
diag("Expected: id=%d, k=%d, c=<OMITTED,length=%lu>, pad=%s", idx, k, p2.length(), p3.c_str());
diag("Retrieved: id=%d, k=%d, c=<OMITTED,length=%lu>, pad=%s", id, k_i, strlen(str_data_c), str_data_pad);
}
int dm = 0;
if (idx==id && k == k_i && strcmp(p2.c_str(),str_data_c)==0 && strcmp(p3.c_str(),str_data_pad)==0) {

@ -115,9 +115,9 @@ int main(int argc, char** argv) {
int field_count = mysql_stmt_field_count(stmt);
if (i % 2 == 0) {
ok(field_count == 3, "Field count should be '3' in case of 'i % 2' being '0'");
ok(field_count == 3, "Field count should be '3' in case of 'i %% 2' being '0'");
} else {
ok(field_count == 1, "Field count should be '1' in case of 'i % 2' being '1'");
ok(field_count == 1, "Field count should be '1' in case of 'i %% 2' being '1'");
}
if (mysql_stmt_close(stmt))

@ -184,7 +184,7 @@ int main(int argc, char** argv) {
ok(
data_match_expected,
"Prepared statement result matches expected - Exp=(id:1, c1:100, c2:'abcde'), Act=(id:%d, c1:%d, c2:'%s')",
"Prepared statement result matches expected - Exp=(id:1, c1:100, c2:'abcde'), Act=(id:%d, c1:%ld, c2:'%s')",
data_id,
data_c1,
data_c2

@ -68,7 +68,7 @@ int main(int argc, char** argv) {
unsigned long time_diff_ms = (end-begin)/1000;
ok(time_diff_ms>20000, "Total query execution time should be more than 20 seconds : %llums", time_diff_ms);
ok(time_diff_ms>20000, "Total query execution time should be more than 20 seconds : %lums", time_diff_ms);
MYSQL_QUERY(mysqladmin, "SET mysql-throttle_max_bytes_per_second_to_client=0");
MYSQL_QUERY(mysqladmin, "load mysql variables to runtime");

@ -385,7 +385,7 @@ int wait_target_backend_conns(MYSQL* admin, uint32_t tg_backend_conns, uint32_t
break;
} else {
waited += 1;
diag("tg_backend_conns: %d, cur_conn_num: %ld , not matching after %lu checks", tg_backend_conns, cur_conn_num, waited);
diag("tg_backend_conns: %d, cur_conn_num: %ld , not matching after %u checks", tg_backend_conns, cur_conn_num, waited);
sleep(1);
}
}

@ -280,7 +280,7 @@ int main(int argc, char** argv) {
);
ok(
ds_vector_after[i].count_star - ds_vector_before[i].count_star == num_dummy_queries_executed,
"Query `%s` should be executed %lld times. Act:'%lld'",
"Query `%s` should be executed %d times. Act:'%lld'",
ds_vector_after[i].digest_text.c_str(), num_dummy_queries_executed,
ds_vector_after[i].count_star - ds_vector_before[i].count_star
);

@ -59,7 +59,7 @@ int main(int argc, char** argv) {
MYSQL_QUERY(mysqladmin, "delete from mysql_query_rules");
{
char * query_in = "insert into mysql_query_rules (rule_id, active, flagIN, match_digest, negate_match_pattern, re_modifiers, destination_hostgroup, comment, apply) values (100, 1, 0, \"^SELECT.*FOR UPDATE$\", 0, \"CASELESS\", 0, \"\"\"hello\"\" 'world'\", 1)";
const char * query_in = "insert into mysql_query_rules (rule_id, active, flagIN, match_digest, negate_match_pattern, re_modifiers, destination_hostgroup, comment, apply) values (100, 1, 0, \"^SELECT.*FOR UPDATE$\", 0, \"CASELESS\", 0, \"\"\"hello\"\" 'world'\", 1)";
char query_out[1024];
mysql_real_escape_string(mysqladmin, query_out, query_in, strlen(query_in));
diag("Running query: %s", query_out);
@ -137,7 +137,7 @@ int main(int argc, char** argv) {
}
while (!mysql_stmt_fetch(stmt)) {
ok(strcmp((char*)bind[0].buffer, "aaaaaa") == 0, "Read value that was updated. Expected [aaaaaa]. Actual [%s]", bind[0].buffer);
ok(strcmp((char*)bind[0].buffer, "aaaaaa") == 0, "Read value that was updated. Expected [aaaaaa]. Actual [%s]", (char*)bind[0].buffer);
}
if (mysql_stmt_close(stmt))

@ -349,13 +349,13 @@ int test_unshun_algorithm_behavior(MYSQL* proxysql_mysql, MYSQL* proxysql_admin)
int shunn_err = shunn_all_servers(proxysql_admin);
if (shunn_err) { return EXIT_FAILURE; }
diag(""); // empty line
diag(" "); // empty line
for (uint32_t i = 0; i < SERVERS_COUNT; i++) {
wakup_target_server(proxysql_mysql, i);
bool unexp_row_value = server_status_checker(proxysql_admin, "ONLINE", "ONLINE", i);
ok(unexp_row_value == false, "Server from first hg was set 'ONLINE' while others remained 'ONLINE'");
diag(""); // empty line
diag(" "); // empty line
if (tests_failed()) {
return exit_status();
}
@ -373,7 +373,7 @@ int test_unshun_algorithm_behavior(MYSQL* proxysql_mysql, MYSQL* proxysql_admin)
for (uint32_t i = 0; i < SERVERS_COUNT; i++) {
wakup_target_server(proxysql_mysql, i);
}
diag(""); // empty line
diag(" "); // empty line
MYSQL_QUERY(proxysql_admin, "SET mysql-unshun_algorithm=1");
diag("%s: Line:%d running admin query: SET mysql-unshun_algorithm=1", tap_curtime().c_str(), __LINE__);
@ -384,7 +384,7 @@ int test_unshun_algorithm_behavior(MYSQL* proxysql_mysql, MYSQL* proxysql_admin)
bool unexp_row_value = server_status_checker(proxysql_admin, "ONLINE", "SHUNNED", i);
ok(unexp_row_value == false, "Server from first hg was set 'ONLINE' while others remained 'SHUNNED'");
diag(""); // empty line
diag(" "); // empty line
if (tests_failed()) {
return exit_status();
}

Loading…
Cancel
Save