From 7f441ecf0efc0c3158fc1a198b383343e71ff0c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Wed, 17 Jul 2024 11:55:37 +0200 Subject: [PATCH] Add default timestamps for TAP library (diag/ok) - Adds config option with microseconds resolution, ON by default. - Preserves TAP convention for messages to prevent tooling breaking. --- test/tap/tap/tap.cpp | 44 ++++++- test/tap/tap/tap.h | 4 + test/tap/tests/max_connections_ff-t.cpp | 24 ++-- .../reg_test_3223-restapi_return_codes-t.cpp | 4 +- .../tap/tests/reg_test_3765_ssl_pollout-t.cpp | 4 +- .../tests/reg_test_sql_calc_found_rows-t.cpp | 21 ++-- .../test_auto_increment_delay_multiplex-t.cpp | 108 +++++++++--------- test/tap/tests/test_binlog_fast_forward-t.cpp | 2 +- .../tap/tests/test_session_status_flags-t.cpp | 10 +- test/tap/tests/test_unshun_algorithm-t.cpp | 32 +++--- 10 files changed, 145 insertions(+), 108 deletions(-) diff --git a/test/tap/tap/tap.cpp b/test/tap/tap/tap.cpp index b067432a2d..5270516f87 100644 --- a/test/tap/tap/tap.cpp +++ b/test/tap/tap/tap.cpp @@ -20,7 +20,6 @@ #include "tap.h" -//#include "my_global.h" typedef char my_bool; #include @@ -28,8 +27,13 @@ typedef char my_bool; #include #include #include +#include #include +#include + +using std::size_t; + static ulong start_timer(void); static void end_timer(ulong start_time,char *buff); static void nice_time(double sec,char *buff,my_bool part_second); @@ -68,6 +72,34 @@ static TEST_DATA g_test = { NO_PLAN, 0, 0, "" }; */ #define tapout stdout +/** + @brief Writes current time ("%Y-%m-%d %H:%M:%S") in the supplied buffer. + + @param tm_buf Buffer to be written. + @param us True for enabling microseconds in log output. + @param len Buffer len. + */ +size_t get_fmt_time(char* tm_buf, size_t len, bool us=false) { + time_t __timer; + time(&__timer); + struct tm __tm_info {}; + localtime_r(&__timer, &__tm_info); + size_t rc = strftime(tm_buf, len, "%Y-%m-%d %H:%M:%S", &__tm_info); + + if (rc == 0) { + return rc; + } else if (us) { + struct timeval tv; + struct tm *tm_info; + + gettimeofday(&tv, NULL); + tm_info = localtime(&tv.tv_sec); + rc = snprintf(tm_buf + rc, len - rc, ".%06ld", tv.tv_usec); + } + + return rc; +} + /** Emit the beginning of a test line, that is: "(not) ok", test number, and description. @@ -85,9 +117,12 @@ static TEST_DATA g_test = { NO_PLAN, 0, 0, "" }; static void vemit_tap(int pass, char const *fmt, va_list ap) { - fprintf(tapout, "%sok %d%s", + char tm_buf[28] = { 0 }; + get_fmt_time(tm_buf, sizeof(tm_buf), __sync_add_and_fetch(&tap_log_us, 0)); + fprintf(tapout, "%sok %d - %s%s", pass ? "" : "not ", __sync_add_and_fetch(&g_test.last, 1), + tm_buf, (fmt && *fmt) ? " - " : ""); if (fmt && *fmt) vfprintf(tapout, fmt, ap); @@ -156,7 +191,9 @@ diag(char const *fmt, ...) { va_list ap; va_start(ap, fmt); - fprintf(tapout, "# "); + char tm_buf[28] = { 0 }; + get_fmt_time(tm_buf, sizeof(tm_buf), __sync_add_and_fetch(&tap_log_us, 0)); + fprintf(tapout, "# %s ", tm_buf); vfprintf(tapout, fmt, ap); emit_endl(); va_end(ap); @@ -192,6 +229,7 @@ static signal_entry install_signal[]= { }; int skip_big_tests= 1; +volatile int tap_log_us = 1; ulong start_time= 0; void diff --git a/test/tap/tap/tap.h b/test/tap/tap/tap.h index 7678c1a390..f40dad0e9b 100644 --- a/test/tap/tap/tap.h +++ b/test/tap/tap/tap.h @@ -78,6 +78,10 @@ extern "C" { @see SKIP_BIG_TESTS */ extern int skip_big_tests; +/** + * @brief Specifies if time logging should include microseconds; either 1 or 0. + */ +extern volatile int tap_log_us; /** @defgroup MyTAP_API MyTAP API diff --git a/test/tap/tests/max_connections_ff-t.cpp b/test/tap/tests/max_connections_ff-t.cpp index f85a66f330..211c939c51 100644 --- a/test/tap/tests/max_connections_ff-t.cpp +++ b/test/tap/tests/max_connections_ff-t.cpp @@ -18,14 +18,12 @@ #include #include -#include #include #include #include #include #include "mysql.h" -#include "mysqld_error.h" #include "json.hpp" @@ -66,10 +64,10 @@ int set_max_conns(MYSQL* proxy_admin, int max_conns, int hg_id) { string max_conn_query {}; string_format("UPDATE mysql_servers SET max_connections=%d WHERE hostgroup_id=%d", max_conn_query, max_conns, hg_id); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), max_conn_query.c_str()); + diag("Executing query `%s`...", max_conn_query.c_str()); MYSQL_QUERY(proxy_admin, max_conn_query.c_str()); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "LOAD MYSQL SERVERS TO RUNTIME"); + diag("Executing query `%s`...", "LOAD MYSQL SERVERS TO RUNTIME"); MYSQL_QUERY(proxy_admin, "LOAD MYSQL SERVERS TO RUNTIME"); return EXIT_SUCCESS; @@ -79,10 +77,10 @@ int set_srv_conn_to(MYSQL* proxy_admin, int connect_to) { string srv_conn_to_query {}; string_format("SET mysql-connect_timeout_server_max=%d", srv_conn_to_query, connect_to); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), srv_conn_to_query.c_str()); + diag("Executing query `%s`...", srv_conn_to_query.c_str()); MYSQL_QUERY(proxy_admin, srv_conn_to_query.c_str()); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "LOAD MYSQL VARIABLES TO RUNTIME"); + diag("Executing query `%s`...", "LOAD MYSQL VARIABLES TO RUNTIME"); MYSQL_QUERY(proxy_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); return EXIT_SUCCESS; @@ -93,10 +91,10 @@ int set_ff_for_user(MYSQL* proxy_admin, const string& user, bool ff) { string upd_ff_query {}; string_format("UPDATE mysql_users SET fast_forward=%d WHERE username='%s'", upd_ff_query, ff, user.c_str()); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), upd_ff_query.c_str()); + diag("Executing query `%s`...", upd_ff_query.c_str()); MYSQL_QUERY(proxy_admin, upd_ff_query.c_str()); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "LOAD MYSQL VARIABLES TO RUNTIME"); + diag("Executing query `%s`...", "LOAD MYSQL VARIABLES TO RUNTIME"); MYSQL_QUERY(proxy_admin, "LOAD MYSQL USERS TO RUNTIME"); return EXIT_SUCCESS; @@ -264,9 +262,9 @@ int test_ff_sess_exceeds_max_conns(const CommandLine& cl, MYSQL* proxy_admin, lo string reset_conn_to_srv {}; string_format("SET mysql-connect_timeout_server_max=%s", reset_conn_to_srv, str_connect_timeout_server_max.c_str()); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), reset_conn_to_srv.c_str()); + diag("Executing query `%s`...", reset_conn_to_srv.c_str()); MYSQL_QUERY(proxy_admin, reset_conn_to_srv.c_str()); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "LOAD MYSQL VARIABLES TO RUNTIME"); + diag("Executing query `%s`...", "LOAD MYSQL VARIABLES TO RUNTIME"); MYSQL_QUERY(proxy_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); return EXIT_SUCCESS; @@ -313,7 +311,7 @@ int test_ff_only_one_free_conn(const CommandLine& cl, MYSQL* proxy_admin, int ma // Reset all the current stats for 'stats_mysql_connection_pool' my_err = mysql_query(proxy_admin, reset_connpool_stats); - diag("%s: Executing query `%s` in new 'fast_forward' conn...", tap_curtime().c_str(), reset_connpool_stats); + diag("Executing query `%s` in new 'fast_forward' conn...", reset_connpool_stats); if (my_err) { diag("Query '%s' failed", reset_connpool_stats); res = EXIT_FAILURE; @@ -333,7 +331,7 @@ int test_ff_only_one_free_conn(const CommandLine& cl, MYSQL* proxy_admin, int ma MYSQL* trx_conn = trx_conns.back(); diag("Freeing ONE connection by committing the transaction..."); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "COMMIT"); + diag("Executing query `%s`...", "COMMIT"); my_err = mysql_query(trx_conn, "COMMIT"); if (my_err) { diag( @@ -375,7 +373,7 @@ int test_ff_only_one_free_conn(const CommandLine& cl, MYSQL* proxy_admin, int ma } // 3.1 Issue a simple query into the new 'fast_forward' connection - diag("%s: Executing query `%s` in new 'fast_forward' conn...", tap_curtime().c_str(), "DO 1"); + diag("Executing query `%s` in new 'fast_forward' conn...", "DO 1"); int q_my_err = mysql_query(proxy_ff, "DO 1"); if (q_my_err) { diag( diff --git a/test/tap/tests/reg_test_3223-restapi_return_codes-t.cpp b/test/tap/tests/reg_test_3223-restapi_return_codes-t.cpp index bd6fa98ba5..86c3336d71 100644 --- a/test/tap/tests/reg_test_3223-restapi_return_codes-t.cpp +++ b/test/tap/tests/reg_test_3223-restapi_return_codes-t.cpp @@ -172,7 +172,7 @@ int main(int argc, char** argv) { for (const string& params : req.params) { const string ept { join_path(base_address, req.ept_info.name) }; diag( - "%s: Checking valid '%s' request - ept: '%s', params: '%s'", tap_curtime().c_str(), + "Checking valid '%s' request - ept: '%s', params: '%s'", req.ept_info.method.c_str(), ept.c_str(), params.c_str() ); std::chrono::nanoseconds duration; @@ -308,7 +308,7 @@ int main(int argc, char** argv) { const string ept { join_path(base_address, req.ept_info.name) }; diag( - "%s: Checking valid '%s' request - ept: '%s', params: '%s'", tap_curtime().c_str(), + "Checking valid '%s' request - ept: '%s', params: '%s'", req.ept_info.method.c_str(), ept.c_str(), ept_pl.params.c_str() ); diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 849e5c0ac8..d10fe4769d 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -68,7 +68,7 @@ int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& no_conns_cp // get ProxySQL idle cpu usage int idle_err = get_proxysql_cpu_usage(cl, REPORT_INTV_SEC, no_conns_cpu); if (idle_err) { - diag("Unable to get 'idle_cpu' usage."); + diag("Unable to get 'no_conns_cpu' usage."); return idle_err; } @@ -92,7 +92,7 @@ int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& no_conns_cp int final_err = get_proxysql_cpu_usage(cl, REPORT_INTV_SEC, idle_conns_cpu); if (final_err) { - diag("Unable to get 'final_cpu' usage."); + diag("Unable to get 'idle_conns_cpu' usage."); return idle_err; } diff --git a/test/tap/tests/reg_test_sql_calc_found_rows-t.cpp b/test/tap/tests/reg_test_sql_calc_found_rows-t.cpp index 674a1f9b74..0a7200ef18 100644 --- a/test/tap/tests/reg_test_sql_calc_found_rows-t.cpp +++ b/test/tap/tests/reg_test_sql_calc_found_rows-t.cpp @@ -13,7 +13,6 @@ #include #include "mysql.h" -#include "mysqld_error.h" #include "json.hpp" @@ -74,7 +73,7 @@ int main(int argc, char** argv) { // 1. Prepare the 'SQL_CALC_FOUND_ROWS' stmt in a connection MYSQL* proxy_mysql = mysql_init(NULL); - diag("%s: Openning initial connection...", tap_curtime().c_str()); + diag("Openning initial connection..."); if (!mysql_real_connect(proxy_mysql, cl.host, cl.username, cl.password, NULL, cl.port, NULL, 0)) { fprintf(stderr, "File %s, line %d, Error: %s\n", __FILE__, __LINE__, mysql_error(proxy_mysql)); return EXIT_FAILURE; @@ -84,7 +83,7 @@ int main(int argc, char** argv) { MYSQL_STMT* stmt_2 = mysql_stmt_init(proxy_mysql); MYSQL_STMT* stmt_3 = nullptr; - diag("%s: Issuing the prepare for `%s` in init conn", tap_curtime().c_str(), Q_CALC_FOUND_ROWS_1); + diag("Issuing the prepare for `%s` in init conn", Q_CALC_FOUND_ROWS_1); int my_err = mysql_stmt_prepare(stmt_1, Q_CALC_FOUND_ROWS_1, strlen(Q_CALC_FOUND_ROWS_1)); if (my_err) { diag( @@ -94,7 +93,7 @@ int main(int argc, char** argv) { goto cleanup; } - diag("%s: Issuing the prepare for `%s` in init conn", tap_curtime().c_str(), Q_CALC_FOUND_ROWS_2); + diag("Issuing the prepare for `%s` in init conn", Q_CALC_FOUND_ROWS_2); my_err = mysql_stmt_prepare(stmt_2, Q_CALC_FOUND_ROWS_2, strlen(Q_CALC_FOUND_ROWS_2)); if (my_err) { diag( @@ -107,13 +106,13 @@ int main(int argc, char** argv) { mysql_stmt_close(stmt_1); mysql_stmt_close(stmt_2); - diag("%s: Closing initial connection...", tap_curtime().c_str()); + diag("Closing initial connection..."); mysql_close(proxy_mysql); // 2. Open a new connection and prepare the stmts it again in a new connection proxy_mysql = mysql_init(NULL); - diag("%s: Openning new connection for testing 'Multiplex' disabling", tap_curtime().c_str()); + diag("Openning new connection for testing 'Multiplex' disabling"); if (!mysql_real_connect(proxy_mysql, cl.host, cl.username, cl.password, NULL, cl.port, NULL, 0)) { fprintf(stderr, "File %s, line %d, Error: %s\n", __FILE__, __LINE__, mysql_error(proxy_mysql)); return EXIT_FAILURE; @@ -123,7 +122,7 @@ int main(int argc, char** argv) { stmt_2 = mysql_stmt_init(proxy_mysql); stmt_3 = mysql_stmt_init(proxy_mysql); - diag("%s: Issuing the prepare for `%s` in new conn", tap_curtime().c_str(), Q_CALC_FOUND_ROWS_1); + diag("Issuing the prepare for `%s` in new conn", Q_CALC_FOUND_ROWS_1); my_err = mysql_stmt_prepare(stmt_1, Q_CALC_FOUND_ROWS_1, strlen(Q_CALC_FOUND_ROWS_1)); if (my_err) { diag( @@ -134,7 +133,7 @@ int main(int argc, char** argv) { } { - diag("%s: Issuing execute for `%s` in new conn", tap_curtime().c_str(), Q_CALC_FOUND_ROWS_1); + diag("Issuing execute for `%s` in new conn", Q_CALC_FOUND_ROWS_1); my_err = mysql_stmt_execute(stmt_1); if (my_err) { diag("'mysql_stmt_execute' at line %d failed: %s", __LINE__, mysql_stmt_error(stmt_1)); @@ -149,7 +148,7 @@ int main(int argc, char** argv) { } } { - diag("%s: Issuing the prepare for `%s` in new conn", tap_curtime().c_str(), Q_CALC_FOUND_ROWS_2); + diag("Issuing the prepare for `%s` in new conn", Q_CALC_FOUND_ROWS_2); my_err = mysql_stmt_prepare(stmt_2, Q_CALC_FOUND_ROWS_2, strlen(Q_CALC_FOUND_ROWS_2)); if (my_err) { diag( @@ -160,7 +159,7 @@ int main(int argc, char** argv) { } { - diag("%s: Issuing execute for `%s` in new conn", tap_curtime().c_str(), Q_CALC_FOUND_ROWS_2); + diag("Issuing execute for `%s` in new conn", Q_CALC_FOUND_ROWS_2); my_err = mysql_stmt_execute(stmt_2); if (my_err) { diag("'mysql_stmt_execute' at line %d failed: %s", __LINE__, mysql_stmt_error(stmt_2)); @@ -175,7 +174,7 @@ int main(int argc, char** argv) { } } - diag("%s: Issuing the prepare for `%s` in new conn", tap_curtime().c_str(), Q_FOUND_ROWS); + diag("Issuing the prepare for `%s` in new conn", Q_FOUND_ROWS); my_err = mysql_stmt_prepare(stmt_3, Q_FOUND_ROWS, strlen(Q_FOUND_ROWS)); if (my_err) { diag( diff --git a/test/tap/tests/test_auto_increment_delay_multiplex-t.cpp b/test/tap/tests/test_auto_increment_delay_multiplex-t.cpp index ee50da7211..64f531da0e 100644 --- a/test/tap/tests/test_auto_increment_delay_multiplex-t.cpp +++ b/test/tap/tests/test_auto_increment_delay_multiplex-t.cpp @@ -25,11 +25,9 @@ #include #include #include -#include #include #include "mysql.h" -#include "mysqld_error.h" #include "json.hpp" @@ -142,14 +140,14 @@ int check_auto_increment_timeout( const string set_auto_inc_to_query { "SET mysql-auto_increment_delay_multiplex_timeout_ms=" + std::to_string(auto_inc_delay_to) }; - diag("%s: Executing query `%s`...", tap_curtime().c_str(), set_auto_inc_to_query.c_str()); + diag("Executing query `%s`...", set_auto_inc_to_query.c_str()); MYSQL_QUERY(proxy_admin, set_auto_inc_to_query.c_str()); MYSQL_QUERY(proxy_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "LOAD MYSQL VARIABLES TO RUNTIME"); + diag("Executing query `%s`...", "LOAD MYSQL VARIABLES TO RUNTIME"); MYSQL_QUERY(proxy_mysql, INSERT_QUERY); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), INSERT_QUERY); + diag("Executing query `%s`...", INSERT_QUERY); // Wait at least '500' milliseconds over the poll period usleep((poll_to + 500) * 1000); @@ -197,7 +195,7 @@ int check_auto_increment_timeout( } MYSQL_QUERY(proxy_mysql, "DO 1"); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "DO 1"); + diag("Executing query `%s`...", "DO 1"); uint32_t old_auto_inc_delay_mult = cur_auto_inc_delay_mult; g_res = get_conn_auto_inc_delay_token(proxy_mysql, cur_auto_inc_delay_mult); @@ -244,9 +242,9 @@ int check_variables_config(MYSQL* proxy_mysql, MYSQL* proxy_admin) { int check_auto_increment_delay_multiplex(MYSQL* proxy_mysql, MYSQL* proxy_admin) { // Disable the 'timeout' for the this check since it can be fixated now - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "SET mysql-auto_increment_delay_multiplex_timeout_ms=0"); + diag("Executing query `%s`...", "SET mysql-auto_increment_delay_multiplex_timeout_ms=0"); MYSQL_QUERY(proxy_admin, "SET mysql-auto_increment_delay_multiplex_timeout_ms=0"); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "SET mysql-connection_delay_multiplex_ms=0"); + diag("Executing query `%s`...", "SET mysql-connection_delay_multiplex_ms=0"); MYSQL_QUERY(proxy_admin, "SET mysql-connection_delay_multiplex_ms=0"); int cur_auto_inc_delay_mult = 0; @@ -310,13 +308,13 @@ int check_auto_increment_delay_multiplex_timeout(MYSQL* proxy_mysql, MYSQL* prox uint64_t poll_timeout = 0; int g_res = 0; - diag("%s: Executing query `%s`...", tap_curtime().c_str(), set_auto_inc_query.c_str()); + diag("Executing query `%s`...", set_auto_inc_query.c_str()); MYSQL_QUERY(proxy_admin, set_auto_inc_query.c_str()); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "SET mysql-connection_delay_multiplex_ms=0"); + diag("Executing query `%s`...", "SET mysql-connection_delay_multiplex_ms=0"); MYSQL_QUERY(proxy_admin, "SET mysql-connection_delay_multiplex_ms=0"); const string q_poll_timeout { "SELECT variable_value FROM global_variables WHERE variable_name='mysql-poll_timeout'" }; - diag("%s: Executing query `%s`...", tap_curtime().c_str(), q_poll_timeout.c_str()); + diag("Executing query `%s`...", q_poll_timeout.c_str()); g_res = get_query_result(proxy_admin, q_poll_timeout.c_str(), poll_timeout); if (g_res != EXIT_SUCCESS) { return EXIT_FAILURE; } @@ -357,14 +355,14 @@ int check_auto_increment_delay_multiplex_timeout(MYSQL* proxy_mysql, MYSQL* prox if (g_res != EXIT_SUCCESS) { return EXIT_FAILURE; } MYSQL_QUERY(proxy_admin, delay_query.c_str()); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), delay_query.c_str()); + diag("Executing query `%s`...", delay_query.c_str()); MYSQL_QUERY(proxy_admin, timeout_query.c_str()); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), timeout_query.c_str()); + diag("Executing query `%s`...", timeout_query.c_str()); MYSQL_QUERY(proxy_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); { // Insert disabling multiplexing for the connection - diag("%s: Executing query `%s`...", tap_curtime().c_str(), INSERT_QUERY); + diag("Executing query `%s`...", INSERT_QUERY); MYSQL_QUERY(proxy_mysql, INSERT_QUERY); // Perform queries in the same connection @@ -373,7 +371,7 @@ int check_auto_increment_delay_multiplex_timeout(MYSQL* proxy_mysql, MYSQL* prox while (waited < timeout_ms * 3) { sleep(1); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "/* hostgroup=0 */ DO 1"); + diag("Executing query `%s`...", "/* hostgroup=0 */ DO 1"); MYSQL_QUERY(proxy_mysql, "/* hostgroup=0 */ DO 1"); waited += 1000; } @@ -397,7 +395,7 @@ int check_auto_increment_delay_multiplex_timeout(MYSQL* proxy_mysql, MYSQL* prox while (waited < timeout_ms * 3) { sleep(1); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "SELECT 1"); + diag("Executing query `%s`...", "SELECT 1"); MYSQL_QUERY(proxy_mysql, "SELECT 1"); mysql_free_result(mysql_store_result(proxy_mysql)); @@ -423,16 +421,16 @@ int check_auto_increment_delay_multiplex_timeout(MYSQL* proxy_mysql, MYSQL* prox // Transactions connections should be preserved by 'auto_increment_delay_multiplex_timeout_ms' { - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "BEGIN"); + diag("Executing query `%s`...", "BEGIN"); MYSQL_QUERY(proxy_mysql, "BEGIN"); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), INSERT_QUERY); + diag("Executing query `%s`...", INSERT_QUERY); MYSQL_QUERY(proxy_mysql, INSERT_QUERY); // Wait for the timeout and check the value - diag("%s: Waiting for timeout to expire...", tap_curtime().c_str()); + diag("Waiting for timeout to expire..."); usleep(timeout_ms * 1000 + poll_timeout * 1000 + 500 * 1000 * 2); - diag("%s: Extracting current auto inc delay...", tap_curtime().c_str()); + diag("Extracting current auto inc delay..."); int cur_delay = 0; int g_res = get_conn_auto_inc_delay_token(proxy_mysql, cur_delay); if (g_res != EXIT_SUCCESS) { @@ -445,13 +443,13 @@ int check_auto_increment_delay_multiplex_timeout(MYSQL* proxy_mysql, MYSQL* prox delay, cur_delay ); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "COMMIT"); + diag("Executing query `%s`...", "COMMIT"); MYSQL_QUERY(proxy_mysql, "COMMIT"); - diag("%s: Waiting for timeout to expire...", tap_curtime().c_str()); + diag("Waiting for timeout to expire..."); usleep(timeout_ms * 1000 + poll_timeout * 1000 + 500 * 1000 * 2); - diag("%s: Extracting current auto inc delay...", tap_curtime().c_str()); + diag("Extracting current auto inc delay..."); cur_delay = 0; g_res = get_conn_auto_inc_delay_token(proxy_mysql, cur_delay); if (g_res != EXIT_SUCCESS) { @@ -468,16 +466,16 @@ int check_auto_increment_delay_multiplex_timeout(MYSQL* proxy_mysql, MYSQL* prox // Multiplex disabled by any action should take precedence over 'auto_increment_delay_multiplex_timeout_ms' { const char* set_query { "SET @local_var='foo'" }; - diag("%s: Executing query `%s`...", tap_curtime().c_str(), set_query); + diag("Executing query `%s`...", set_query); MYSQL_QUERY(proxy_mysql, set_query); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), INSERT_QUERY); + diag("Executing query `%s`...", INSERT_QUERY); MYSQL_QUERY(proxy_mysql, INSERT_QUERY); // Wait for the timeout and check the value - diag("%s: Waiting for timeout to expire...", tap_curtime().c_str()); + diag("Waiting for timeout to expire..."); usleep(timeout_ms * 1000 + poll_timeout * 1000 + 500 * 1000 * 2); - diag("%s: Extracting current auto inc delay...", tap_curtime().c_str()); + diag("Extracting current auto inc delay..."); int cur_delay = 0; int g_res = get_conn_auto_inc_delay_token(proxy_mysql, cur_delay); if (g_res != EXIT_SUCCESS) { @@ -533,9 +531,9 @@ void check_connection_retained(MYSQL* proxy_mysql, uint32_t exp_conns) { int check_transactions_and_multiplex_disable( MYSQL* proxy_mysql, const char* query, const uint32_t timeout, uint64_t poll_timeout=2 ) { - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "BEGIN"); + diag("Executing query `%s`...", "BEGIN"); MYSQL_QUERY(proxy_mysql, "BEGIN"); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), query); + diag("Executing query `%s`...", query); MYSQL_QUERY(proxy_mysql, query); diag("Checking connection present before timeout..."); @@ -547,7 +545,7 @@ int check_transactions_and_multiplex_disable( diag("Checking connection is still present after timeout due to transaction..."); check_connection_retained(proxy_mysql, 1); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "COMMIT"); + diag("Executing query `%s`...", "COMMIT"); MYSQL_QUERY(proxy_mysql, "COMMIT"); diag("Sleeping for '%lf' seconds", timeout / 2.0); @@ -565,7 +563,7 @@ int check_transactions_and_multiplex_disable( diag("Checking multiplex disabled by any action take precedence over 'connection_delay_multiplex_ms'..."); const char* set_query { "SET @local_var='foo'" }; - diag("%s: Executing query `%s`...", tap_curtime().c_str(), set_query); + diag("Executing query `%s`...", set_query); MYSQL_QUERY(proxy_mysql, set_query); diag("Sleeping for '%ld' seconds", timeout + poll_timeout); @@ -587,13 +585,13 @@ int check_connection_delay_multiplex_ms(MYSQL* proxy_mysql, MYSQL* proxy_admin) string_format("SET mysql-connection_delay_multiplex_ms=%d", set_delay_multiplex, timeout * 1000); const char* set_auto_inc_delay { "SET mysql-auto_increment_delay_multiplex_timeout_ms=0" }; - diag("%s: Executing query `%s`...", tap_curtime().c_str(), set_delay_multiplex.c_str()); + diag("Executing query `%s`...", set_delay_multiplex.c_str()); MYSQL_QUERY(proxy_admin, set_delay_multiplex.c_str()); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), set_auto_inc_delay); + diag("Executing query `%s`...", set_auto_inc_delay); MYSQL_QUERY(proxy_admin, set_auto_inc_delay); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "LOAD MYSQL VARIABLES TO RUNTIME"); + diag("Executing query `%s`...", "LOAD MYSQL VARIABLES TO RUNTIME"); MYSQL_QUERY(proxy_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); MYSQL_QUERY(proxy_mysql, "SELECT 1"); @@ -632,13 +630,13 @@ int check_multiplex_disabled_connection_delay_multiplex_ms(MYSQL* proxy_mysql, M string_format("SET mysql-connection_delay_multiplex_ms=%d", set_delay_multiplex, timeout * 1000); const char* set_auto_inc_delay { "SET mysql-auto_increment_delay_multiplex_timeout_ms=0" }; - diag("%s: Executing query `%s`...", tap_curtime().c_str(), set_delay_multiplex.c_str()); + diag("Executing query `%s`...", set_delay_multiplex.c_str()); MYSQL_QUERY(proxy_admin, set_delay_multiplex.c_str()); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), set_auto_inc_delay); + diag("Executing query `%s`...", set_auto_inc_delay); MYSQL_QUERY(proxy_admin, set_auto_inc_delay); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "LOAD MYSQL VARIABLES TO RUNTIME"); + diag("Executing query `%s`...", "LOAD MYSQL VARIABLES TO RUNTIME"); MYSQL_QUERY(proxy_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); // Check transactions behavior and multiplex disabling actions @@ -652,11 +650,11 @@ int check_traffic_connection_delay_multiplex_ms(MYSQL* proxy_mysql, MYSQL* proxy const char* set_delay_multiplex_query { "SET mysql-connection_delay_multiplex_ms=2000" }; const char* set_auto_inc_timeout_query { "SET mysql-auto_increment_delay_multiplex_timeout_ms=0" }; - diag("%s: Executing query `%s`...", tap_curtime().c_str(), set_delay_multiplex_query); + diag("Executing query `%s`...", set_delay_multiplex_query); MYSQL_QUERY(proxy_admin, set_delay_multiplex_query); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), set_auto_inc_timeout_query); + diag("Executing query `%s`...", set_auto_inc_timeout_query); MYSQL_QUERY(proxy_admin, set_auto_inc_timeout_query); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "LOAD MYSQL VARIABLES TO RUNTIME"); + diag("Executing query `%s`...", "LOAD MYSQL VARIABLES TO RUNTIME"); MYSQL_QUERY(proxy_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); // Retain connection in 'hg=0' @@ -664,7 +662,7 @@ int check_traffic_connection_delay_multiplex_ms(MYSQL* proxy_mysql, MYSQL* proxy uint32_t waited = 0; while (waited < 2*timeout) { - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "DO 1"); + diag("Executing query `%s`...", "DO 1"); MYSQL_QUERY(proxy_mysql, "DO 1"); sleep(1); @@ -679,9 +677,9 @@ int check_traffic_connection_delay_multiplex_ms(MYSQL* proxy_mysql, MYSQL* proxy diag("Check connection expiring when traffic issued to different hostgroup..."); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "DO 1"); + diag("Executing query `%s`...", "DO 1"); MYSQL_QUERY(proxy_mysql, "DO 1"); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "SELECT 1"); + diag("Executing query `%s`...", "SELECT 1"); MYSQL_QUERY(proxy_mysql, "SELECT 1"); mysql_free_result(mysql_store_result(proxy_mysql)); @@ -719,7 +717,7 @@ int check_traffic_connection_delay_multiplex_ms(MYSQL* proxy_mysql, MYSQL* proxy // Check for connections retained in 'hg 0' waited = 0; while (waited < timeout * 2) { - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "SELECT 1"); + diag("Executing query `%s`...", "SELECT 1"); MYSQL_QUERY(proxy_mysql, "SELECT 1"); mysql_free_result(mysql_store_result(proxy_mysql)); @@ -768,18 +766,18 @@ int check_auto_inc_delay_and_conn_delay_multiplex(MYSQL* proxy_mysql, MYSQL* pro const char* set_delay_multiplex_query { "SET mysql-connection_delay_multiplex_ms=2000" }; const char* set_auto_inc_timeout_query { "SET mysql-auto_increment_delay_multiplex_timeout_ms=0" }; - diag("%s: Executing query `%s`...", tap_curtime().c_str(), set_delay_multiplex_query); + diag("Executing query `%s`...", set_delay_multiplex_query); MYSQL_QUERY(proxy_admin, set_delay_multiplex_query); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), set_auto_inc_timeout_query); + diag("Executing query `%s`...", set_auto_inc_timeout_query); MYSQL_QUERY(proxy_admin, set_auto_inc_timeout_query); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "LOAD MYSQL VARIABLES TO RUNTIME"); + diag("Executing query `%s`...", "LOAD MYSQL VARIABLES TO RUNTIME"); MYSQL_QUERY(proxy_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); // Retain connection in 'hg=0' diag("Checking connection not expiring due to 'auto_increment_delay_multiplex'."); uint32_t waited = 0; - diag("%s: Executing query `%s`...", tap_curtime().c_str(), INSERT_QUERY); + diag("Executing query `%s`...", INSERT_QUERY); MYSQL_QUERY(proxy_mysql, INSERT_QUERY); diag("* Check connection retained after executing the query"); @@ -797,13 +795,13 @@ int check_auto_inc_delay_and_conn_delay_multiplex(MYSQL* proxy_mysql, MYSQL* pro ); string_format("SET mysql-auto_increment_delay_multiplex_timeout_ms=%d", auto_inc_timeout_query, timeout*2*1000); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), auto_inc_timeout_query.c_str()); + diag("Executing query `%s`...", auto_inc_timeout_query.c_str()); MYSQL_QUERY(proxy_admin, auto_inc_timeout_query.c_str()); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "LOAD MYSQL VARIABLES TO RUNTIME"); + diag("Executing query `%s`...", "LOAD MYSQL VARIABLES TO RUNTIME"); MYSQL_QUERY(proxy_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), INSERT_QUERY); + diag("Executing query `%s`...", INSERT_QUERY); MYSQL_QUERY(proxy_mysql, INSERT_QUERY); diag("Sleeping for '%d' seconds", timeout + 1); @@ -834,17 +832,17 @@ int check_auto_inc_delay_and_conn_delay_multiplex(MYSQL* proxy_mysql, MYSQL* pro ); string_format("SET mysql-auto_increment_delay_multiplex_timeout_ms=%d", auto_inc_timeout_query, timeout*1000); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), auto_inc_timeout_query.c_str()); + diag("Executing query `%s`...", auto_inc_timeout_query.c_str()); MYSQL_QUERY(proxy_admin, auto_inc_timeout_query.c_str()); const char* set_delay_multiplex_query_2 { "SET mysql-connection_delay_multiplex_ms=4000" }; - diag("%s: Executing query `%s`...", tap_curtime().c_str(), set_delay_multiplex_query_2); + diag("Executing query `%s`...", set_delay_multiplex_query_2); MYSQL_QUERY(proxy_admin, set_delay_multiplex_query_2); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), "LOAD MYSQL VARIABLES TO RUNTIME"); + diag("Executing query `%s`...", "LOAD MYSQL VARIABLES TO RUNTIME"); MYSQL_QUERY(proxy_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); - diag("%s: Executing query `%s`...", tap_curtime().c_str(), INSERT_QUERY); + diag("Executing query `%s`...", INSERT_QUERY); MYSQL_QUERY(proxy_mysql, INSERT_QUERY); diag("Sleeping for '%d' seconds", timeout + 1); diff --git a/test/tap/tests/test_binlog_fast_forward-t.cpp b/test/tap/tests/test_binlog_fast_forward-t.cpp index 6f9c98befb..c6569c7c45 100644 --- a/test/tap/tests/test_binlog_fast_forward-t.cpp +++ b/test/tap/tests/test_binlog_fast_forward-t.cpp @@ -84,7 +84,7 @@ int pull_replication(MYSQL *mysql, int server_id) { } } if (print_diag == true) - diag("%s: server_id %d , event: %d , received events: %d , received heartbeats: %d", tap_curtime().c_str(), server_id, event->event_type, num_events, num_heartbeats); + diag("server_id %d , event: %d , received events: %d , received heartbeats: %d", server_id, event->event_type, num_events, num_heartbeats); } // we expects NHB heartbeats ok(num_heartbeats == NHB , "For server_id %d received %d heartbeats", server_id, num_heartbeats); diff --git a/test/tap/tests/test_session_status_flags-t.cpp b/test/tap/tests/test_session_status_flags-t.cpp index 181c2561b5..2849fa49e8 100644 --- a/test/tap/tests/test_session_status_flags-t.cpp +++ b/test/tap/tests/test_session_status_flags-t.cpp @@ -172,7 +172,7 @@ int prepare_stmt_queries(const CommandLine& cl, const vector& p_queries // 1. Prepare the stmt in a connection MYSQL* proxy_mysql = mysql_init(NULL); - diag("%s: Openning INITIAL connection...", tap_curtime().c_str()); + diag("Openning INITIAL connection..."); if (!mysql_real_connect(proxy_mysql, cl.root_host, cl.root_username, cl.root_password, NULL, cl.root_port, NULL, 0)) { fprintf(stderr, "File %s, line %d, Error: %s\n", __FILE__, __LINE__, mysql_error(proxy_mysql)); return EXIT_FAILURE; @@ -216,7 +216,7 @@ int prepare_stmt_queries(const CommandLine& cl, const vector& p_queries return EXIT_FAILURE; } - diag("%s: Issuing PREPARE for `%s` in INIT conn", tap_curtime().c_str(), query.c_str()); + diag("Issuing PREPARE for `%s` in INIT conn", query.c_str()); int my_err = mysql_stmt_prepare(stmt, query.c_str(), strlen(query.c_str())); if (my_err) { diag( @@ -229,7 +229,7 @@ int prepare_stmt_queries(const CommandLine& cl, const vector& p_queries mysql_stmt_close(stmt); } - diag("%s: Closing PREPARING connection...", tap_curtime().c_str()); + diag("Closing PREPARING connection..."); mysql_close(proxy_mysql); return EXIT_SUCCESS; @@ -326,7 +326,7 @@ int exec_stmt_queries(MYSQL* proxy_mysql, const vector& test_queries) { } else { MYSQL_STMT* stmt = mysql_stmt_init(proxy_mysql); - diag("%s: Issuing PREPARE for `%s` in new conn", tap_curtime().c_str(), query.c_str()); + diag("Issuing PREPARE for `%s` in new conn", query.c_str()); int my_err = mysql_stmt_prepare(stmt, query.c_str(), strlen(query.c_str())); if (my_err) { diag( @@ -339,7 +339,7 @@ int exec_stmt_queries(MYSQL* proxy_mysql, const vector& test_queries) { // TODO: Remember to DOC requiring to execute { if (rep_check.first == 0 || rep_check.second == 0) { - diag("%s: Issuing EXECUTE for `%s` in new conn", tap_curtime().c_str(), query.c_str()); + diag("Issuing EXECUTE for `%s` in new conn", query.c_str()); my_err = mysql_stmt_execute(stmt); if (my_err) { diag("'mysql_stmt_execute' at line %d failed: %s", __LINE__, mysql_stmt_error(stmt)); diff --git a/test/tap/tests/test_unshun_algorithm-t.cpp b/test/tap/tests/test_unshun_algorithm-t.cpp index 78c28107bd..7b424a7fdd 100644 --- a/test/tap/tests/test_unshun_algorithm-t.cpp +++ b/test/tap/tests/test_unshun_algorithm-t.cpp @@ -84,7 +84,7 @@ int shunn_server(MYSQL* proxysql_admin, uint32_t i, uint32_t j) { std::string t_simulator_error_query { "PROXYSQL_SIMULATOR mysql_error %d 127.0.0.1:330%d 1234" }; std::string simulator_error_q_i {}; string_format(t_simulator_error_query, simulator_error_q_i, i, j); - diag("%s: running query: %s", tap_curtime().c_str(), simulator_error_q_i.c_str()); + diag("running query: %s", simulator_error_q_i.c_str()); MYSQL_QUERY(proxysql_admin, simulator_error_q_i.c_str()); return EXIT_SUCCESS; @@ -116,7 +116,7 @@ int wakup_target_server(MYSQL* proxysql_mysql, uint32_t i) { string_format(t_simple_do_query, simple_do_query, i); mysql_query(proxysql_mysql, simple_do_query.c_str()); - diag("%s: running query: %s", tap_curtime().c_str(), simple_do_query.c_str()); + diag("running query: %s", simple_do_query.c_str()); return EXIT_SUCCESS; } @@ -127,7 +127,7 @@ int server_status_checker(MYSQL* admin, const string& f_st, const string& n_st, }; std::string server_status_query {}; string_format(t_server_status_query, server_status_query, i); - diag("%s: running query: %s", tap_curtime().c_str(), server_status_query.c_str()); + diag("running query: %s", server_status_query.c_str()); MYSQL_QUERY(admin, server_status_query.c_str()); MYSQL_RES* status_res = mysql_store_result(admin); @@ -193,9 +193,9 @@ int test_unshun_algorithm_variable(MYSQL* proxysql_admin) { }; MYSQL_QUERY(proxysql_admin, "LOAD MYSQL VARIABLES FROM DISK"); - diag("%s: Line:%d running admin query to reload variables: LOAD MYSQL VARIABLES FROM DISK", tap_curtime().c_str(), __LINE__); + diag("Line:%d running admin query to reload variables: LOAD MYSQL VARIABLES FROM DISK", __LINE__); MYSQL_QUERY(proxysql_admin, "SET mysql-hostgroup_manager_verbose=3"); - diag("%s: Line:%d running admin query: SET mysql-hostgroup_manager_verbose=3", tap_curtime().c_str(), __LINE__); + diag("Line:%d running admin query: SET mysql-hostgroup_manager_verbose=3", __LINE__); MYSQL_QUERY(proxysql_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); int32_t def_unshun_value = get_current_unshun_algorithm_val(proxysql_admin); ok(def_unshun_value == 0, "Default 'mysql-unshun_algorithm' should be '0', actual: %d", def_unshun_value); @@ -206,7 +206,7 @@ int test_unshun_algorithm_variable(MYSQL* proxysql_admin) { std::string set_unshun {}; string_format(t_set_unshun, set_unshun, i); MYSQL_QUERY(proxysql_admin, set_unshun.c_str()); - diag("%s: Line:%d running admin query: %s", tap_curtime().c_str(), __LINE__, set_unshun.c_str()); + diag("Line:%d running admin query: %s", __LINE__, set_unshun.c_str()); MYSQL_QUERY(proxysql_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); int32_t cur_unshun_val = get_current_unshun_algorithm_val(proxysql_admin); @@ -217,7 +217,7 @@ int test_unshun_algorithm_variable(MYSQL* proxysql_admin) { std::string set_unshun {}; string_format(t_set_unshun, set_unshun, VALID_RANGE + 1); MYSQL_QUERY(proxysql_admin, set_unshun.c_str()); - diag("%s: Line:%d running admin query: %s", tap_curtime().c_str(), __LINE__, set_unshun.c_str()); + diag("Line:%d running admin query: %s", __LINE__, set_unshun.c_str()); MYSQL_QUERY(proxysql_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); int32_t cur_unshun_val = get_current_unshun_algorithm_val(proxysql_admin); @@ -276,13 +276,13 @@ int test_proxysql_simulator_error(MYSQL* proxysql_admin) { */ int configure_mysql_shunning_variables(MYSQL* proxysql_admin) { MYSQL_QUERY(proxysql_admin, "SET mysql-shun_on_failures=3"); - diag("%s: Line:%d running admin query: SET mysql-shun_on_failures=3", tap_curtime().c_str(), __LINE__); + diag("Line:%d running admin query: SET mysql-shun_on_failures=3", __LINE__); MYSQL_QUERY(proxysql_admin, "SET mysql-connect_retries_on_failure=3"); - diag("%s: Line:%d running admin query: SET mysql-connect_retries_on_failure=3", tap_curtime().c_str(), __LINE__); + diag("Line:%d running admin query: SET mysql-connect_retries_on_failure=3", __LINE__); MYSQL_QUERY(proxysql_admin, "SET mysql-connect_retries_delay=1000"); - diag("%s: Line:%d running admin query: SET mysql-connect_retries_delay=1000", tap_curtime().c_str(), __LINE__); + diag("Line:%d running admin query: SET mysql-connect_retries_delay=1000", __LINE__); return EXIT_SUCCESS; } @@ -290,11 +290,11 @@ int configure_mysql_shunning_variables(MYSQL* proxysql_admin) { int test_unshun_algorithm_behavior(MYSQL* proxysql_mysql, MYSQL* proxysql_admin) { // Configure Admin variables with lower thresholds MYSQL_QUERY(proxysql_admin, "SET mysql-shun_recovery_time_sec=1"); - diag("%s: Line:%d running admin query: SET mysql-shun_recovery_time_sec=1", tap_curtime().c_str(), __LINE__); + diag("Line:%d running admin query: SET mysql-shun_recovery_time_sec=1", __LINE__); // Set verbosity up for extra information in ProxySQL log MYSQL_QUERY(proxysql_admin, "SET mysql-hostgroup_manager_verbose=3"); - diag("%s: Line:%d running admin query: SET mysql-hostgroup_manager_verbose=3", tap_curtime().c_str(), __LINE__); + diag("Line:%d running admin query: SET mysql-hostgroup_manager_verbose=3", __LINE__); // Configure the relevant variables for the desired UNSHUNNING behavior if (configure_mysql_shunning_variables(proxysql_admin)) { @@ -327,7 +327,7 @@ int test_unshun_algorithm_behavior(MYSQL* proxysql_mysql, MYSQL* proxysql_admin) { MYSQL_QUERY(proxysql_admin, "SET mysql-unshun_algorithm=0"); - diag("%s: Line:%d running admin query: SET mysql-unshun_algorithm=0", tap_curtime().c_str(), __LINE__); + diag("Line:%d running admin query: SET mysql-unshun_algorithm=0", __LINE__); MYSQL_QUERY(proxysql_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); int shunn_err = shunn_all_servers(proxysql_admin); @@ -347,7 +347,7 @@ int test_unshun_algorithm_behavior(MYSQL* proxysql_mysql, MYSQL* proxysql_admin) { 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__); + diag("Line:%d running admin query: SET mysql-unshun_algorithm=1", __LINE__); MYSQL_QUERY(proxysql_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); int shunn_err = shunn_all_servers(proxysql_admin); @@ -367,7 +367,7 @@ int test_unshun_algorithm_behavior(MYSQL* proxysql_mysql, MYSQL* proxysql_admin) { MYSQL_QUERY(proxysql_admin, "SET mysql-unshun_algorithm=0"); - diag("%s: Line:%d running admin query: SET mysql-unshun_algorithm=0", tap_curtime().c_str(), __LINE__); + diag("Line:%d running admin query: SET mysql-unshun_algorithm=0", __LINE__); MYSQL_QUERY(proxysql_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); int shunn_err = shunn_all_servers(proxysql_admin); @@ -379,7 +379,7 @@ int test_unshun_algorithm_behavior(MYSQL* proxysql_mysql, MYSQL* proxysql_admin) 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__); + diag("Line:%d running admin query: SET mysql-unshun_algorithm=1", __LINE__); MYSQL_QUERY(proxysql_admin, "LOAD MYSQL VARIABLES TO RUNTIME"); for (uint32_t i = 0; i < SERVERS_COUNT; i++) {