提交 eb138b4d 编写于 作者: A Alex Duan

[TD-13349]<fix>(query): offset can skip calc error fixed

上级 1cb6f4c8
...@@ -1171,6 +1171,8 @@ static int32_t offsetSkipBlock(STsdbQueryHandle* q, SBlockInfo* pBlockInfo, int6 ...@@ -1171,6 +1171,8 @@ static int32_t offsetSkipBlock(STsdbQueryHandle* q, SBlockInfo* pBlockInfo, int6
q->frows += pBlock->numOfRows; // maybe have some row in memroy q->frows += pBlock->numOfRows; // maybe have some row in memroy
} }
} else { } else {
// already read rows belong to forbid skip rows -> frows
q->frows += pBlock->numOfRows;
// the remainder be put to pArray // the remainder be put to pArray
if(pArray == NULL) if(pArray == NULL)
pArray = taosArrayInit(1, sizeof(SRange)); pArray = taosArrayInit(1, sizeof(SRange));
...@@ -1237,22 +1239,24 @@ static int32_t offsetSkipBlock(STsdbQueryHandle* q, SBlockInfo* pBlockInfo, int6 ...@@ -1237,22 +1239,24 @@ static int32_t offsetSkipBlock(STsdbQueryHandle* q, SBlockInfo* pBlockInfo, int6
q->frows += pBlock->numOfRows; // maybe have some row in memroy q->frows += pBlock->numOfRows; // maybe have some row in memroy
} }
} else { } else {
// the remainder be put to pArray // already read rows belong to forbid skip rows -> frows
if(pArray == NULL) q->frows += pBlock->numOfRows;
pArray = taosArrayInit(1, sizeof(SRange)); // the remainder be put to pArray
if(range.from == -1) { if(pArray == NULL)
pArray = taosArrayInit(1, sizeof(SRange));
if(range.from == -1) {
range.from = i;
} else {
if(range.to - 1 != i) {
// add the previous
taosArrayPush(pArray, &range);
range.from = i; range.from = i;
} else {
if(range.to - 1 != i) {
// add the previous
taosArrayPush(pArray, &range);
range.from = i;
}
} }
range.to = 0; }
taosArrayPush(pArray, &range); range.to = 0;
range.from = -1; taosArrayPush(pArray, &range);
break; range.from = -1;
break;
} }
} }
...@@ -4658,4 +4662,4 @@ void tsdbAddScanCallback(TsdbQueryHandleT* queryHandle, readover_callback callba ...@@ -4658,4 +4662,4 @@ void tsdbAddScanCallback(TsdbQueryHandleT* queryHandle, readover_callback callba
pQueryHandle->readover_cb = callback; pQueryHandle->readover_cb = callback;
pQueryHandle->param = param; pQueryHandle->param = param;
return ; return ;
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册