fix(tsdb): check return value.

This commit is contained in:
Haojun Liao 2024-08-19 19:01:26 +08:00
parent 1b59d4a8d7
commit 2b68e110e5
3 changed files with 7 additions and 3 deletions

View File

@ -2246,6 +2246,8 @@ static int32_t lastIterClose(SFSLastIter **iter) {
static int32_t lastIterNext(SFSLastIter *iter, TSDBROW **ppRow) {
bool hasVal = false;
*ppRow = NULL;
int32_t code = tMergeTreeNext(iter->pMergeTree, &hasVal);
if (code != 0) {
return code;

View File

@ -1108,6 +1108,7 @@ int32_t tMergeTreeNext(SMergeTree *pMTree, bool *pHasNext) {
return TSDB_CODE_INVALID_PARA;
}
*pHasNext = false;
if (pMTree->pIter) {
SLDataIter *pIter = pMTree->pIter;
bool hasVal = false;

View File

@ -4105,9 +4105,10 @@ int32_t doMergeRowsInSttBlock(SSttBlockReader* pSttBlockReader, STableBlockScanI
while (1) {
code = nextRowFromSttBlocks(pSttBlockReader, pScanInfo, pkSrcSlot, pVerRange);
if (code) {
if (code || (!hasDataInSttBlock(pScanInfo))) {
return code;
}
SRowKey* pNextKey = getCurrentKeyInSttBlock(pSttBlockReader);
int32_t ret = pkCompEx(pRowKey, pNextKey);