feat: support uniq grant

This commit is contained in:
kailixu 2023-12-08 18:07:17 +08:00
parent 2309e577c6
commit fe01fb635d
2 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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);