diff --git a/src/client/src/tscFunctionImpl.c b/src/client/src/tscFunctionImpl.c index 907002d158f4db5d28eb7d044e43b5bb8f9e17c8..9399d188e49aced0d3532fee3ef9a720e4672f61 100644 --- a/src/client/src/tscFunctionImpl.c +++ b/src/client/src/tscFunctionImpl.c @@ -4566,7 +4566,7 @@ static void rate_function_f(SQLFunctionCtx *pCtx, int32_t index) { pRateInfo->lastValue = v; pRateInfo->lastKey = primaryKey[index]; - pTrace("====%p rate_function_f() index:%d lastValue:%f lastKey:%" PRId64 " CorrectionValue:%f", pCtx, index, pRateInfo->lastValue, pRateInfo->lastKey, pRateInfo->CorrectionValue); + pTrace("%p rate_function_f() index:%d lastValue:%f lastKey:%" PRId64 " CorrectionValue:%f", pCtx, index, pRateInfo->lastValue, pRateInfo->lastKey, pRateInfo->CorrectionValue); SET_VAL(pCtx, 1, 1); @@ -4774,7 +4774,7 @@ static void irate_function_f(SQLFunctionCtx *pCtx, int32_t index) { pRateInfo->lastValue = v; pRateInfo->lastKey = primaryKey[index]; - pTrace("====%p irate_function_f() index:%d lastValue:%f lastKey:%" PRId64 " firstValue:%f firstKey:%" PRId64, pCtx, index, pRateInfo->lastValue, pRateInfo->lastKey, pRateInfo->firstValue , pRateInfo->firstKey); + pTrace("%p irate_function_f() index:%d lastValue:%f lastKey:%" PRId64 " firstValue:%f firstKey:%" PRId64, pCtx, index, pRateInfo->lastValue, pRateInfo->lastKey, pRateInfo->firstValue , pRateInfo->firstKey); SET_VAL(pCtx, 1, 1); diff --git a/src/system/detail/src/mgmtDb.c b/src/system/detail/src/mgmtDb.c index b935b68425e053a1a4ed466d65c8c790c701f384..3317435d010cf94e34c15b283c75dab7d3715b3e 100644 --- a/src/system/detail/src/mgmtDb.c +++ b/src/system/detail/src/mgmtDb.c @@ -663,7 +663,22 @@ int mgmtRetrieveDbs(SShowObj *pShow, char *data, int rows, SConnObj *pConn) { SDbObj *pDb = NULL; char * pWrite; int cols = 0; - + + void* pNext = pShow->pNode; + while (numOfRows < rows) { + pDb = (SDbObj *)pNext; + if (pDb == NULL) break; + pNext = (void *)pDb->next; + if (mgmtCheckIsMonitorDB(pDb->name, tsMonitorDbName)) { + if (strcmp(pConn->pUser->user, "root") != 0 && strcmp(pConn->pUser->user, "_root") != 0 && strcmp(pConn->pUser->user, "monitor") != 0 ) { + rows--; + break; + } + } + numOfRows++; + } + + numOfRows = 0; while (numOfRows < rows) { pDb = (SDbObj *)pShow->pNode; if (pDb == NULL) break;