Merge pull request #3143 from taosdata/hotfix/os
TD-1186 show database error while in different account
This commit is contained in:
commit
69211ec363
|
@ -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__
|
||||||
|
|
|
@ -547,12 +547,12 @@ int taosSystem(const char *cmd) {
|
||||||
int res;
|
int res;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
if (cmd == NULL) {
|
if (cmd == NULL) {
|
||||||
uError("taosSystem cmd is NULL!\n");
|
uError("taosSystem cmd is NULL!");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((fp = popen(cmd, "r")) == NULL) {
|
if ((fp = popen(cmd, "r")) == NULL) {
|
||||||
uError("popen cmd:%s error: %s/n", cmd, strerror(errno));
|
uError("popen cmd:%s error: %s", cmd, strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
while (fgets(buf, sizeof(buf), fp)) {
|
while (fgets(buf, sizeof(buf), fp)) {
|
||||||
|
@ -560,9 +560,9 @@ int taosSystem(const char *cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((res = pclose(fp)) == -1) {
|
if ((res = pclose(fp)) == -1) {
|
||||||
uError("close popen file pointer fp error!\n");
|
uError("close popen file pointer fp error!");
|
||||||
} else {
|
} else {
|
||||||
uDebug("popen res is :%d\n", res);
|
uDebug("popen res is :%d", res);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in New Issue