From 1c16959aac91545f9a74114d222f1b54347da62c Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Sun, 14 Nov 2021 16:04:04 +0800 Subject: [PATCH] add log --- src/plugins/monitor/src/monMain.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/monitor/src/monMain.c b/src/plugins/monitor/src/monMain.c index 05b5652cdb..fcfe9d03b6 100644 --- a/src/plugins/monitor/src/monMain.c +++ b/src/plugins/monitor/src/monMain.c @@ -834,6 +834,10 @@ static int32_t monBuildConnsTotalSql(char *sql) { static int32_t monBuildDnodeUptimeSql(char *sql) { int64_t dnodeUptime = 0; TAOS_RES *result = taos_query(tsMonitor.conn, "show dnodes"); + int32_t code = taos_errno(result); + if (code != TSDB_CODE_SUCCESS) { + monError("failed to execute cmd: show dnodes, reason:%s", tstrerror(code)); + } TAOS_ROW row; int32_t num_fields = taos_num_fields(result); @@ -932,6 +936,10 @@ static int32_t monBuildDnodeVnodesSql(char *sql) { static int32_t monBuildDnodeMnodeSql(char *sql) { bool has_mnode = false, has_mnode_row; TAOS_RES *result = taos_query(tsMonitor.conn, "show mnodes"); + int32_t code = taos_errno(result); + if (code != TSDB_CODE_SUCCESS) { + monError("failed to execute cmd: show mnodes, reason:%s", tstrerror(code)); + } TAOS_ROW row; int32_t num_fields = taos_num_fields(result); -- GitLab