From fe01fb635d67cd7d91bf89b4982d48c5622bda5a Mon Sep 17 00:00:00 2001 From: kailixu Date: Fri, 8 Dec 2023 18:07:17 +0800 Subject: [PATCH] feat: support uniq grant --- include/common/tgrant.h | 4 +--- source/dnode/mgmt/mgmt_dnode/src/dmHandle.c | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/common/tgrant.h b/include/common/tgrant.h index ac1b8cdf9c..52f81e5b80 100644 --- a/include/common/tgrant.h +++ b/include/common/tgrant.h @@ -22,9 +22,7 @@ extern "C" { #include "os.h" #include "taoserror.h" -#ifdef GRANTS_CFG -#include "tgrantCfg.h" -#endif +#include "tdef.h" #ifndef GRANTS_COL_MAX_LEN #define GRANTS_COL_MAX_LEN 196 diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c index 1b3de80610..8c4e8b275e 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c @@ -419,8 +419,9 @@ int32_t dmProcessGetMachine(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) { return -1; } char *machineId = grantGetMachineId(); - if (machineId && (strlen(machineId) == TSDB_MACHINE_ID_LEN)) { + if (machineId) { memcpy(pRsp, machineId, TSDB_MACHINE_ID_LEN); + taosMemoryFreeClear(machineId); } else { terrno = TSDB_CODE_INVALID_DATA_FMT; rpcFreeCont(pRsp);