提交 4bbec6ee 编写于 作者: D dapan1121

feat: show create table

上级 a98601b1
......@@ -261,6 +261,11 @@ int32_t __catalogGetDnodeList(SCatalog* pCatalog, SRequestConnInfo* pConn, SArra
return g_mockCatalogService->catalogGetDnodeList(pDnodeList);
}
int32_t __catalogRefreshGetTableCfg(SCatalog* pCtg, SRequestConnInfo *pConn, const SName* pTableName, STableCfg** pCfg) {
*pCfg = (STableCfg*)taosMemoryCalloc(1, sizeof(STableCfg));
return 0;
}
void initMetaDataEnv() {
g_mockCatalogService.reset(new MockCatalogService());
......@@ -279,6 +284,7 @@ void initMetaDataEnv() {
stub.set(catalogRemoveTableMeta, __catalogRemoveTableMeta);
stub.set(catalogGetTableIndex, __catalogGetTableIndex);
stub.set(catalogGetDnodeList, __catalogGetDnodeList);
stub.set(catalogRefreshGetTableCfg, __catalogRefreshGetTableCfg);
// {
// AddrAny any("libcatalog.so");
// std::map<std::string,void*> result;
......
......@@ -199,6 +199,9 @@ class MockCatalogServiceImpl {
if (TSDB_CODE_SUCCESS == code && pCatalogReq->dNodeRequired) {
code = catalogGetDnodeList(&pMetaData->pDnodeList);
}
if (TSDB_CODE_SUCCESS == code) {
code = getAllTableCfg(pCatalogReq->pTableCfg, &pMetaData->pTableCfg);
}
return code;
}
......@@ -545,6 +548,20 @@ class MockCatalogServiceImpl {
return TSDB_CODE_SUCCESS;
}
int32_t getAllTableCfg(SArray* pTableCfgReq, SArray** pTableCfgData) const {
if (NULL != pTableCfgReq) {
int32_t ntables = taosArrayGetSize(pTableCfgReq);
*pTableCfgData = taosArrayInit(ntables, sizeof(SMetaRes));
for (int32_t i = 0; i < ntables; ++i) {
SMetaRes res = {0};
res.pRes = taosMemoryCalloc(1, sizeof(STableCfg));
res.code = TSDB_CODE_SUCCESS;
taosArrayPush(*pTableCfgData, &res);
}
}
return TSDB_CODE_SUCCESS;
}
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.
先完成此消息的编辑!
想要评论请 注册