From cbd3228f2d761916fd383e3eb770c8042c17afae Mon Sep 17 00:00:00 2001 From: slguan Date: Wed, 11 Dec 2019 22:08:17 +0800 Subject: [PATCH] remove some warnings --- src/client/src/sql.c | 2 ++ src/client/src/tscServer.c | 2 +- src/modules/monitor/src/monitorSystem.c | 38 +++++++++++++++---------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/client/src/sql.c b/src/client/src/sql.c index e0d96623e2..ffcdc4bc0e 100644 --- a/src/client/src/sql.c +++ b/src/client/src/sql.c @@ -22,6 +22,8 @@ ** The following is the concatenation of all %include directives from the ** input grammar file: */ +#pragma GCC diagnostic ignored "-Wunused-variable" + #include /************ Begin %include sections from the grammar ************************/ diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 40399d85b7..2b0b3c10da 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -211,7 +211,6 @@ void tscGetConnToMgmt(SSqlObj *pSql, uint8_t *pCode) { } void tscGetConnToVnode(SSqlObj *pSql, uint8_t *pCode) { - char ipstr[40] = {0}; SVPeerDesc *pVPeersDesc = NULL; static int vidIndex = 0; STscObj * pTscObj = pSql->pTscObj; @@ -244,6 +243,7 @@ void tscGetConnToVnode(SSqlObj *pSql, uint8_t *pCode) { while (pSql->retry < pSql->maxRetry) { (pSql->retry)++; #ifdef CLUSTER + char ipstr[40] = {0}; if (pVPeersDesc[pSql->index].ip == 0) { (pSql->index) = (pSql->index + 1) % TSDB_VNODES_SUPPORT; continue; diff --git a/src/modules/monitor/src/monitorSystem.c b/src/modules/monitor/src/monitorSystem.c index f89f259688..b4b84b6d29 100644 --- a/src/modules/monitor/src/monitorSystem.c +++ b/src/modules/monitor/src/monitorSystem.c @@ -403,21 +403,29 @@ void monitorSaveAcctLog(char *acctId, int64_t currentPointsPerSecond, int64_t ma char sql[1024] = {0}; sprintf(sql, "insert into %s.acct_%s using %s.acct tags('%s') values(now" - ", %" PRId64, "%" PRId64 - ", %" PRId64, "%" PRId64 - ", %" PRId64, "%" PRId64 - ", %" PRId64, "%" PRId64 - ", %" PRId64, "%" PRId64 - ", %" PRId64, "%" PRId64 - ", %" PRId64, "%" PRId64 - ", %" PRId64, "%" PRId64 - ", %" PRId64, "%" PRId64 - ", %" PRId64, "%" PRId64 + ", %" PRId64 ", %" PRId64 + ", %" PRId64 ", %" PRId64 + ", %" PRId64 ", %" PRId64 + ", %" PRId64 ", %" PRId64 + ", %" PRId64 ", %" PRId64 + ", %" PRId64 ", %" PRId64 + ", %" PRId64 ", %" PRId64 + ", %" PRId64 ", %" PRId64 + ", %" PRId64 ", %" PRId64 + ", %" PRId64 ", %" PRId64 ", %d)", - tsMonitorDbName, acctId, tsMonitorDbName, acctId, currentPointsPerSecond, maxPointsPerSecond, totalTimeSeries, - maxTimeSeries, totalStorage, maxStorage, totalQueryTime, maxQueryTime, totalInbound, maxInbound, - totalOutbound, maxOutbound, totalDbs, maxDbs, totalUsers, maxUsers, totalStreams, maxStreams, totalConns, - maxConns, accessState); + tsMonitorDbName, acctId, tsMonitorDbName, acctId, + currentPointsPerSecond, maxPointsPerSecond, + totalTimeSeries, maxTimeSeries, + totalStorage, maxStorage, + totalQueryTime, maxQueryTime, + totalInbound, maxInbound, + totalOutbound, maxOutbound, + totalDbs, maxDbs, + totalUsers, maxUsers, + totalStreams, maxStreams, + totalConns, maxConns, + accessState); monitorTrace("monitor:%p, save account info, sql %s", monitor->conn, sql); taos_query_a(monitor->conn, sql, dnodeMontiorInsertAcctCallback, "account"); @@ -432,7 +440,7 @@ void monitorSaveLog(int level, const char *const format, ...) { return; } - int len = snprintf(sql, (size_t)max_length, "import into %s.log values(%\" PRId64 \", %d,'", tsMonitorDbName, + int len = snprintf(sql, (size_t)max_length, "import into %s.log values(%" PRId64 ", %d,'", tsMonitorDbName, taosGetTimestampUs(), level); va_start(argpointer, format); -- GitLab