From 059579f5a2ba2cc31bce38dee0f0d0281d209ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Wed, 1 May 2019 20:54:19 +1000 Subject: [PATCH] Fix some compiler warnings --- lib/MySQL_HostGroups_Manager.cpp | 2 +- lib/MySQL_PreparedStatement.cpp | 4 ++-- lib/MySQL_Protocol.cpp | 4 ++-- lib/MySQL_Session.cpp | 2 +- lib/mysql_data_stream.cpp | 1 - 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index 169a5bbaf..1f8854605 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -2679,7 +2679,7 @@ SQLite3_result * MySQL_HostGroups_Manager::SQL3_Free_Connections() { delete conn; } char buf[1024]; - for (l=0; lConnectionsFree->conns_length(); l++) { + for (l=0; l < (int) mysrvc->ConnectionsFree->conns_length(); l++) { char **pta=(char **)malloc(sizeof(char *)*colnum); MySQL_Connection *conn = mysrvc->ConnectionsFree->index(l); sprintf(buf,"%d", conn->fd); diff --git a/lib/MySQL_PreparedStatement.cpp b/lib/MySQL_PreparedStatement.cpp index 8f913559a..0cdefc087 100644 --- a/lib/MySQL_PreparedStatement.cpp +++ b/lib/MySQL_PreparedStatement.cpp @@ -537,8 +537,8 @@ void MySQL_STMT_Manager_v14::ref_count_client(uint64_t _stmt_id ,int _v, bool lo (uint64_t *)malloc(max_purge * sizeof(uint64_t)); for (std::map::iterator it = map_stmt_id_to_info.begin(); - it != map_stmt_id_to_info.end(); ++it) { - if ( (i == (max_purge - 1)) || (i == (num_client_count_zero - 1)) ) { + it != map_stmt_id_to_info.end(); ++it) { + if ( (i == (max_purge - 1)) || (i == ((int)num_client_count_zero - 1)) ) { break; // nothing left to clean up } MySQL_STMT_Global_info *a = it->second; diff --git a/lib/MySQL_Protocol.cpp b/lib/MySQL_Protocol.cpp index cd3f5cac3..f4257f4a2 100644 --- a/lib/MySQL_Protocol.cpp +++ b/lib/MySQL_Protocol.cpp @@ -1546,7 +1546,7 @@ bool MySQL_Protocol::process_pkt_handshake_response(unsigned char *pkt, unsigned auth_plugin_id = 2; } } -__switch_auth_plugin: +//__switch_auth_plugin: if (auth_plugin_id == 0) { if ((*myds)->switching_auth_stage == 0) { (*myds)->switching_auth_stage = 1; @@ -2279,7 +2279,7 @@ unsigned int MySQL_ResultSet::add_row2(MYSQL_ROWS *row, unsigned char *offset) { } void MySQL_ResultSet::add_eof() { - PtrSize_t pkt; + //PtrSize_t pkt; if (myprot) { unsigned int nTrx=myds->sess->NumActiveTransactions(); uint16_t setStatus = (nTrx ? SERVER_STATUS_IN_TRANS : 0 ); diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 0adfc7e2e..fa7fef780 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -803,7 +803,7 @@ void MySQL_Session::generate_proxysql_internal_session_json(json &j) { } void MySQL_Session::return_proxysql_internal(PtrSize_t *pkt) { - int l = 0; + unsigned int l = 0; l = strlen((char *)"PROXYSQL INTERNAL SESSION"); if (pkt->size==(5+l) && strncasecmp((char *)"PROXYSQL INTERNAL SESSION", (char *)pkt->ptr+5, l)==0) { json j; diff --git a/lib/mysql_data_stream.cpp b/lib/mysql_data_stream.cpp index d755bfa4b..49a6ec7d8 100644 --- a/lib/mysql_data_stream.cpp +++ b/lib/mysql_data_stream.cpp @@ -24,7 +24,6 @@ struct bio_st { CRYPTO_RWLOCK *lock; }; - #define RESULTSET_BUFLEN_DS_16K 16000 #define RESULTSET_BUFLEN_DS_1M 1000*1024