From db03ba24e677eef766b868b96ec09ff7a48ed062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Mon, 6 May 2019 01:12:30 +1000 Subject: [PATCH] Minor improvement on JSON outpu for better search --- lib/MySQL_Session.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 9d4298407c..b87fc48f81 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -733,10 +733,11 @@ void MySQL_Session::generate_proxysql_internal_session_json(json &j) { j["conn"]["status"]["compression"] = client_myds->myconn->get_status_compression(); j["conn"]["status"]["transaction"] = client_myds->myconn->get_status_transaction(); j["conn"]["ps"]["client_stmt_to_global_ids"] = client_myds->myconn->local_stmts->client_stmt_to_global_ids; - for (unsigned int i=0; ilen; i++) { + for (unsigned int k=0; klen; k++) { MySQL_Backend *_mybe = NULL; - _mybe=(MySQL_Backend *)mybes->index(i); - j["backends"][i]["hostgroup_id"] = _mybe->hostgroup_id; + _mybe=(MySQL_Backend *)mybes->index(k); + unsigned int i = _mybe->hostgroup_id; + j["backends"][i]["hostgroup_id"] = i; if (_mybe->server_myds) { MySQL_Data_Stream *_myds=_mybe->server_myds; j["backends"][i]["stream"]["questions"] = _myds->statuses.questions;