feat: show create table
This commit is contained in:
parent
a98601b11d
commit
4bbec6eeef
|
@ -261,6 +261,11 @@ int32_t __catalogGetDnodeList(SCatalog* pCatalog, SRequestConnInfo* pConn, SArra
|
||||||
return g_mockCatalogService->catalogGetDnodeList(pDnodeList);
|
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() {
|
void initMetaDataEnv() {
|
||||||
g_mockCatalogService.reset(new MockCatalogService());
|
g_mockCatalogService.reset(new MockCatalogService());
|
||||||
|
|
||||||
|
@ -279,6 +284,7 @@ void initMetaDataEnv() {
|
||||||
stub.set(catalogRemoveTableMeta, __catalogRemoveTableMeta);
|
stub.set(catalogRemoveTableMeta, __catalogRemoveTableMeta);
|
||||||
stub.set(catalogGetTableIndex, __catalogGetTableIndex);
|
stub.set(catalogGetTableIndex, __catalogGetTableIndex);
|
||||||
stub.set(catalogGetDnodeList, __catalogGetDnodeList);
|
stub.set(catalogGetDnodeList, __catalogGetDnodeList);
|
||||||
|
stub.set(catalogRefreshGetTableCfg, __catalogRefreshGetTableCfg);
|
||||||
// {
|
// {
|
||||||
// AddrAny any("libcatalog.so");
|
// AddrAny any("libcatalog.so");
|
||||||
// std::map<std::string,void*> result;
|
// std::map<std::string,void*> result;
|
||||||
|
|
|
@ -199,6 +199,9 @@ class MockCatalogServiceImpl {
|
||||||
if (TSDB_CODE_SUCCESS == code && pCatalogReq->dNodeRequired) {
|
if (TSDB_CODE_SUCCESS == code && pCatalogReq->dNodeRequired) {
|
||||||
code = catalogGetDnodeList(&pMetaData->pDnodeList);
|
code = catalogGetDnodeList(&pMetaData->pDnodeList);
|
||||||
}
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = getAllTableCfg(pCatalogReq->pTableCfg, &pMetaData->pTableCfg);
|
||||||
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -545,6 +548,20 @@ class MockCatalogServiceImpl {
|
||||||
return TSDB_CODE_SUCCESS;
|
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_;
|
uint64_t id_;
|
||||||
std::unique_ptr<TableBuilder> builder_;
|
std::unique_ptr<TableBuilder> builder_;
|
||||||
DbMetaCache meta_;
|
DbMetaCache meta_;
|
||||||
|
|
Loading…
Reference in New Issue