feat: sql command 'show consumers' and 'show subscriptions'
This commit is contained in:
parent
0b9eb79bf7
commit
bcf477d33f
|
@ -897,7 +897,7 @@ STableCfg* tableCfgDup(STableCfg* pCfg) {
|
|||
if (pNew->pFuncs) {
|
||||
pNew->pFuncs = taosArrayDup(pNew->pFuncs);
|
||||
}
|
||||
|
||||
|
||||
int32_t schemaSize = (pCfg->numOfColumns + pCfg->numOfTags) * sizeof(SSchema);
|
||||
|
||||
SSchema* pSchema = taosMemoryMalloc(schemaSize);
|
||||
|
@ -912,7 +912,7 @@ int32_t getTableCfgFromCache(SParseMetaCache* pMetaCache, const SName* pName, ST
|
|||
char fullName[TSDB_TABLE_FNAME_LEN];
|
||||
tNameExtractFullName(pName, fullName);
|
||||
STableCfg* pCfg = NULL;
|
||||
int32_t code = getMetaDataFromHash(fullName, strlen(fullName), pMetaCache->pTableCfg, (void**)&pCfg);
|
||||
int32_t code = getMetaDataFromHash(fullName, strlen(fullName), pMetaCache->pTableCfg, (void**)&pCfg);
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
*pOutput = tableCfgDup(pCfg);
|
||||
if (NULL == *pOutput) {
|
||||
|
@ -929,10 +929,10 @@ int32_t reserveDnodeRequiredInCache(SParseMetaCache* pMetaCache) {
|
|||
|
||||
int32_t getDnodeListFromCache(SParseMetaCache* pMetaCache, SArray** pDnodes) {
|
||||
SMetaRes* pRes = taosArrayGet(pMetaCache->pDnodes, 0);
|
||||
if (pRes->code) {
|
||||
if (TSDB_CODE_SUCCESS != pRes->code) {
|
||||
return pRes->code;
|
||||
}
|
||||
|
||||
|
||||
*pDnodes = taosArrayDup((SArray*)pRes->pRes);
|
||||
if (NULL == *pDnodes) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
|
|
|
@ -166,13 +166,10 @@ class MockCatalogServiceImpl {
|
|||
}
|
||||
|
||||
int32_t catalogGetDnodeList(SArray** pDnodes) const {
|
||||
SMetaRes res = {0};
|
||||
res.pRes = taosArrayInit(dnode_.size(), sizeof(SEpSet));
|
||||
*pDnodes = taosArrayInit(dnode_.size(), sizeof(SEpSet));
|
||||
for (const auto& dnode : dnode_) {
|
||||
taosArrayPush((SArray*)res.pRes, &dnode.second);
|
||||
taosArrayPush(*pDnodes, &dnode.second);
|
||||
}
|
||||
*pDnodes = taosArrayInit(1, sizeof(SMetaRes));
|
||||
taosArrayPush(*pDnodes, &res);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -200,7 +197,7 @@ class MockCatalogServiceImpl {
|
|||
code = getAllTableIndex(pCatalogReq->pTableIndex, &pMetaData->pTableIndex);
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS == code && pCatalogReq->dNodeRequired) {
|
||||
code = catalogGetDnodeList(&pMetaData->pDnodeList);
|
||||
code = getAllDnodeList(&pMetaData->pDnodeList);
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
code = getAllTableCfg(pCatalogReq->pTableCfg, &pMetaData->pTableCfg);
|
||||
|
@ -565,6 +562,13 @@ class MockCatalogServiceImpl {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t getAllDnodeList(SArray** pDnodes) const {
|
||||
SMetaRes res = {0};
|
||||
*pDnodes = taosArrayInit(1, sizeof(SMetaRes));
|
||||
taosArrayPush(*pDnodes, &res);
|
||||
return catalogGetDnodeList((SArray**)&res.pRes);
|
||||
}
|
||||
|
||||
uint64_t id_;
|
||||
std::unique_ptr<TableBuilder> builder_;
|
||||
DbMetaCache meta_;
|
||||
|
|
Loading…
Reference in New Issue