diff --git a/server/core/gateway.cc b/server/core/gateway.cc index 2ee45dce4..67688af04 100644 --- a/server/core/gateway.cc +++ b/server/core/gateway.cc @@ -227,11 +227,11 @@ const DEBUG_ARGUMENT debug_arguments[] = }, { "enable-statement-logging", enable_statement_logging, - "enable the logging of SQL statements sent by MaxScale to the servers" + "enable the logging of monitor and authenticator SQL statements sent by MaxScale to the servers" }, { "disable-statement-logging", disable_statement_logging, - "disable the logging of SQL statements sent by MaxScale to the servers" + "disable the logging of monitor and authenticator SQL statements sent by MaxScale to the servers" }, {NULL, NULL, NULL} }; @@ -1011,7 +1011,7 @@ static void usage(void) for (int i = 0; debug_arguments[i].action != NULL; i++) { fprintf(stderr, - " %-24s %s\n", debug_arguments[i].name, debug_arguments[i].description); + " %-25s %s\n", debug_arguments[i].name, debug_arguments[i].description); } fprintf(stderr, " -v, --version print version info and exit\n" diff --git a/server/core/mysql_utils.cc b/server/core/mysql_utils.cc index 1aedf77af..677a7a68f 100644 --- a/server/core/mysql_utils.cc +++ b/server/core/mysql_utils.cc @@ -249,15 +249,12 @@ int mxs_mysql_query(MYSQL* conn, const char* query) if (this_unit.log_statements) { - const char* host; - if (mariadb_get_info(conn, MARIADB_CONNECTION_HOST, &host) != 0) - { - // No idea about the host, but let's use something that looks like - // an IP-address as a placeholder. - host = "0.0.0.0"; - } - - MXS_NOTICE("SQL(%s): %d, \"%s\"", host, rc, query); + const char* host = "0.0.0.0"; + unsigned int port = 0; + MXB_AT_DEBUG(int rc1 =) mariadb_get_info(conn, MARIADB_CONNECTION_HOST, &host); + MXB_AT_DEBUG(int rc2 =) mariadb_get_info(conn, MARIADB_CONNECTION_PORT, &port); + mxb_assert(!rc1 && !rc2); + MXS_NOTICE("SQL([%s]:%u): %d, \"%s\"", host, port, rc, query); } return rc;