未验证 提交 f031b308 编写于 作者: H haojun Liao 提交者: GitHub

Merge pull request #1295 from taosdata/feature/lihui

Feature/lihui
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册