From 2340bbd7fa7a8b4010508cecf9f1a0278ea9c041 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 28 Dec 2021 17:25:44 +0800 Subject: [PATCH] catalog --- source/libs/catalog/inc/catalogInt.h | 1 - source/libs/catalog/src/catalog.c | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/source/libs/catalog/inc/catalogInt.h b/source/libs/catalog/inc/catalogInt.h index 548b25efc8..d2799cbe65 100644 --- a/source/libs/catalog/inc/catalogInt.h +++ b/source/libs/catalog/inc/catalogInt.h @@ -46,7 +46,6 @@ typedef struct STableMetaCache { } STableMetaCache; typedef struct SCatalog { - SVgroupListCache vgroupCache; SDBVgroupCache dbCache; STableMetaCache tableCache; } SCatalog; diff --git a/source/libs/catalog/src/catalog.c b/source/libs/catalog/src/catalog.c index fda3cddf70..49f4fdbfb7 100644 --- a/source/libs/catalog/src/catalog.c +++ b/source/libs/catalog/src/catalog.c @@ -415,16 +415,16 @@ int32_t catalogGetHandle(const char* clusterId , struct SCatalog** catalogHandle } size_t clen = strlen(clusterId); - SCatalog *clusterCtg = (SCatalog *)taosHashGet(ctgMgmt.pCluster, clusterId, clen); + SCatalog **ctg = (SCatalog **)taosHashGet(ctgMgmt.pCluster, clusterId, clen); - if (clusterCtg) { - *catalogHandle = clusterCtg; + if (ctg && (*ctg)) { + *catalogHandle = *ctg; return TSDB_CODE_SUCCESS; } - clusterCtg = calloc(1, sizeof(*clusterCtg)); + SCatalog *clusterCtg = calloc(1, sizeof(SCatalog)); 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); } -- GitLab