From 7563ba2dfc064069a9316e1914f04f7d11b4210f Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 10 Dec 2022 14:07:34 +0800 Subject: [PATCH] fix(query): keep the correct value. --- source/libs/executor/src/timesliceoperator.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index af3c44d032..0886bfd859 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 { -- GitLab