fix:error in tmq meta
This commit is contained in:
parent
a015aca162
commit
8aa04f8e55
|
@ -440,7 +440,7 @@ static FORCE_INLINE bool tDecodeIsEnd(SDecoder* pCoder) { return (pCoder->size =
|
||||||
|
|
||||||
static FORCE_INLINE void* tEncoderMalloc(SEncoder* pCoder, int32_t size) {
|
static FORCE_INLINE void* tEncoderMalloc(SEncoder* pCoder, int32_t size) {
|
||||||
void* p = NULL;
|
void* p = NULL;
|
||||||
SCoderMem* pMem = (SCoderMem*)taosMemoryMalloc(sizeof(*pMem) + size);
|
SCoderMem* pMem = (SCoderMem*)taosMemoryCalloc(1, sizeof(*pMem) + size);
|
||||||
if (pMem) {
|
if (pMem) {
|
||||||
pMem->next = pCoder->mList;
|
pMem->next = pCoder->mList;
|
||||||
pCoder->mList = pMem;
|
pCoder->mList = pMem;
|
||||||
|
@ -451,7 +451,7 @@ static FORCE_INLINE void* tEncoderMalloc(SEncoder* pCoder, int32_t size) {
|
||||||
|
|
||||||
static FORCE_INLINE void* tDecoderMalloc(SDecoder* pCoder, int32_t size) {
|
static FORCE_INLINE void* tDecoderMalloc(SDecoder* pCoder, int32_t size) {
|
||||||
void* p = NULL;
|
void* p = NULL;
|
||||||
SCoderMem* pMem = (SCoderMem*)taosMemoryMalloc(sizeof(*pMem) + size);
|
SCoderMem* pMem = (SCoderMem*)taosMemoryCalloc(1, sizeof(*pMem) + size);
|
||||||
if (pMem) {
|
if (pMem) {
|
||||||
pMem->next = pCoder->mList;
|
pMem->next = pCoder->mList;
|
||||||
pCoder->mList = pMem;
|
pCoder->mList = pMem;
|
||||||
|
|
|
@ -4984,8 +4984,10 @@ int tDecodeSVCreateTbReq(SDecoder *pCoder, SVCreateTbReq *pReq) {
|
||||||
pReq->ctb.tagName = taosArrayInit(len, TSDB_COL_NAME_LEN);
|
pReq->ctb.tagName = taosArrayInit(len, TSDB_COL_NAME_LEN);
|
||||||
if(pReq->ctb.tagName == NULL) return -1;
|
if(pReq->ctb.tagName == NULL) return -1;
|
||||||
for (int32_t i = 0; i < len; i++){
|
for (int32_t i = 0; i < len; i++){
|
||||||
char *name = NULL;
|
char name[TSDB_COL_NAME_LEN] = {0};
|
||||||
if (tDecodeCStr(pCoder, &name) < 0) return -1;
|
char *tmp = NULL;
|
||||||
|
if (tDecodeCStr(pCoder, &tmp) < 0) return -1;
|
||||||
|
strcpy(name, tmp);
|
||||||
taosArrayPush(pReq->ctb.tagName, name);
|
taosArrayPush(pReq->ctb.tagName, name);
|
||||||
}
|
}
|
||||||
} else if (pReq->type == TSDB_NORMAL_TABLE) {
|
} else if (pReq->type == TSDB_NORMAL_TABLE) {
|
||||||
|
|
|
@ -494,8 +494,6 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t version, void *pR
|
||||||
taosArrayPush(rsp.pArray, &cRsp);
|
taosArrayPush(rsp.pArray, &cRsp);
|
||||||
}
|
}
|
||||||
|
|
||||||
tDecoderClear(&decoder);
|
|
||||||
|
|
||||||
tqUpdateTbUidList(pVnode->pTq, tbUids, true);
|
tqUpdateTbUidList(pVnode->pTq, tbUids, true);
|
||||||
tdUpdateTbUidList(pVnode->pSma, pStore);
|
tdUpdateTbUidList(pVnode->pSma, pStore);
|
||||||
tdUidStoreFree(pStore);
|
tdUidStoreFree(pStore);
|
||||||
|
@ -512,9 +510,12 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t version, void *pR
|
||||||
}
|
}
|
||||||
tEncoderInit(&encoder, pRsp->pCont, pRsp->contLen);
|
tEncoderInit(&encoder, pRsp->pCont, pRsp->contLen);
|
||||||
tEncodeSVCreateTbBatchRsp(&encoder, &rsp);
|
tEncodeSVCreateTbBatchRsp(&encoder, &rsp);
|
||||||
tEncoderClear(&encoder);
|
|
||||||
|
|
||||||
_exit:
|
_exit:
|
||||||
|
for (int32_t iReq = 0; iReq < req.nReqs; iReq++) {
|
||||||
|
pCreateReq = req.pReqs + iReq;
|
||||||
|
taosArrayDestroy(pCreateReq->ctb.tagName);
|
||||||
|
}
|
||||||
taosArrayDestroy(rsp.pArray);
|
taosArrayDestroy(rsp.pArray);
|
||||||
taosArrayDestroy(tbUids);
|
taosArrayDestroy(tbUids);
|
||||||
tDecoderClear(&decoder);
|
tDecoderClear(&decoder);
|
||||||
|
@ -795,6 +796,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
|
||||||
if (tDecodeSVCreateTbReq(&decoder, &createTbReq) < 0) {
|
if (tDecodeSVCreateTbReq(&decoder, &createTbReq) < 0) {
|
||||||
pRsp->code = TSDB_CODE_INVALID_MSG;
|
pRsp->code = TSDB_CODE_INVALID_MSG;
|
||||||
tDecoderClear(&decoder);
|
tDecoderClear(&decoder);
|
||||||
|
taosArrayDestroy(createTbReq.ctb.tagName);
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -802,6 +804,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
|
||||||
if (terrno != TSDB_CODE_TDB_TABLE_ALREADY_EXIST) {
|
if (terrno != TSDB_CODE_TDB_TABLE_ALREADY_EXIST) {
|
||||||
submitBlkRsp.code = terrno;
|
submitBlkRsp.code = terrno;
|
||||||
tDecoderClear(&decoder);
|
tDecoderClear(&decoder);
|
||||||
|
taosArrayDestroy(createTbReq.ctb.tagName);
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -822,6 +825,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
|
||||||
vnodeDebugPrintSingleSubmitMsg(pVnode->pMeta, pBlock, &msgIter, "real uid");
|
vnodeDebugPrintSingleSubmitMsg(pVnode->pMeta, pBlock, &msgIter, "real uid");
|
||||||
#endif
|
#endif
|
||||||
tDecoderClear(&decoder);
|
tDecoderClear(&decoder);
|
||||||
|
taosArrayDestroy(createTbReq.ctb.tagName);
|
||||||
} else {
|
} else {
|
||||||
submitBlkRsp.tblFName = taosMemoryMalloc(TSDB_TABLE_FNAME_LEN);
|
submitBlkRsp.tblFName = taosMemoryMalloc(TSDB_TABLE_FNAME_LEN);
|
||||||
sprintf(submitBlkRsp.tblFName, "%s.", pVnode->config.dbname);
|
sprintf(submitBlkRsp.tblFName, "%s.", pVnode->config.dbname);
|
||||||
|
|
Loading…
Reference in New Issue