diff --git a/include/common/tmsg.h b/include/common/tmsg.h index e6aaff211b26b2effa2368458e42cc9643db0107..73d5c4fd90e301bcaf12855dc469bc9a0a90bf8d 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -255,8 +255,8 @@ typedef struct { int8_t hashMeta; int64_t uid; union { - char* name; - const char* namec; + char* ename; // used for encode + const char* dname; // used for decode }; int32_t numOfRows; int32_t affectedRows; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 679ec5892dac34f8ce7fbe50df501245d449db8c..8656ee3eb06ca9384f9c53cde3a582753d0385c7 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -4020,7 +4020,7 @@ static int32_t tEncodeSSubmitBlkRsp(SEncoder *pEncoder, const SSubmitBlkRsp *pBl if (tEncodeI8(pEncoder, pBlock->hashMeta) < 0) return -1; if (pBlock->hashMeta) { if (tEncodeI64(pEncoder, pBlock->uid) < 0) return -1; - if (tEncodeCStr(pEncoder, pBlock->name) < 0) return -1; + if (tEncodeCStr(pEncoder, pBlock->ename) < 0) return -1; } if (tEncodeI32v(pEncoder, pBlock->numOfRows) < 0) return -1; if (tEncodeI32v(pEncoder, pBlock->affectedRows) < 0) return -1; @@ -4035,7 +4035,7 @@ static int32_t tDecodeSSubmitBlkRsp(SDecoder *pDecoder, SSubmitBlkRsp *pBlock) { if (tDecodeI8(pDecoder, &pBlock->hashMeta) < 0) return -1; if (pBlock->hashMeta) { if (tDecodeI64(pDecoder, &pBlock->uid) < 0) return -1; - if (tDecodeCStr(pDecoder, &pBlock->namec) < 0) return -1; + if (tDecodeCStr(pDecoder, &pBlock->dname) < 0) return -1; } if (tDecodeI32v(pDecoder, &pBlock->numOfRows) < 0) return -1; if (tDecodeI32v(pDecoder, &pBlock->affectedRows) < 0) return -1; diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 7692b7084dfd33228fc42d87bf6c163ddfb591fe..678c9edbd4b26bf81257c4d61570073bbecdb6d3 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -589,8 +589,8 @@ static int vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq, in } submitBlkRsp.uid = createTbReq.uid; - submitBlkRsp.name = taosMemoryMalloc(strlen(pVnode->config.dbname) + strlen(createTbReq.name) + 2); - sprintf(submitBlkRsp.name, "%s.%s", pVnode->config.dbname, createTbReq.name); + submitBlkRsp.ename = taosMemoryMalloc(strlen(pVnode->config.dbname) + strlen(createTbReq.name) + 2); + sprintf(submitBlkRsp.ename, "%s.%s", pVnode->config.dbname, createTbReq.name); msgIter.uid = createTbReq.uid; if (createTbReq.type == TSDB_CHILD_TABLE) { @@ -621,7 +621,7 @@ _exit: tEncoderClear(&encoder); for (int32_t i = 0; i < taosArrayGetSize(submitRsp.pArray); i++) { - taosMemoryFree(((SSubmitBlkRsp *)taosArrayGet(submitRsp.pArray, i))[0].name); + taosMemoryFree(((SSubmitBlkRsp *)taosArrayGet(submitRsp.pArray, i))[0].ename); } taosArrayDestroy(submitRsp.pArray);