fix(stream): return after get value.

This commit is contained in:
Haojun Liao 2024-07-17 00:49:53 +08:00
parent f3cfd297b8
commit 749e7d6cf7
2 changed files with 6 additions and 3 deletions

View File

@ -2884,6 +2884,9 @@ static int32_t moveToNextFile(STsdbReader* pReader, SBlockNumber* pBlockNum, SAr
size_t numOfTables = tSimpleHashGetSize(pReader->status.pTableMap);
SArray* pIndexList = taosArrayInit(numOfTables, sizeof(SBrinBlk));
if (pIndexList == NULL) {
return TSDB_CODE_OUT_OF_MEMORY;
}
while (1) {
// only check here, since the iterate data in memory is very fast.
@ -3382,7 +3385,7 @@ static void initBlockDumpInfo(STsdbReader* pReader, SDataBlockIter* pBlockIter)
SFileBlockDumpInfo* pDumpInfo = &pStatus->fBlockDumpInfo;
int32_t code = getCurrentBlockInfo(pBlockIter, &pBlockInfo);
if (code != TSDB_CODE_SUCCESS) {
if (code == TSDB_CODE_SUCCESS) {
pDumpInfo->totalRows = pBlockInfo->numRow;
pDumpInfo->rowIndex = ASCENDING_TRAVERSE(pReader->info.order) ? 0 : pBlockInfo->numRow - 1;
} else {

View File

@ -126,8 +126,8 @@ int32_t getPosInBlockInfoBuf(SBlockInfoBuf* pBuf, int32_t index, STableBlockScan
}
int32_t getTableBlockScanInfo(SSHashObj* pTableMap, uint64_t uid, STableBlockScanInfo** pInfo, const char* id) {
*pInfo = tSimpleHashGet(pTableMap, &uid, sizeof(uid));
if (pInfo == NULL || *pInfo == NULL) {
*pInfo = *(STableBlockScanInfo**)tSimpleHashGet(pTableMap, &uid, sizeof(uid));
if (pInfo == NULL) {
int32_t size = tSimpleHashGetSize(pTableMap);
tsdbError("failed to locate the uid:%" PRIu64 " in query table uid list, total tables:%d, %s", uid, size, id);
return TSDB_CODE_INVALID_PARA;