Merge pull request #26866 from taosdata/opti/TD-31097

fix:[TD-31097]process return value
This commit is contained in:
dapan1121 2024-07-30 15:19:34 +08:00 committed by GitHub
commit 2a5bb9d06d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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);
void tFormatOffset(char* buf, int32_t maxLen, const STqOffsetVal* pVal);
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);
typedef struct {

View File

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

View File

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