Merge pull request #11064 from taosdata/feature/shm
TD-14351 incorrect ntables value in show databases results
This commit is contained in:
commit
c1a5775db3
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue