未验证 提交 c1a5775d 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #11064 from taosdata/feature/shm

TD-14351 incorrect ntables value in show databases results
......@@ -1521,6 +1521,14 @@ static void setInformationSchemaDbCfg(SDbObj *pDbObj) {
pDbObj->cfg.precision = TSDB_TIME_PRECISION_MILLI;
}
static bool mndGetTablesOfDbFp(SMnode *pMnode, void *pObj, void *p1, void *p2, void *p3) {
SVgObj *pVgroup = pObj;
int32_t *numOfTables = p1;
*numOfTables += pVgroup->numOfTables;
return true;
}
static int32_t mndRetrieveDbs(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rowsCapacity) {
SMnode *pMnode = pReq->pNode;
SSdb *pSdb = pMnode->pSdb;
......@@ -1533,7 +1541,10 @@ static int32_t mndRetrieveDbs(SNodeMsg *pReq, SShowObj *pShow, char *data, int32
break;
}
dumpDbInfoToPayload(data, pDb, pShow, numOfRows, rowsCapacity, 0);
int32_t numOfTables = 0;
sdbTraverse(pSdb, SDB_VGROUP, mndGetTablesOfDbFp, &numOfTables, NULL, NULL);
dumpDbInfoToPayload(data, pDb, pShow, numOfRows, rowsCapacity, numOfTables);
numOfRows++;
sdbRelease(pSdb, pDb);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册