TD-1186 show database error while in different account

This commit is contained in:
Shengliang Guan 2020-08-19 09:58:54 +00:00
parent a175845887
commit ecb7d9529b
1 changed files with 3 additions and 2 deletions

View File

@ -636,6 +636,7 @@ static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void
while (numOfRows < rows) { while (numOfRows < rows) {
pShow->pIter = mnodeGetNextDb(pShow->pIter, &pDb); pShow->pIter = mnodeGetNextDb(pShow->pIter, &pDb);
if (pDb == NULL) break; if (pDb == NULL) break;
if (pDb->pAcct != pUser->pAcct) continue;
cols = 0; cols = 0;
@ -687,8 +688,8 @@ static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
char tmp[128] = {0}; char tmp[128] = {0};
size_t n = sprintf(tmp, "%d,%d,%d", pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2, pDb->cfg.daysToKeep); sprintf(tmp, "%d,%d,%d", pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2, pDb->cfg.daysToKeep);
STR_WITH_SIZE_TO_VARSTR(pWrite, tmp, n); STR_WITH_SIZE_TO_VARSTR(pWrite, tmp, strlen(tmp));
cols++; cols++;
#ifndef __CLOUD_VERSION__ #ifndef __CLOUD_VERSION__