未验证 提交 6e247e89 编写于 作者: X Xiaoyu Wang 提交者: GitHub

Merge pull request #19679 from taosdata/fix/TD-22030

fix(query): reset iter, iiter's hasVal to false when suspending reader
...@@ -4099,6 +4099,28 @@ int32_t tsdbReaderSuspend(STsdbReader* pReader) { ...@@ -4099,6 +4099,28 @@ int32_t tsdbReaderSuspend(STsdbReader* pReader) {
// pInfo->lastKey = ts; // pInfo->lastKey = ts;
} }
} else { } else {
// resetDataBlockScanInfo excluding lastKey
STableBlockScanInfo** p = NULL;
while ((p = taosHashIterate(pStatus->pTableMap, p)) != NULL) {
STableBlockScanInfo* pInfo = *(STableBlockScanInfo**)p;
pInfo->iterInit = false;
pInfo->iter.hasVal = false;
pInfo->iiter.hasVal = false;
if (pInfo->iter.iter != NULL) {
pInfo->iter.iter = tsdbTbDataIterDestroy(pInfo->iter.iter);
}
if (pInfo->iiter.iter != NULL) {
pInfo->iiter.iter = tsdbTbDataIterDestroy(pInfo->iiter.iter);
}
pInfo->delSkyline = taosArrayDestroy(pInfo->delSkyline);
// pInfo->lastKey = ts;
}
pBlockScanInfo = pStatus->pTableIter == NULL ? NULL : *pStatus->pTableIter; pBlockScanInfo = pStatus->pTableIter == NULL ? NULL : *pStatus->pTableIter;
if (pBlockScanInfo) { if (pBlockScanInfo) {
// save lastKey to restore memory iterator // save lastKey to restore memory iterator
...@@ -4107,7 +4129,8 @@ int32_t tsdbReaderSuspend(STsdbReader* pReader) { ...@@ -4107,7 +4129,8 @@ int32_t tsdbReaderSuspend(STsdbReader* pReader) {
// reset current current table's data block scan info, // reset current current table's data block scan info,
pBlockScanInfo->iterInit = false; pBlockScanInfo->iterInit = false;
// pBlockScanInfo->iiter.hasVal = false; pBlockScanInfo->iter.hasVal = false;
pBlockScanInfo->iiter.hasVal = false;
if (pBlockScanInfo->iter.iter != NULL) { if (pBlockScanInfo->iter.iter != NULL) {
pBlockScanInfo->iter.iter = tsdbTbDataIterDestroy(pBlockScanInfo->iter.iter); pBlockScanInfo->iter.iter = tsdbTbDataIterDestroy(pBlockScanInfo->iter.iter);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册