提交 9bcc0cd3 编写于 作者: X Xiaoyu Wang 提交者: cpwu

feat: sql command 'show consumers' and 'show subscriptions'

上级 e342240e
......@@ -929,7 +929,7 @@ 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;
}
......
......@@ -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_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册