fix(query): remove invalid assert and fix the error in memcpy data.
This commit is contained in:
parent
0d687a533e
commit
c1a68f7f3b
|
@ -96,13 +96,26 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo
|
||||||
if (!pLinearInfo->isStartSet) {
|
if (!pLinearInfo->isStartSet) {
|
||||||
if (!colDataIsNull_s(pColInfoData, rowIndex)) {
|
if (!colDataIsNull_s(pColInfoData, rowIndex)) {
|
||||||
pLinearInfo->start.key = *(int64_t*)colDataGetData(pTsCol, rowIndex);
|
pLinearInfo->start.key = *(int64_t*)colDataGetData(pTsCol, rowIndex);
|
||||||
memcpy(pLinearInfo->start.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes);
|
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));
|
||||||
|
} else {
|
||||||
|
memcpy(pLinearInfo->start.val, p, pLinearInfo->bytes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pLinearInfo->isStartSet = true;
|
pLinearInfo->isStartSet = true;
|
||||||
} else if (!pLinearInfo->isEndSet) {
|
} else if (!pLinearInfo->isEndSet) {
|
||||||
if (!colDataIsNull_s(pColInfoData, rowIndex)) {
|
if (!colDataIsNull_s(pColInfoData, rowIndex)) {
|
||||||
pLinearInfo->end.key = *(int64_t*)colDataGetData(pTsCol, rowIndex);
|
pLinearInfo->end.key = *(int64_t*)colDataGetData(pTsCol, rowIndex);
|
||||||
memcpy(pLinearInfo->end.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes);
|
|
||||||
|
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));
|
||||||
|
} else {
|
||||||
|
memcpy(pLinearInfo->start.val, p, pLinearInfo->bytes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pLinearInfo->isEndSet = true;
|
pLinearInfo->isEndSet = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -111,7 +124,15 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo
|
||||||
|
|
||||||
if (!colDataIsNull_s(pColInfoData, rowIndex)) {
|
if (!colDataIsNull_s(pColInfoData, rowIndex)) {
|
||||||
pLinearInfo->end.key = *(int64_t*)colDataGetData(pTsCol, rowIndex);
|
pLinearInfo->end.key = *(int64_t*)colDataGetData(pTsCol, rowIndex);
|
||||||
memcpy(pLinearInfo->end.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes);
|
|
||||||
|
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));
|
||||||
|
} else {
|
||||||
|
memcpy(pLinearInfo->start.val, p, pLinearInfo->bytes);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
pLinearInfo->end.key = INT64_MIN;
|
pLinearInfo->end.key = INT64_MIN;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue