diff --git a/include/MySQL_Session.h b/include/MySQL_Session.h index 4efc00cf9..33fe271d8 100644 --- a/include/MySQL_Session.h +++ b/include/MySQL_Session.h @@ -584,6 +584,9 @@ class MySQL_Session: public Base_Session friend class Base_Session; @@ -611,6 +614,8 @@ public: KillArgs(char *u, char *p, char *h, unsigned int P, unsigned int _hid, unsigned long i, int kt, int _use_ssl, MySQL_Thread* _mt, char *ip); ~KillArgs(); const char* get_host_address() const; + KillArgs(const KillArgs&) = delete; + KillArgs& operator=(const KillArgs&) = delete; private: char* ip_addr; diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index 376d1ef56..83c584409 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -1877,7 +1877,7 @@ void MySQL_HostGroups_Manager::generate_mysql_servers_table(int *_onlyhg) { st=(char *)"SHUNNED"; break; } - fprintf(stderr,"HID: %d , address: %s , port: %d , gtid_port: %d , weight: %ld , status: %s , max_connections: %ld , max_replication_lag: %u , use_ssl: %u , max_latency_ms: %u , comment: %s\n", mysrvc->myhgc->hid, mysrvc->address, mysrvc->port, mysrvc->gtid_port, mysrvc->weight, st, mysrvc->max_connections, mysrvc->max_replication_lag, mysrvc->use_ssl, mysrvc->max_latency_us*1000, mysrvc->comment); + fprintf(stderr,"HID: %u , address: %s , port: %d , gtid_port: %d , weight: %ld , status: %s , max_connections: %ld , max_replication_lag: %u , use_ssl: %d , max_latency_ms: %u , comment: %s\n", mysrvc->myhgc->hid, mysrvc->address, mysrvc->port, mysrvc->gtid_port, mysrvc->weight, st, mysrvc->max_connections, mysrvc->max_replication_lag, mysrvc->use_ssl, mysrvc->max_latency_us*1000, mysrvc->comment); } lst->add(mysrvc); if (lst->len==32) { @@ -3578,8 +3578,9 @@ void MySQL_HostGroups_Manager::read_only_action_v2(const std::listsecond.get(); - if (!host_server_mapping) - assert(0); + if (!host_server_mapping) { + continue; + } const std::vector& writer_map = host_server_mapping->get(HostGroup_Server_Mapping::Type::WRITER); diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index a2ecb18c8..38883df1e 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -9572,7 +9572,7 @@ char* MySQL_Session::get_current_query(int max_length) { if (query_len > 0) { res = (char *) malloc(query_len + 1); - if (trunc_query) { + if (trunc_query && query_len > 3) { // for truncated queries, add three dots at the end memcpy(res, query_ptr, query_len - 3); memcpy(res + (query_len - 3), "...", 3);