diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index af3c44d0328812a8f7bb61557e6c1921d03512c0..0886bfd859dbe2f665b191a0545c1f0f4218d29d 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -49,10 +49,10 @@ static void doKeepPrevRows(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlock if (!colDataIsNull_s(pColInfoData, rowIndex)) { pkey->isNull = false; char* val = colDataGetData(pColInfoData, rowIndex); - if (!IS_VAR_DATA_TYPE(pkey->type)) { - memcpy(pkey->pData, val, pkey->bytes); - } else { + if (IS_VAR_DATA_TYPE(pkey->type)) { memcpy(pkey->pData, val, varDataLen(val)); + } else { + memcpy(pkey->pData, val, pkey->bytes); } } else { pkey->isNull = true; @@ -112,9 +112,9 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo char* p = colDataGetData(pColInfoData, rowIndex); if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { ASSERT(varDataTLen(p) <= pColInfoData->info.bytes); - memcpy(pLinearInfo->start.val, p, varDataTLen(p)); + memcpy(pLinearInfo->end.val, p, varDataTLen(p)); } else { - memcpy(pLinearInfo->start.val, p, pLinearInfo->bytes); + memcpy(pLinearInfo->end.val, p, pLinearInfo->bytes); } } pLinearInfo->isEndSet = true; @@ -128,9 +128,9 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo char* p = colDataGetData(pColInfoData, rowIndex); if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { ASSERT(varDataTLen(p) <= pColInfoData->info.bytes); - memcpy(pLinearInfo->start.val, p, varDataTLen(p)); + memcpy(pLinearInfo->end.val, p, varDataTLen(p)); } else { - memcpy(pLinearInfo->start.val, p, pLinearInfo->bytes); + memcpy(pLinearInfo->end.val, p, pLinearInfo->bytes); } } else {