diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 56bb93faa4..85b55611dc 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -1233,21 +1233,21 @@ int32_t tDeserializeSGetUserAuthRspImpl(SDecoder *pDecoder, SGetUserAuthRsp *pRs for (int32_t i = 0; i < numOfCreatedDbs; ++i) { char db[TSDB_DB_FNAME_LEN] = {0}; if (tDecodeCStrTo(pDecoder, db) < 0) return -1; - int32_t len = strlen(db) + 1; + int32_t len = strlen(db); taosHashPut(pRsp->createdDbs, db, len, db, len); } for (int32_t i = 0; i < numOfReadDbs; ++i) { char db[TSDB_DB_FNAME_LEN] = {0}; if (tDecodeCStrTo(pDecoder, db) < 0) return -1; - int32_t len = strlen(db) + 1; + int32_t len = strlen(db); taosHashPut(pRsp->readDbs, db, len, db, len); } for (int32_t i = 0; i < numOfWriteDbs; ++i) { char db[TSDB_DB_FNAME_LEN] = {0}; if (tDecodeCStrTo(pDecoder, db) < 0) return -1; - int32_t len = strlen(db) + 1; + int32_t len = strlen(db); taosHashPut(pRsp->writeDbs, db, len, db, len); } diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index e4437f1a93..45995173e6 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -4206,7 +4206,7 @@ static void destroyOperatorInfo(SOperatorInfo* pOperator) { } } - taosMemoryFree(pOperator->pExpr); + taosMemoryFreeClear(pOperator->pExpr); taosMemoryFreeClear(pOperator->info); taosMemoryFreeClear(pOperator); } @@ -4391,6 +4391,9 @@ void destroySFillOperatorInfo(void* param, int32_t numOfOutput) { } static void destroyProjectOperatorInfo(void* param, int32_t numOfOutput) { + if (NULL == param) { + return; + } SProjectOperatorInfo* pInfo = (SProjectOperatorInfo*)param; doDestroyBasicInfo(&pInfo->binfo, numOfOutput); cleanupAggSup(&pInfo->aggSup); @@ -5328,7 +5331,6 @@ void doDestroyTask(SExecTaskInfo* pTaskInfo) { // taosArrayDestroy(pTaskInfo->summary.queryProfEvents); // taosHashCleanup(pTaskInfo->summary.operatorProfResults); - destroyOperatorInfo(pTaskInfo->pRoot); taosMemoryFreeClear(pTaskInfo->sql); taosMemoryFreeClear(pTaskInfo->id.str); taosMemoryFreeClear(pTaskInfo); diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 63ef3fc9a1..c8a3a89e40 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -3146,7 +3146,7 @@ static int32_t translateGrant(STranslateContext* pCxt, SGrantStmt* pStmt) { req.alterType = TSDB_ALTER_USER_ADD_WRITE_DB; } strcpy(req.user, pStmt->userName); - strcpy(req.dbname, pStmt->dbName); + sprintf(req.dbname, "%d.%s", pCxt->pParseCxt->acctId, pStmt->dbName); return buildCmdMsg(pCxt, TDMT_MND_ALTER_USER, (FSerializeFunc)tSerializeSAlterUserReq, &req); }