fix core dump
This commit is contained in:
parent
f848460f21
commit
b22ec52c63
|
@ -3230,8 +3230,8 @@ typedef struct {
|
||||||
|
|
||||||
int32_t tEncodeSSubmitReq2(SEncoder* pCoder, const SSubmitReq2* pReq);
|
int32_t tEncodeSSubmitReq2(SEncoder* pCoder, const SSubmitReq2* pReq);
|
||||||
int32_t tDecodeSSubmitReq2(SDecoder* pCoder, SSubmitReq2* pReq);
|
int32_t tDecodeSSubmitReq2(SDecoder* pCoder, SSubmitReq2* pReq);
|
||||||
void tDestroySSubmitTbData(SSubmitTbData* pTbData);
|
void tDestroySSubmitTbData(SSubmitTbData* pTbData, int32_t flag);
|
||||||
void tDestroySSubmitReq2(SSubmitReq2* pReq);
|
void tDestroySSubmitReq2(SSubmitReq2* pReq, int32_t flag);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int32_t code;
|
int32_t code;
|
||||||
|
|
|
@ -6809,30 +6809,46 @@ _exit:
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tDestroySSubmitTbData(SSubmitTbData *pTbData) {
|
void tDestroySSubmitTbData(SSubmitTbData *pTbData, int32_t flag) {
|
||||||
if (pTbData->pCreateTbReq) {
|
if (pTbData->pCreateTbReq) {
|
||||||
// todo
|
|
||||||
taosMemoryFree(pTbData->pCreateTbReq);
|
taosMemoryFree(pTbData->pCreateTbReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flag == TSDB_MSG_FLG_ENCODE) {
|
||||||
if (pTbData->flags & SUBMIT_REQ_COLUMN_DATA_FORMAT) {
|
if (pTbData->flags & SUBMIT_REQ_COLUMN_DATA_FORMAT) {
|
||||||
ASSERT(0); // TODO
|
|
||||||
} else {
|
|
||||||
if (pTbData->aRowP) {
|
|
||||||
int32_t nRow = TARRAY_SIZE(pTbData->aRowP);
|
int32_t nRow = TARRAY_SIZE(pTbData->aRowP);
|
||||||
SRow **rows = (SRow **)TARRAY_DATA(pTbData->aRowP);
|
SRow **rows = (SRow **)TARRAY_DATA(pTbData->aRowP);
|
||||||
|
|
||||||
for (int32_t i = 0; i < nRow; ++i) {
|
for (int32_t i = 0; i < nRow; ++i) {
|
||||||
tRowDestroy(rows[i]);
|
tRowDestroy(rows[i]);
|
||||||
}
|
}
|
||||||
taosArrayDestroy(pTbData->aRowP);
|
taosArrayDestroy(pTbData->aRowP);
|
||||||
|
} else {
|
||||||
|
int32_t nColData = TARRAY_SIZE(pTbData->aCol);
|
||||||
|
SColData *aColData = (SColData *)TARRAY_DATA(pTbData->aCol);
|
||||||
|
|
||||||
|
for (int32_t i = 0; i < nColData; ++i) {
|
||||||
|
tColDataDestroy(&aColData[i]);
|
||||||
|
}
|
||||||
|
taosArrayDestroy(pTbData->aCol);
|
||||||
|
}
|
||||||
|
} else if (flag == TSDB_MSG_FLG_DECODE) {
|
||||||
|
if (pTbData->flags & SUBMIT_REQ_COLUMN_DATA_FORMAT) {
|
||||||
|
taosArrayDestroy(pTbData->aCol);
|
||||||
|
} else {
|
||||||
|
taosArrayDestroy(pTbData->aRowP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tDestroySSubmitReq2(SSubmitReq2 *pReq) {
|
void tDestroySSubmitReq2(SSubmitReq2 *pReq, int32_t flag) {
|
||||||
if (NULL == pReq) return;
|
int32_t nSubmitTbData = TARRAY_SIZE(pReq->aSubmitTbData);
|
||||||
|
SSubmitTbData *aSubmitTbData = (SSubmitTbData *)TARRAY_DATA(pReq->aSubmitTbData);
|
||||||
|
|
||||||
taosArrayDestroyEx(pReq->aSubmitTbData, (FDelete)tDestroySSubmitTbData);
|
for (int32_t i = 0; i < nSubmitTbData; i++) {
|
||||||
|
tDestroySSubmitTbData(&aSubmitTbData[i], flag);
|
||||||
|
}
|
||||||
|
taosArrayDestroy(pReq->aSubmitTbData);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tEncodeSSubmitRsp2(SEncoder *pCoder, const SSubmitRsp2 *pRsp) {
|
int32_t tEncodeSSubmitRsp2(SEncoder *pCoder, const SSubmitRsp2 *pRsp) {
|
||||||
|
|
|
@ -978,7 +978,7 @@ _exit:
|
||||||
|
|
||||||
// clear
|
// clear
|
||||||
taosArrayDestroy(newTbUids);
|
taosArrayDestroy(newTbUids);
|
||||||
tDestroySSubmitReq2(pSubmitReq);
|
tDestroySSubmitReq2(pSubmitReq, TSDB_MSG_FLG_DECODE);
|
||||||
tDestroySSubmitRsp2(pSubmitRsp, TSDB_MSG_FLG_ENCODE);
|
tDestroySSubmitRsp2(pSubmitRsp, TSDB_MSG_FLG_ENCODE);
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
|
|
@ -1092,7 +1092,7 @@ void insDestroyTableDataCxt(STableDataCxt* pTableCxt) {
|
||||||
destroyBoundColInfo(&pTableCxt->boundColsInfo);
|
destroyBoundColInfo(&pTableCxt->boundColsInfo);
|
||||||
taosArrayDestroyEx(pTableCxt->pValues, destroyColVal);
|
taosArrayDestroyEx(pTableCxt->pValues, destroyColVal);
|
||||||
if (pTableCxt->pData) {
|
if (pTableCxt->pData) {
|
||||||
tDestroySSubmitTbData(pTableCxt->pData);
|
tDestroySSubmitTbData(pTableCxt->pData, TSDB_MSG_FLG_ENCODE);
|
||||||
taosMemoryFree(pTableCxt->pData);
|
taosMemoryFree(pTableCxt->pData);
|
||||||
}
|
}
|
||||||
taosMemoryFree(pTableCxt);
|
taosMemoryFree(pTableCxt);
|
||||||
|
@ -1103,7 +1103,7 @@ void insDestroyVgroupDataCxt(SVgroupDataCxt* pVgCxt) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tDestroySSubmitReq2(pVgCxt->pData);
|
tDestroySSubmitReq2(pVgCxt->pData, TSDB_MSG_FLG_ENCODE);
|
||||||
taosMemoryFree(pVgCxt);
|
taosMemoryFree(pVgCxt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue