From fb12d84c5868012abaf9af1d22ae1192da3c474f Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Thu, 23 Dec 2021 16:34:21 +0800 Subject: [PATCH] [TD-11999](other): remove double quotes from restful_info table using underscore instead --- src/plugins/monitor/src/monMain.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/monitor/src/monMain.c b/src/plugins/monitor/src/monMain.c index 6cccf6b418..6c5419a365 100644 --- a/src/plugins/monitor/src/monMain.c +++ b/src/plugins/monitor/src/monMain.c @@ -460,14 +460,18 @@ static void monBuildMonitorSql(char *sql, int32_t cmd) { ", expire_time int, timeseries_used int, timeseries_total int)", tsMonitorDbName); } else if (cmd == MON_CMD_CREATE_MT_RESTFUL) { + int usedLen = 0, len = 0; int pos = snprintf(sql, SQL_LENGTH, "create table if not exists %s.restful_info(ts timestamp", tsMonitorDbName); + usedLen += pos; for (int i = 0; i < tListLen(monHttpStatusTable); ++i) { - pos += snprintf(sql + pos, SQL_LENGTH, ", %s_%d int", + len = snprintf(sql + pos, SQL_LENGTH - usedLen, ", %s_%d int", monHttpStatusTable[i].name, monHttpStatusTable[i].code); + usedLen += len; + pos += len; } - snprintf(sql + pos, SQL_LENGTH, + snprintf(sql + pos, SQL_LENGTH - usedLen, ") tags (dnode_id int, dnode_ep binary(%d))", TSDB_EP_LEN); } else if (cmd == MON_CMD_CREATE_TB_RESTFUL) { -- GitLab