fix:[TD-31097]process return value

This commit is contained in:
wangmm0220 2024-07-30 10:47:46 +08:00
parent 235712b79e
commit 1d98b32721
3 changed files with 4 additions and 5 deletions

View File

@ -3641,7 +3641,7 @@ int32_t tEncodeSTqOffsetVal(SEncoder* pEncoder, const STqOffsetVal* pOffsetVal);
int32_t tDecodeSTqOffsetVal(SDecoder* pDecoder, STqOffsetVal* pOffsetVal); int32_t tDecodeSTqOffsetVal(SDecoder* pDecoder, STqOffsetVal* pOffsetVal);
void tFormatOffset(char* buf, int32_t maxLen, const STqOffsetVal* pVal); void tFormatOffset(char* buf, int32_t maxLen, const STqOffsetVal* pVal);
bool tOffsetEqual(const STqOffsetVal* pLeft, const STqOffsetVal* pRight); bool tOffsetEqual(const STqOffsetVal* pLeft, const STqOffsetVal* pRight);
int32_t tOffsetCopy(STqOffsetVal* pLeft, const STqOffsetVal* pRight); void tOffsetCopy(STqOffsetVal* pLeft, const STqOffsetVal* pRight);
void tOffsetDestroy(void* pVal); void tOffsetDestroy(void* pVal);
typedef struct { typedef struct {

View File

@ -9238,18 +9238,17 @@ bool tOffsetEqual(const STqOffsetVal *pLeft, const STqOffsetVal *pRight) {
return false; return false;
} }
int32_t tOffsetCopy(STqOffsetVal *pLeft, const STqOffsetVal *pRight) { void tOffsetCopy(STqOffsetVal *pLeft, const STqOffsetVal *pRight) {
tOffsetDestroy(pLeft); tOffsetDestroy(pLeft);
*pLeft = *pRight; *pLeft = *pRight;
if (IS_VAR_DATA_TYPE(pRight->primaryKey.type)) { if (IS_VAR_DATA_TYPE(pRight->primaryKey.type)) {
pLeft->primaryKey.pData = taosMemoryMalloc(pRight->primaryKey.nData); pLeft->primaryKey.pData = taosMemoryMalloc(pRight->primaryKey.nData);
if (pLeft->primaryKey.pData == NULL) { if (pLeft->primaryKey.pData == NULL) {
uError("failed to allocate memory for offset"); uError("failed to allocate memory for offset");
return terrno; return;
} }
(void)memcpy(pLeft->primaryKey.pData, pRight->primaryKey.pData, pRight->primaryKey.nData); (void)memcpy(pLeft->primaryKey.pData, pRight->primaryKey.pData, pRight->primaryKey.nData);
} }
return 0;
} }
void tOffsetDestroy(void *param) { void tOffsetDestroy(void *param) {

View File

@ -1437,7 +1437,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
} }
end: end:
(void) tOffsetCopy(&pTaskInfo->streamInfo.currentOffset, pOffset); tOffsetCopy(&pTaskInfo->streamInfo.currentOffset, pOffset);
return 0; return 0;
} }