提交 7691b972 编写于 作者: A Alex Duan

fix(query): fill check currentKey validate when set input data

上级 28c9e754
...@@ -451,6 +451,27 @@ void taosFillSetInputDataBlock(SFillInfo* pFillInfo, const SSDataBlock* pInput) ...@@ -451,6 +451,27 @@ void taosFillSetInputDataBlock(SFillInfo* pFillInfo, const SSDataBlock* pInput)
memcpy(pTag->tagVal, pColData->pData, pCol->col.bytes); // TODO not memcpy?? memcpy(pTag->tagVal, pColData->pData, pCol->col.bytes); // TODO not memcpy??
} }
} }
// check currentKey validate
if (!FILL_IS_ASC_FILL(pFillInfo)) {
int64_t* tsList = (int64_t*) pFillInfo->pData[0];
int32_t numOfRows = taosNumOfRemainRows(pFillInfo);
int64_t numOfRes = -1;
if (numOfRows > 0) {
TSKEY lastKey = tsList[pFillInfo->numOfRows - 1];
numOfRes = taosTimeCountInterval(
lastKey,
pFillInfo->currentKey,
pFillInfo->interval.sliding,
pFillInfo->interval.slidingUnit,
pFillInfo->precision);
numOfRes += 1;
if(numOfRes < numOfRows) {
// reset current Key
pFillInfo->currentKey = tsList[0];
}
}
}
} }
bool taosFillHasMoreResults(SFillInfo* pFillInfo) { bool taosFillHasMoreResults(SFillInfo* pFillInfo) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册