catalog
This commit is contained in:
parent
7ad9a9b510
commit
2340bbd7fa
|
@ -46,7 +46,6 @@ typedef struct STableMetaCache {
|
||||||
} STableMetaCache;
|
} STableMetaCache;
|
||||||
|
|
||||||
typedef struct SCatalog {
|
typedef struct SCatalog {
|
||||||
SVgroupListCache vgroupCache;
|
|
||||||
SDBVgroupCache dbCache;
|
SDBVgroupCache dbCache;
|
||||||
STableMetaCache tableCache;
|
STableMetaCache tableCache;
|
||||||
} SCatalog;
|
} SCatalog;
|
||||||
|
|
|
@ -415,16 +415,16 @@ int32_t catalogGetHandle(const char* clusterId , struct SCatalog** catalogHandle
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t clen = strlen(clusterId);
|
size_t clen = strlen(clusterId);
|
||||||
SCatalog *clusterCtg = (SCatalog *)taosHashGet(ctgMgmt.pCluster, clusterId, clen);
|
SCatalog **ctg = (SCatalog **)taosHashGet(ctgMgmt.pCluster, clusterId, clen);
|
||||||
|
|
||||||
if (clusterCtg) {
|
if (ctg && (*ctg)) {
|
||||||
*catalogHandle = clusterCtg;
|
*catalogHandle = *ctg;
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
clusterCtg = calloc(1, sizeof(*clusterCtg));
|
SCatalog *clusterCtg = calloc(1, sizeof(SCatalog));
|
||||||
if (NULL == clusterCtg) {
|
if (NULL == clusterCtg) {
|
||||||
ctgError("calloc %d failed", (int32_t)sizeof(*clusterCtg));
|
ctgError("calloc %d failed", (int32_t)sizeof(SCatalog));
|
||||||
CTG_ERR_RET(TSDB_CODE_CTG_MEM_ERROR);
|
CTG_ERR_RET(TSDB_CODE_CTG_MEM_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue