Merge pull request #4053 from sysown/v2.x-fix_several_warnings

Fix several simple compiler warnings
pull/4054/head
René Cannaò 3 years ago committed by GitHub
commit 6907c034b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3662,7 +3662,7 @@ void MySQL_HostGroups_Manager::group_replication_lag_action(
wrlock();
int reader_hostgroup = 0;
bool writer_is_also_reader = false;
// bool writer_is_also_reader = false;
// Get the reader_hostgroup for the supplied writter hostgroup
const std::string t_reader_hostgroup_query {
@ -3688,7 +3688,7 @@ void MySQL_HostGroups_Manager::group_replication_lag_action(
rhid_row = rhid_res->rows[0];
reader_hostgroup = atoi(rhid_row->fields[0]);
writer_is_also_reader = atoi(rhid_row->fields[1]);
// writer_is_also_reader = atoi(rhid_row->fields[1]);
{
MyHGC* myhgc = nullptr;

@ -542,7 +542,7 @@ void MySQL_Logger::events_open_log_unlocked() {
events.logfile->open(filen , std::ios::out | std::ios::binary);
proxy_info("Starting new mysql event log file %s\n", filen);
}
catch (std::ofstream::failure e) {
catch (const std::ofstream::failure&) {
proxy_error("Error creating new mysql event log file %s\n", filen);
delete events.logfile;
events.logfile=NULL;
@ -571,7 +571,7 @@ void MySQL_Logger::audit_open_log_unlocked() {
audit.logfile->open(filen , std::ios::out | std::ios::binary);
proxy_info("Starting new audit log file %s\n", filen);
}
catch (std::ofstream::failure e) {
catch (const std::ofstream::failure&) {
proxy_error("Error creating new audit log file %s\n", filen);
delete audit.logfile;
audit.logfile=NULL;

@ -19,6 +19,7 @@
#include "MySQL_Protocol.h"
#include "SQLite3_Server.h"
#include "MySQL_Variables.h"
#include "ProxySQL_Cluster.hpp"
#include "libinjection.h"

@ -87,7 +87,7 @@ void * ProxySQL_Cluster_Monitor_thread(void *args) {
GloProxyCluster->get_credentials(&username, &password);
if (strlen(username)) { // do not monitor if the username is empty
unsigned int timeout = 1;
unsigned int timeout_long = 60;
// unsigned int timeout_long = 60;
if (conn == NULL) {
conn = mysql_init(NULL);
if (conn==NULL) {
@ -906,7 +906,7 @@ void ProxySQL_Cluster::pull_mysql_query_rules_from_peer(const string& expected_c
GloProxyCluster->get_credentials(&username, &password);
if (strlen(username)) { // do not monitor if the username is empty
unsigned int timeout = 1;
unsigned int timeout_long = 60;
// unsigned int timeout_long = 60;
mysql_options(conn, MYSQL_OPT_CONNECT_TIMEOUT, &timeout);
//mysql_options(conn, MYSQL_OPT_READ_TIMEOUT, &timeout_long);
//mysql_options(conn, MYSQL_OPT_WRITE_TIMEOUT, &timeout);
@ -1177,7 +1177,7 @@ void ProxySQL_Cluster::pull_mysql_users_from_peer(const string& expected_checksu
GloProxyCluster->get_credentials(&username, &password);
if (strlen(username)) { // do not monitor if the username is empty
unsigned int timeout = 1;
unsigned int timeout_long = 60;
// unsigned int timeout_long = 60;
mysql_options(conn, MYSQL_OPT_CONNECT_TIMEOUT, &timeout);
//mysql_options(conn, MYSQL_OPT_READ_TIMEOUT, &timeout_long);
//mysql_options(conn, MYSQL_OPT_WRITE_TIMEOUT, &timeout);
@ -1498,7 +1498,7 @@ void ProxySQL_Cluster::pull_mysql_servers_from_peer(const std::string& checksum,
GloProxyCluster->get_credentials(&username, &password);
if (strlen(username)) { // do not monitor if the username is empty
unsigned int timeout = 1;
unsigned int timeout_long = 60;
// unsigned int timeout_long = 60;
mysql_options(conn, MYSQL_OPT_CONNECT_TIMEOUT, &timeout);
//mysql_options(conn, MYSQL_OPT_READ_TIMEOUT, &timeout_long);
//mysql_options(conn, MYSQL_OPT_WRITE_TIMEOUT, &timeout);
@ -1868,7 +1868,7 @@ void ProxySQL_Cluster::pull_global_variables_from_peer(const string& var_type, c
GloProxyCluster->get_credentials(&username, &password);
if (strlen(username)) { // do not monitor if the username is empty
unsigned int timeout = 1;
unsigned int timeout_long = 60;
// unsigned int timeout_long = 60;
mysql_options(conn, MYSQL_OPT_CONNECT_TIMEOUT, &timeout);
//mysql_options(conn, MYSQL_OPT_READ_TIMEOUT, &timeout_long);
//mysql_options(conn, MYSQL_OPT_WRITE_TIMEOUT, &timeout);
@ -2020,7 +2020,7 @@ void ProxySQL_Cluster::pull_proxysql_servers_from_peer(const std::string& expect
GloProxyCluster->get_credentials(&username, &password);
if (strlen(username)) { // do not monitor if the username is empty
unsigned int timeout = 1;
unsigned int timeout_long = 60;
// unsigned int timeout_long = 60;
mysql_options(conn, MYSQL_OPT_CONNECT_TIMEOUT, &timeout);
//mysql_options(conn, MYSQL_OPT_READ_TIMEOUT, &timeout_long);
//mysql_options(conn, MYSQL_OPT_WRITE_TIMEOUT, &timeout);

@ -118,7 +118,7 @@ private:
}
std::string script;
int interval_ms;
int interval_ms = 1;
auto result=find_script(req, script, interval_ms);
// result == nullpts means that script was found and we can execute it. continue.
@ -290,19 +290,25 @@ public:
input_params.push_back({arg.first, arg.second});
}
const char* req_path { req.get_path().c_str() };
const string s_params { input_params.dump() };
#ifdef DEBUG
const char* req_path { req.get_path().c_str() };
const char* p_params { s_params.c_str() };
proxy_debug(PROXY_DEBUG_RESTAPI, 1, "Processing GET - req: '%s', params: `%s`\n", req_path, p_params);
#endif
return process_request(req, s_params);
}
const std::shared_ptr<http_response> render_POST(const http_request& req) {
std::string params=req.get_content();
#ifdef DEBUG
const char* req_path { req.get_path().c_str() };
const char* p_params { params.c_str() };
proxy_debug(PROXY_DEBUG_RESTAPI, 1, "Processing POST - req: '%s', params: `%s`\n", req_path, p_params);
#endif
return process_request(req, params);
}

Loading…
Cancel
Save