From 84a7534256b74ec66ee9d48789c1c40a44cf7f87 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 27 Jan 2022 13:44:54 +0800 Subject: [PATCH] process drop database rsp --- source/client/src/clientMsgHandler.c | 6 +++--- source/libs/catalog/src/catalog.c | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/source/client/src/clientMsgHandler.c b/source/client/src/clientMsgHandler.c index c9b1d07965..24d1c0f03c 100644 --- a/source/client/src/clientMsgHandler.c +++ b/source/client/src/clientMsgHandler.c @@ -299,13 +299,13 @@ int32_t processDropDbRsp(void* param, const SDataBuf* pMsg, int32_t code) { return code; } - SDropDbReq *req = pRequest->body.requestMsg.pData; + SDropDbRsp *rsp = (SDropDbRsp *)pMsg->pData; SDbVgVersion dbVer = {0}; struct SCatalog *pCatalog = NULL; - strncpy(dbVer.dbName, req->db, sizeof(dbVer.dbName)); - dbVer.dbId = 0; //TODO GET DBID FROM RSP + strncpy(dbVer.dbName, rsp->db, sizeof(dbVer.dbName)); + dbVer.dbId = be64toh(rsp->uid); catalogGetHandle(pRequest->pTscObj->pAppInfo->clusterId, &pCatalog); diff --git a/source/libs/catalog/src/catalog.c b/source/libs/catalog/src/catalog.c index f5487f7da8..1b4d711aad 100644 --- a/source/libs/catalog/src/catalog.c +++ b/source/libs/catalog/src/catalog.c @@ -794,17 +794,12 @@ int32_t ctgValidateAndRemoveDbInfo(struct SCatalog* pCatalog, SDbVgVersion* targ CTG_LOCK(CTG_WRITE, &info->lock); - //TODO OPEN IT -#if 0 if (info->dbId != target->dbId) { ctgInfo("db id already updated, db:%s, dbId:%"PRIx64 ", targetId:%"PRIx64, target->dbName, info->dbId, target->dbId); CTG_UNLOCK(CTG_WRITE, &info->lock); taosHashRelease(pCatalog->dbCache.cache, info); return TSDB_CODE_SUCCESS; } -#else - target->dbId = info->dbId; -#endif if (info->vgInfo) { ctgInfo("cleanup db vgInfo, db:%s", target->dbName);